Skip to Content
Spunto Sandbox

Installation

What the machine needs, what the installer does, upgrades, removal.

Requirements

CPUx86_64 with hardware virtualization: /dev/kvm must exist
Wherebare metal, or a cloud VM with nested virtualization (GCP: --enable-nested-virtualization; most clouds have an equivalent or a metal instance)
OSLinux with systemd and cgroup v2: Ubuntu 22.04+, Debian 12+ (others work; the installer only knows apt for missing packages)
StorageZFS: a pool of yours, or a pool in a file made by the installer (--create-pool)
Memorywhat the boxes need: they start at their size's announced RAM but only take what their guest touches

The installer checks each of these and says what is missing.

Install

curl -fsSL https://sandbox.spunto.net/install.sh | sudo sh
OptionEnvironment
--create-pool <size>SBX_CREATE_POOLno ZFS pool: make sandbox in /var/lib/spunto-sandbox/pool.img, sparse. To try it; a real disk is faster
--dataset <pool/name>SPUNTO_FC_DATASETwhere everything goes. Default: <first pool>/spunto
--memory <size>SBX_MEMORYwhat all boxes may take together (vms.slice). Default: RAM − 2 GB
--version <v>SBX_VERSIONa release; default the latest
--from <dir>SBX_FROMa dist/ you built (npm run build) instead of a release

A pool of your own

On a disk or a partition you can give it: zpool create -o ashift=12 -O compression=lz4 sandbox /dev/nvme1n1. Then run the installer: it picks the pool up.

What it installs

PathWhat
/opt/spunto-fc/binfirecracker, jailer, snapshot-editor (Firecracker v1.17.0), tini, a static busybox, crane
/opt/spunto-fc/nodethe daemon's own Node runtime (v24)
/opt/spunto-fc/kernelsthe guest kernel — fetched by the daemon at its start, checked against its pinned sha256
/opt/spunto-sandboxsandboxd.mjs, sbx.mjs, sbx-agent
/usr/local/bin/sbxthe CLI
/etc/spunto-sandbox/sandboxd.envthe daemon's settings (root only)
/etc/systemd/system/spunto-sandboxd.servicethe service
/etc/systemd/system/vms.slicethe slice every microVM runs in, and its memory ceiling
/var/lib/spunto-fcthe engine's state: its registry, memory files mounts, jails
/var/lib/spunto-sandboxthe daemon's state: its sandboxes, snapshots, builds, the secret their tokens derive from
<pool>/spuntoZFS: images, disks, /workspace volumes, memory files, templates, builds

It also makes the group spunto-sandbox (adding the user who ran sudo), and turns nested virtualization off for the guests (/etc/modprobe.d/spunto-kvm-nested.conf, at the next reboot): a KVM surface no box needs.

Who may use it

The API listens on /run/spunto-sandbox.sock, which root and the spunto-sandbox group may use. Being in that group is being able to run anything in any sandbox, and to make sandboxes that take the machine's memory: give it as you would docker.

To reach the daemon from another machine, give it a TCP address and a token:

/etc/spunto-sandbox/sandboxd.env
SBX_LISTEN=0.0.0.0:7070
SBX_API_TOKEN=<a long random string>
sudo systemctl restart spunto-sandboxd
SBX_HOST=http://that-machine:7070 SBX_TOKEN=… sbx ls

Put TLS in front of it (a reverse proxy) unless the network between is yours.

Upgrade

Run the installer again. It replaces the binaries and restarts the daemon; sandboxes keep running (each VMM is a systemd unit of its own). A box gets the new guest agent at its next cold boot; a resumed one keeps the agent it had.

Remove

for b in $(sbx ls --json | jq -r '.[].id'); do sbx rm "$b"; done
sudo systemctl disable --now spunto-sandboxd
sudo zfs destroy -r <pool>/spunto            # every image, disk and memory file
# a pool made by --create-pool, instead: sudo zpool destroy sandbox
sudo rm -rf /opt/spunto-fc /opt/spunto-sandbox /var/lib/spunto-fc /var/lib/spunto-sandbox /etc/spunto-sandbox
sudo rm -f /usr/local/bin/sbx /etc/systemd/system/spunto-sandboxd.service /etc/systemd/system/vms.slice /etc/modprobe.d/spunto-kvm-nested.conf
sudo systemctl daemon-reload

On this page