Skip to content

How to install jailoc

jailoc runs on macOS on Apple Silicon and on Linux amd64 (arm64 experimental) with KVM and Landlock. Check your platform first, then install with Homebrew, a pre-built binary, Nix or from source.

Install with Homebrew Choose a pre-built binary

Check your platform

Every workspace runs in its own libkrun micro-VM. jailoc supports these host platforms:

Platform Hypervisor Requirement
macOS on Apple Silicon (darwin/arm64) Hypervisor.framework None
Linux on x86-64 (linux/amd64) KVM Read and write access to /dev/kvm; Landlock ABI 3 or later (Linux 6.2+)
Linux on ARM64 (linux/arm64) KVM Same as linux/amd64; experimental, not covered by the VM integration tests

On Linux, check that KVM is available and that your user can open it:

ls -l /dev/kvm

If the device belongs to the kvm group, add yourself to it and log in again:

sudo usermod -aG kvm "$USER"

jailoc confines the VM process with Landlock and refuses to start a VM when the kernel lacks it. Check that landlock is listed among the active security modules:

cat /sys/kernel/security/lsm

If it is missing, add landlock to the lsm= kernel parameter.

Linux file ownership

On Linux, libkrun's virtio-fs shows the real host owner of every file, so jailoc-guest mounts the boot root (jailoc's own files) and the shares idmapped: inside the VM your files appear as root's or the agent's, and on the host everything belongs to your user. The image layers keep the image's own owners. Root inside the VM cannot give a shared file another host owner. If the guest kernel rejects idmapped mounts, the agent falls back to your user's UID and GID, and jailoc-guest idmaps the image layers so that the agent's files in the image appear as yours.

Other platforms, including Intel Macs, are unsupported. If you build the go-microvm runner and libkrun yourself, point jailoc at them in the [vm] section:

[vm]
runner = "~/.local/bin/go-microvm-runner"
lib_dir = "/opt/libkrun/lib"

Know when Docker is needed

The workspace VMs don't use Docker. You need Docker Engine on the host only for:

Without a usable host daemon, "auto" builds images in a builder VM. A workspace with isolated_build = true always builds in its own builder VM.

Install with Homebrew

Unsigned binary

jailoc binaries are not signed or notarized by Apple. The cask removes the com.apple.quarantine attribute from jailoc after installation so that Gatekeeper does not block it.

On macOS and Linux, install the latest release from the seznam/homebrew-tap tap:

brew install --cask seznam/tap/jailoc

Upgrade with brew upgrade --cask jailoc. The tap carries stable releases only; install release candidates from the GitHub Releases page. The cask installs both jailoc and the jl alias on your PATH.

Install with Nix

Run jailoc without installing it:

nix run github:seznam/jailoc

To install it, add the flake to your inputs:

{
  inputs.jailoc.url = "github:seznam/jailoc";
}

Then include the package in environment.systemPackages or home.packages:

inputs.jailoc.packages.${pkgs.stdenv.hostPlatform.system}.jailoc

On Linux (x86_64, aarch64), the package builds the VM runtime (go-microvm runner, patched libkrun, libkrunfw) from source and points jailoc at it, so you don't need a [vm] section. A runner set in the [vm] section takes precedence. Hosts without access to a binary cache compile these components on the first build, including a Linux kernel for libkrunfw, which takes a while.

aarch64-darwin

On macOS the Nix package has no VM runtime. Set runner and lib_dir in the [vm] section as shown in Check your platform, or install with Homebrew instead.

Install a pre-built binary

Every release publishes archives for macOS (arm64) and Linux (amd64, arm64). Each contains jailoc, the jl alias, LICENSE, README.md and THIRD_PARTY_NOTICES. Download the archive for your platform:

Download v2.12.0 for macOS on Apple Silicon Download v2.12.0 for Linux amd64 Download v2.12.0 for Linux arm64 (experimental)

These archives are for v2.12.0; verify them against its SHA-256 checksums. Other releases are on GitHub:

Open the latest release on GitHub

Extract the archive and place jailoc (and jl, if you want the alias) on your PATH.

Gatekeeper on macOS

The binary isn't signed or notarized by Apple, so Gatekeeper can block a jailoc downloaded with a browser. Remove the quarantine attribute, as the Homebrew cask does: xattr -d com.apple.quarantine jailoc.

Update a pre-built binary

Check which release would be installed, then install it:

jailoc self-update --check
jailoc self-update

By default, jailoc self-update installs the highest stable release published at least 24 hours ago. Use --version <tag> for a specific release, including a prerelease or an older one, and --no-cooldown for the most recent stable release regardless of age. --force skips the development-build and Homebrew guards; it does not skip verification and does not apply to Nix installations. Homebrew installations update with brew upgrade --cask jailoc, Nix installations through Nix. See the jailoc self-update reference for the verification steps and flags.

When gh is installed, the update runs gh attestation verify on the release attestation, and any failure, including a gh too old to support it, stops the installation. Without gh, the command warns that the attestation rests on what the GitHub API reports and that signatures were not verified locally.

Running workspace VMs keep the old guest, network broker and supervisor until you run jailoc restart <workspace>.

Build from source

go install github.com/seznam/jailoc/cmd/jailoc@... produces a binary without jailoc-guest, the VM init, and cannot start workspaces. Build from a checkout instead, embedding the guest binary and the listener broker (jailoc-listener-broker, installed by jailoc proxy install) with go generate:

git clone https://github.com/seznam/jailoc.git
cd jailoc
go generate ./internal/guestbin ./internal/brokerbin
go install ./cmd/jailoc

The binary lands in $GOPATH/bin (or $HOME/go/bin by default). Make sure that directory is on your PATH.

A source build doesn't include the VM runtime (the jailoc-vm-runner process, libkrun and the libkrunfw guest kernel) and fails to start workspaces with this jailoc build does not include the VM runtime. Either set runner and lib_dir in the [vm] section as shown in Check your platform, or build a binary with the runtime embedded:

task

Task builds the runtime for your host (macOS arm64, Linux amd64 or arm64) into internal/vm/runtimebin/<os>-<arch>/ with the scripts in scripts/vm-runtime/ and writes the binary to dist/jailoc. It needs Git and Podman or Docker; on macOS also the Xcode command line tools, Rust and curl. The first run takes a while, later runs reuse the runtime until the pinned go-microvm revision or the scripts change.

Know where the VM runtime lives

Release binaries embed the VM runtime for their platform. The first jailoc up unpacks it into ~/.cache/jailoc-vm/runtime/ and later starts reuse it; nothing is downloaded. On Linux, the Nix package references its runtime in the Nix store instead.

To use your own libkrunfw build, point lib_dir in the [vm] section at a directory with your libkrun and libkrunfw libraries and set runner to a matching jailoc-vm-runner (or go-microvm-runner).

Check the runtime licenses

jailoc itself is MIT-licensed. The embedded runtime, and the Nix-built components, carry their own licenses:

Component License Notes
jailoc-vm-runner Apache-2.0 Built from go-microvm; runs as a separate process
libkrun Apache-2.0 Built with the patches in scripts/vm-runtime/libkrun-patches/
musl libc MIT Statically linked into libkrun's guest init
libkrunfw LGPL-2.1-only (library), GPL-2.0-only (bundled Linux kernel)

Each release provides these compliance artifacts:

  • Notices: every release archive contains THIRD_PARTY_NOTICES with the license texts of all bundled Go modules, Rust crates and runtime libraries. Each unpacked runtime directory contains LICENSE, NOTICE, the libkrunfw license texts and a SOURCE file.
  • Corresponding source: every GitHub Release attaches the complete corresponding source of libkrunfw, including the Linux kernel tarball and build scripts, as jailoc_<version>_vm-runtime-source.tar.
  • SBOMs: every release has SPDX SBOMs, generated by syft. <archive>.sbom.json lists the Go modules in jailoc, and jailoc_<version>_vm-runtime_<os>_<arch>.sbom.json lists the Go modules in the embedded jailoc-vm-runner and the Rust crates in libkrun (built with cargo-auditable). syft can't detect libkrunfw, so THIRD_PARTY_NOTICES remains the complete list.
  • Attestations: release assets carry build provenance attestations. Check that the jailoc release workflow built a file:
gh attestation verify jailoc_<version>_linux_amd64.tar.gz --repo seznam/jailoc
  • Immutable releases: a release is published only after every asset is attested, and its assets and tag can't change afterwards. Check that a downloaded file matches the published release:
gh release verify-asset v<version> jailoc_<version>_linux_amd64.tar.gz --repo seznam/jailoc