For AI agents: the complete documentation index is available at https://enclo.nstlopez.com/llms.txt, the full documentation bundle is available at https://enclo.nstlopez.com/llms-full.txt, and this page is available as Markdown at https://enclo.nstlopez.com/guide/building.md.

Building from source

On macOS, you can install enclo without building via Homebrew. On Linux, building from source is currently the only option.

Building requires an Apple silicon Mac or a Linux machine with /dev/kvm. Intel Macs are not supported, and Windows is not supported yet. Run all commands below from the repository root:

git clone https://github.com/Nsttt/enclo
cd enclo
Debian and Ubuntu
Fedora and openSUSE
macOS

For Debian 13 and Ubuntu 24.04. Your user must be able to open /dev/kvm; if not, run sudo usermod -aG kvm "$USER" and log in again.

sudo apt install gcc libc6-dev libclang-dev make pkg-config curl erofs-utils e2fsprogs
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
. "$HOME/.cargo/env"
rustup target add "$(uname -m)-unknown-linux-musl"
scripts/install-libkrun.sh ~/.local/enclo
export LIBKRUN_LIB_DIR=~/.local/enclo/lib64
make install

Skip the second and third lines if you already have Rust installed via rustup. The export line applies only to the current shell, and subsequent builds require it, so add it to your shell profile.

make install builds the guest images, enclo-shim, and the enclo binary, then installs them under ENCLO_HOME (default ~/.enclo). It is safe to re-run, and it prints the PATH line to add to your shell startup file. Once installed, connect your harness.

Running make m0 instead of make install builds the same components and boots a single sandbox to verify the boot path, ending with PASS: milestone 0 exit test.

Linux requirements

  • Your user must be able to open /dev/kvm, which on most distributions means being in the kvm group.
  • erofs-utils must be version 1.7 or newer and built with zlib support. Debian 12 and Ubuntu 22.04 ship older versions that must be built from source.
  • Rust must be installed via rustup so you can add the musl target required by the guest agent.

More

See Building enclo from source in the repository for per-distribution notes, running enclo-shim directly with a spec file, release builds, Make targets, cross-architecture testing, and the repository layout.