Installing chasm
These instructions provision a fresh x86_64 host. They are tested on Debian 13,
Ubuntu 26.04, Ubuntu 24.04, Fedora 45 (SELinux enforcing) and Arch Linux;
Debian 12 is untested. On hosts outside the Debian family, pass
--allow-untested-host (see Requirements recap). The installer is
scripts/install-chasm.sh in this repository; run it from a checkout.
git clone https://github.com/rahulrajaram/chasm.git
cd chasm
Compact install
Use this setup for one sandbox on a fresh Debian 13 x86_64 site that meets the host requirements. Allow 18 GiB free on the filesystem holding /var/lib/incus. The sandbox gets a 4 GiB root disk within an 8 GiB storage pool. Preflight requires the 8 GiB pool plus a 10 GiB margin. The template build also refuses to start when the filesystem holding /var/lib/incus is less than 10% free (by df use percentage), so 18 GiB free may not be enough on a large, nearly full filesystem.
-
From the trusted checkout, open
host-config/site.conf.examplein your editor before the first provision. Set the pool size and uncomment the guest disk setting. Leave the other settings at their defaults if the default network is available.pool_size_gib=8 profile_root_disk_gib=4 -
Run the installer as your ordinary operator account using sudo. It checks host prerequisites and copies the descriptor into place on a fresh site.
sudo scripts/install-chasm.sh --provision sudo scripts/install-chasm.sh --verify -
Follow Your first sandbox to create and start a guest.
The Debian 13 trial used about 2.3 GiB of additional space on the Incus filesystem with the image, sealed template and one running guest. Host OS files and packages were on a separate filesystem. Allow more space for larger workloads, snapshots or additional guests. Keeping the stock 64 GiB pool instead requires 74 GiB free before provisioning.
Use a trusted checkout
Provisioning runs as root and uses code and configuration from this
checkout, so only run it from a checkout you trust. Before loading code,
the installer checks checkout ownership and permissions. With root
provisioning, every path in the checkout (except .git) must be owned by
root or by the invoking user, and no path may be world-writable. A
world-writable path is refused. Group-writable paths are allowed but
produce a warning because root will use those files. A direct root
invocation therefore needs a root-owned checkout; when invoked through
sudo, the checkout may be owned by the user who invoked sudo.
Requirements recap
- Linux on x86_64. Tested on Debian 13, Ubuntu 26.04, Ubuntu 24.04,
Fedora 45 (SELinux enforcing) and Arch Linux; Debian 12 is untested.
Upgrades are tested on Debian 13 only. Hosts outside the Debian family
need
--allow-untested-host, and you install Incus,incus-agent,virtiofsdand Go yourself. On Ubuntu 24.04 the defaultgolang-gois 1.22, too old: install a versioned package such asgolang-1.23-goor newer and put itsgoon root’sPATH, and installincus-agentexplicitly. /dev/kvmpresent, and nested virtualization disabled (below).- systemd, nftables and iproute2. A fresh managed Btrfs pool needs
btrfs-progs, and the managed Incus bridge needsdnsmasq-base. - Incus with its VM guest agent (
incus-agent), andvirtiofsd. Some Incus packagings ship the agent as a separate package that a minimal install can leave out; the template build then fails withbuilder agent readiness timed out. Install them yourself, or opt in to the acquisition step with--install-incusduring provisioning (Debian 12 and 13 only). That step uses Debian’s own repositories: the release’s repositories on Debian 13 (trixie) and newer, orbookworm-backportson Debian 12 (bookworm; refused when nobookworm-backportssource is configured). - A working QEMU VM backend for Incus. On Debian amd64, keep the matching
QEMU packages, including
qemu-utils,ovmf, andqemu-system-modules-spice, when installing with recommendations disabled. Install the QEMU modules from the same Debian suite asqemu-system-x86. If QEMU came fromtrixie-backports, select that suite forqemu-utilsandqemu-system-modules-spicetoo. The default Chasm profile enables UEFI Secure Boot. A container-capable Incus daemon can still lack a working VM driver. - A Go toolchain, 1.23 or newer (the
godirective ingo.mod), on root’sPATH; the control plane is built from this checkout during provisioning. Preflight checks only thatgoexists, not its version, so an older toolchain passes preflight and then fails at the payload build step. A private build cache is used when the environment supplies neither a home directory nor a cache path. - Internet access at provision time (the Debian package install and the base-image download).
- Disk space for the selected pool. See compact install for the tested small-site settings.
- Provide memory for each sandbox budget you plan to run plus the host. Budgets
have a 512 MiB floor and no fixed product cap: a budget is refused when
it exceeds the host’s memory minus
host_reserve_mib.
Disabling nested virtualization
Preflight refuses to continue when the loaded KVM module reports nested virtualization enabled. The supported site shape keeps guests from launching their own hardware-accelerated VMs; the check makes that shape explicit rather than advisory.
The fix is shipped in the tree. Install the matching drop-in and reload the module (or reboot):
sudo install -o root -g root -m 0644 \
host-config/modprobe.d/kvm-intel-no-nesting.conf \
/etc/modprobe.d/kvm-intel-no-nesting.conf # or kvm-amd-no-nesting.conf
sudo modprobe -r kvm_intel && sudo modprobe kvm_intel # or kvm_amd
The drop-in sets nested=0 for the module. Host-created VMs — chasm’s
own sandboxes included — are unaffected.
Installer modes
install-chasm.sh [--help|--check|--provision|--verify] [--harden-ssh]
[--install-incus] [--allow-untested-host]
--provision— first-run installation. Every root step prompts for approval on the terminal before it runs;CHASM_ASSUME_YES=1in the environment pre-approves every step. Re-runs resume. Completed steps such as the descriptor write, the identity pin, Incus initialization and a current template build are detected and skipped. The payload step rebuilds and reinstalls on every run.--verify— read-only identity, drift, and service-health report. This is the default when the script is run with no argument. It changes nothing; probes that need root are skipped with an explanation when run unprivileged.--check— the same probes as--verifyunder a check-summary label.--harden-ssh— opt in to the sshd hardening step of--provision(below). It is accepted only with--provisionand is a usage error with any other mode. Requires the optionalplugins/ssh-hardeningadd-on (see plugins.md); without the plugin in the tree the flag fails with a clear message.--install-incus— opt in to the Incus acquisition step of--provision(below). It is accepted only with--provisionand is a usage error with any other mode. Requires the optionalplugins/install-incusadd-on; without the flag the installer installs no packages and requires incus and virtiofsd to be present already.--allow-untested-host— explicitly bypass the non-Debian qualification gate for provisioning. Capability checks still run, and this does not make the distro supported. Equivalent environment opt-in: setCHASM_ALLOW_UNTESTED_HOST=1.--help— the full installer surface.
CHASM_SITE_CONF selects an alternate descriptor path for read-only
runs; it is rejected under --provision, which always writes and pins
the installed descriptor.
See site configuration for descriptor values and their change considerations.
Installer exit status is 0 on completed provisioning or a clean verification, 1 on installer-reported failure or verification drift, and 2 on invalid command usage. A subordinate tool can propagate a different failure status. A failed provisioning step can leave earlier steps applied. Verify mode may report skipped root-only checks while returning 0. Use root when qualifying all checks and read the skipped count in the summary.
What provisioning does
In order, one approval per step:
- Preflight (read-only): Debian-family qualification gate (non-Debian
hosts require
--allow-untested-hostorCHASM_ALLOW_UNTESTED_HOST=1), systemd, nftables,/dev/kvmwith nesting off, disk headroom, storage pool growth plan, Docker coexistence detection (informational), sandbox bridge prefix collision, operator account, resolved through host NSS, Go toolchain, Incus and virtiofsd and hostincus-agentpresence, and a Go toolchain at the version required bygo.mod. The installed supervisor unit permits only Unix-domain sockets. Network-backed NSS configurations therefore require a local Unix-socket resolver proxy (for example, SSSD or nslcd), with its socket accessible under the unit’s other restrictions; direct network-socket NSS backends are unsupported. Preflight runsgetentoutside the unit and does not enforce this limit, so it may pass even when the supervisor later fails to resolve the operator. Capability checks on an untested distro do not make it supported. Automatic Incus package installation remains Debian-only. Incus socket discovery usesINCUS_SOCKET, then the root-owned/etc/chasm/incus-socketsetting, then/var/lib/incus/unix.socket, then/run/incus/unix.socket. The socket and all parent directories must be root-owned; parents may not be group- or world-writable. An explicit override must name an existing local Unix socket. SetINCUS_SOCKETduring provisioning to persist that path in root-owned/etc/chasm/incus-socket(mode 0600); Chasm services and the narrow shell helper use this fixed setting without inheriting arbitrary caller environment. A later--provisionwithout an explicit override removes the prior setting and selects a standard socket. With sudoenv_reset, pass overrides assudo INCUS_SOCKET=/path/to/socket install-chasm.sh --provisionorsudo CHASM_ALLOW_UNTESTED_HOST=1 install-chasm.sh --provision; variables set only in the invoking shell are dropped. - Incus install (only with
--install-incusand only if absent):apt-get install incus virtiofsdfrom the release’s own repositories on Debian 13 (trixie) and newer; on Debian 12 (bookworm),apt-get install -t bookworm-backports incus virtiofsd. Debian’s own repositories either way, no third-party source, and the bookworm step is refused up front when nobookworm-backportsapt source is configured. Without--install-incusthe installer installs no packages: install incus and virtiofsd yourself and re-run. The acquisition logic lives in the optionalplugins/install-incusadd-on (plugins.md); Incus itself remains a prerequisite validated by preflight either way. - Descriptor write (first provision only): copies
host-config/site.conf.exampleto/etc/chasm/site.conf(root:root 0644) and fills in the resolvedsite_nameandoperator_user; on a re-run the existing descriptor is kept, and only itssite_nameandoperator_userlines are rewritten with the resolved values. - Identity pin: writes this machine’s fingerprint to
/etc/chasm/site-host-id(root 0444). The installer pins it once and refuses a mismatch on later runs; runtime privileged entries verify the host against it. - Payload install: builds the Go binaries and installs
chasmandchasmctlin/usr/local/bin/and the service executables in/usr/local/sbin/(on SELinux enforcing hosts it runsrestoreconand verifies thebin_tlabels). It keeps compatibility links in the older/usr/local/lib/chasm/go/and/usr/local/libexec/chasm/directories, then copies the provision tree (scripts, host and guest configuration) under/usr/local/lib/chasm/provision/, installs the core profile manifest into/etc/chasm/profiles/(only when absent; see plugins.md for upgrade semantics), and installs the firewall helper (/usr/local/sbin/chasm-firewall), its ruleset template (/etc/chasm/firewall.nft.template), and the control-plane units, sockets, sudoers, sysusers, and tmpfiles fragments. - SSH hardening (opt-in, off by default): with
--harden-ssh, the step (theplugins/ssh-hardeningadd-on; plugins.md) installs two sshd_config drop-ins that disable SSH password and root login (public-key only) and reloads sshd. The drop-ins also disable keyboard-interactive authentication and add.ssh/authorized_keys-chasmas an accepted authorized-keys file. Before asking for approval it warns plainly that it makes these changes and that the operator must already hold a working SSH key for the operator account or console access — a host with neither is locked out; there is no key guard. The confirmation itself must be typed (yes) on the terminal:CHASM_ASSUME_YESdoes not pre-approve this one step. The step stages signal-safely: existing drop-ins are copied (never moved) to a backup directory, a trap restores them on any failure or interruption, the full configuration is validated withsshd -tbefore anything is reloaded, and only after the reload succeeds is the backup removed. When onlyssh.socketis active the drop-ins take effect for new connections (socket activation starts a fresh sshd per connection; a.socketunit is never reloaded); when no ssh unit is active the step says so and the drop-ins take effect at the next sshd start. Without the flag the step prints one skip line and leaves already-installed drop-ins alone. - Incus initialization:
incus admin initfrom the rendered preseed — a btrfs loop-backed storage pool (64 GiB by default, frompool_size_gib), a managed IPv4 NAT bridge, and the sandbox profile. When the pool already exists (the re-run path), the provision applies the pool growth plan instead: see Growing the storage pool. - Sealed template build: builds the sealed sandbox template from the
site’s bootstrap profile (
minimalby default) in a disposable builder VM. The build installs the profile’s package list and creates the neutral guest account every core path assumes: useragentwith uid and gid pinned to the descriptor’sguest_uid, home/home/agent(mode 0750), login shell/usr/bin/zsh, and no password, groups, or sudo rights. The account carries a minimal/home/agent/.zshrc(fromguest-config/guest/zshrc, agent:agent 0644) sochasm shellnever lands in zsh’s first-run newuser menu. The first build downloads the base image named bybase_image_remote; expect a multi-hundred-megabyte download and a slow first run. With the shipped defaults, the builder needs 3 GiB, the host reserve is 1024 MiB, and the build margin is 256 MiB, for a minimumMemTotalof 4352 MiB before adding configured budgets of running sandboxes.MemAvailablemust also cover the need when the build starts. A rebuild is admitted while sandbox VMs run — the builder never stops or touches them — as long asMemTotalcovers the profile’slimits.memoryplushost_reserve_mibplus a margin plus the configured budgets of every running sandbox (the same headroom rule sandbox starts use), andMemAvailablestill covers the need at that moment; a short-memory host refuses, naming the numbers. - Post-install verify and the quickstart.
Growing the storage pool
The supported path for growing the pool is the site descriptor plus
provision — never incus storage set by hand:
- Edit
pool_size_gibin/etc/chasm/site.confto the new size in GiB. - Rerun
sudo install-chasm.sh --provision.
Provision compares the descriptor with the pool’s configured size:
- Equal — nothing to do.
- Larger — provision first checks that the host can back the growth: for the loop-backed pool, the added ceiling (the new size minus the loop file’s currently allocated bytes) plus a 10 GiB margin must fit in the free space of the filesystem holding the loop file, with every number named in the verdict. With the operator’s approval the pool is grown and the new size is proven by reading it back.
- Smaller — refused before any other change:
shrinking a storage pool is not supported; pool is XGiB, site asks for YGiB. Choose a size at or above the current pool size.
Note that pool_size_gib is a ceiling on the loop file, not a
reservation: the file only grows as sandboxes actually use space.
What the installer changes on the host
| Area | Change |
|---|---|
| Users | One system user for the supervisor (chasm-supervisor by default, via the sysusers fragment), home under /var/lib/chasm/supervisor, no login shell |
| Configuration | /etc/chasm/site.conf (the site descriptor) and the identity marker /etc/chasm/site-host-id |
| Binaries | /usr/local/bin/chasm and chasmctl (operator CLIs and sudo entry helper); /usr/local/sbin/chasm-executor-server and chasm-supervisor-server (system services); /usr/local/lib/chasm/provision/ (provision tree); compatibility links under /usr/local/lib/chasm/go/ and /usr/local/libexec/chasm/ |
| systemd units | chasm-executor.service + .socket (root), chasm-supervisor.service + .socket (unprivileged), chasm-firewall.service — all enabled |
| sudo | /etc/sudoers.d/chasm — grants the operator the narrow chasm __shell, __exec, and __doctor entries through /usr/local/bin/chasm |
| Firewall | /usr/local/sbin/chasm-firewall and /etc/chasm/firewall.nft.template; manages the inet chasm nftables table and bridge-scoped iptables accepts in INPUT/FORWARD when available; Docker rules are not rewritten |
| Incus | Storage pool (storage_pool, default chasm), NAT bridge (bridge_name, default chasmbr0), sandbox profile (profile_name, default chasm), base image alias (base_image_alias, default chasm-debian-13), and the sealed template instance. resource_prefix (default chasm) names the instance metadata keys user.<prefix>.*, the <prefix>-shared and <prefix>-workspace-<instance> volumes, and the <prefix>-template-* instances. Sandbox instances are always named sandbox-<name>. On first initialization the preseed also empties the Incus default profile and sets images.auto_update_interval to 0. |
| sshd | with --harden-ssh only: /etc/ssh/sshd_config.d/00-chasm.conf and 99-chasm.conf (off by default) |
| Temporary/runtime | sysusers and tmpfiles fragments under /usr/lib/sysusers.d/ and /usr/lib/tmpfiles.d/; state under /var/lib/chasm/; sockets under /run/ |
Beyond installing the Incus and virtiofsd packages (step 2) and the Incus
server changes in the table above, nothing else on the host is modified. On a
host that already runs Incus workloads, note that the first initialization
empties the default profile. Removing everything is covered in
upgrade-and-uninstall.md.
Verifying an installed site
sudo scripts/install-chasm.sh --verify
The drift report validates the descriptor and the identity pin. It checks
that each installed binary, provision-tree marker, unit and fragment is
present and that executables are executable. It checks that the CLI symlinks
point at the installed binaries and that both sockets and the firewall service
are active. It checks the Incus pool, the bridge (its IPv4 address and disabled
IPv6), the profile and the sealed template, including staleness against the
installed provision tree. It also checks the nftables table and its leading
IPv6 drops and, when run as root, the sshd hardening fragments:
absent fragments are reported as ssh hardening: not applied (optional)
(hardening is opt-in, so their absence is not drift), present fragments
are verified against the shipped content, and any foreign drop-in that
sorts before 00-chasm.conf and sets the hardening keywords is drift
while a chasm fragment is installed (OpenSSH’s first-value rule means
such a fragment wins); with the hardening not applied there is nothing
to override, so the foreign winner is only an informational note. An
unprivileged run skips that probe. The installed copy under
/usr/local/lib/chasm/provision/scripts/ runs the same checks after the
checkout is gone, except this one. The installed tree does not include
plugins/, so it skips the probe with ssh-hardening plugin not present.
Run --verify from a trusted checkout that contains plugins/ssh-hardening
to check the fragments.
It does not compare installed binaries or unit files byte-for-byte with the checkout.
Next: first-sandbox.md.