SANDKILN_LISTEN_ADDR | 127.0.0.1:7777 | HTTP listen address. |
SANDKILN_EXEC_TIMEOUT_SECS | 600 | Longest a single exec, file or filesystem request may wait for the guest’s reply. Also the default and the ceiling for an exec’s own timeout_secs: at that limit the guest kills the command and the caller gets a 504 with timed_out: true and the partial output. A reply that never comes at all is a plain 504 and the command may still be running. Raise it for longer commands, or use streamed exec. Must be at least 1. |
SANDKILN_DEFAULT_WARM_COUNT | 2 | Warm instances of the default shape kept ready in the background, so a plain POST /sandboxes resumes one (about 26ms to first command, paced) instead of cold booting (about 230ms). Each is a held full-RAM snapshot on disk (512 MiB by default) and holds one guest address; replenishment pauses when addresses or disk run low. 0 disables. Appears as the pool default in GET /pools. At most 32. |
SANDKILN_FIRECRACKER_BIN | ~/sandkiln-tools/bin/firecracker | Path to the Firecracker binary. |
SANDKILN_KERNEL_PATH | ~/sandkiln-tools/images/vmlinux-5.10.223 | Guest kernel image. Use a FUSE-enabled kernel for remote storage mounts. |
SANDKILN_KERNEL_ARGS | unset | Extra guest kernel arguments, for example quiet. |
SANDKILN_SNAPSHOT_DIRTY_TRACKING | true | Track the pages a sandbox dirties from boot, so snapshotting a cold-booted sandbox writes only those pages (a sparse memory file) instead of all of its RAM. false restores full writes. A resumed sandbox is always snapshotted in full. See Snapshot cost. |
SANDKILN_BASE_ROOTFS | ~/sandkiln-tools/images/ubuntu-22.04.ext4 | Base rootfs cloned per sandbox. The default is the small test image; override it for a production image. See Manual host setup. |
SANDKILN_VCPU_COUNT | 2 | vCPUs per sandbox, when a request does not override it. |
SANDKILN_MEM_SIZE_MIB | 512 | Memory per sandbox, when a request does not override it. |
SANDKILN_MAX_VCPU_COUNT | 16 | Ceiling on a per-request vcpu_count override (POST /sandboxes). A request above it, or 0, is rejected with 400. |
SANDKILN_MAX_MEM_SIZE_MIB | 16384 | Ceiling on a per-request mem_size_mib override, same semantics. |
SANDKILN_BRIDGE_NAME | sktapbr0 | Bridge the daemon creates and manages. |
SANDKILN_BRIDGE_GATEWAY | 172.16.0.1 | Bridge and gateway IP (a /24 subnet). Match it when starting the DNS forwarder. |
SANDKILN_UPLINK_IFACE | auto-detected from the default route | Host interface sandboxes NAT out through. |
SANDKILN_TAP_POOL_PREFIX | sktap | Must match what create-tap-pool.sh was run with. |
SANDKILN_TAP_POOL_SIZE | 32 | Must match what create-tap-pool.sh was run with; caps concurrent networked sandboxes. To raise it, re-run the script first (Upgrades). |
SANDKILN_AUTH_TOKEN | unset (auth disabled) | Bearer token required on /sandboxes*, /drives*, /images* and /snapshots*. Unset means the API is completely open. Keep the config file chmod 600. See Auth and Before exposing it beyond localhost. |
SANDKILN_DRIVES_DIR | ~/sandkiln-tools/drives | Where persistent drives are stored. |
SANDKILN_STATE_DIR | ~/sandkiln-tools/state | Durable daemon state: held snapshots (snapshots/) and retired checkpoints (snapshot-history/). These once lived under the OS temp dir, where a reboot or tmp cleaner could silently destroy them; snapshots an older version left there are not migrated. |
SANDKILN_RETAINED_CHECKPOINTS_MAX | 8 | Time-travel checkpoints kept; the oldest is evicted after each resume. 0 keeps all and can fill the disk. |
SANDKILN_ROOTFS_DIR | $SANDKILN_STATE_DIR/rootfs | Where each sandbox’s private writable rootfs copy lives. Put it on the same reflink-capable filesystem as SANDKILN_BASE_ROOTFS for near-instant copy-on-write clones; see Faster creates. |
SANDKILN_IMAGES_DIR | ~/sandkiln-tools/images-registered | Where registered images (POST /images, kiln image create) are stored. See Custom images. |
SANDKILN_HISTORY_DB_PATH | ~/sandkiln-tools/history.db | SQLite database of durable sandbox lifecycle history (GET /sandboxes/history). It survives a daemon restart, unlike GET /sandboxes. A still-live record found at startup is marked orphaned, because a restart orphans whatever Firecracker process it referred to: the database records that a sandbox existed and how it ended, it cannot bring one back. See SQLite history store. |
SANDKILN_IDLE_TIMEOUT_SECS | unset (disabled) | Auto-destroy a sandbox after this many idle seconds (no exec, read or write activity): VM killed, network released, rootfs deleted, state gone for good. 0 also disables it. |
SANDKILN_AUTO_SUSPEND_TIMEOUT_SECS | unset (disabled) | Auto-suspend an idle sandbox instead: pause and snapshot it (same as POST /sandboxes/:id/snapshot) and free its VM, vCPU and memory, keeping it resumable. 0 also disables it. If both this and SANDKILN_IDLE_TIMEOUT_SECS are set, this must be strictly smaller: auto-suspend always gets first attempt at an idle sandbox, and the destroy timeout is a backstop for one whose auto-suspend keeps failing. See Auto-suspend. |
SANDKILN_ARCHIVE_TIMEOUT_SECS | unset (disabled) | Auto-archive a held snapshot (any origin, auto-suspend or manual) after it has sat unresumed this many seconds: moves its state.snap and mem.bin to SANDKILN_ARCHIVE_DIR, off the hot snapshot directory. 0 also disables it. Independent of the two timeouts above, with no ordering requirement. The rootfs backing file never moves, because Firecracker bakes its absolute host path into state.snap with no override at resume time (confirmed by a real resume failure when an earlier version tried moving it too; see move_snapshot_files in core/crates/daemon/src/snapshot.rs). So the win is real but partial: mem.bin alone is exactly the guest’s configured RAM size, often comparable to or larger than the rootfs copy. |
SANDKILN_ARCHIVE_DIR | ~/sandkiln-tools/archive | Where the archive timeout moves a snapshot’s files. Point it at a real disk, not another tmpfs path, to get the durability and RAM-pressure benefit. Only matters if the timeout is set, but always has a default like SANDKILN_DRIVES_DIR and SANDKILN_IMAGES_DIR. |
SANDKILN_LOG_FORMAT | pretty | Set to json for one JSON object per log line, for log pipelines that parse fields. |
SANDKILN_PREVIEW_TIMEOUT_SECS | 30 | How long a dev-server preview proxy request waits for the guest before a 504. |
SANDKILN_JAILER_ENABLED | unset (disabled) | Boot sandboxes via Firecracker’s jailer instead of a direct spawn; accepts true or 1. See Jailer setup. |
SANDKILN_JAILER_BIN | ~/sandkiln-tools/bin/jailer | Path to the jailer binary (must be setuid-root). |
SANDKILN_JAILER_SUPERVISOR_BIN | ~/sandkiln-tools/bin/sandkiln-firecracker-supervisor | The static helper that runs in each jail in place of Firecracker. Its file name must contain firecracker. |
SANDKILN_JAILER_GID | 600000 | The one group shared by every jailed VM. The daemon’s user must be a member. |
SANDKILN_JAILER_CHROOT_BASE_DIR | ~/sandkiln-tools/jail | Where per-VM chroots are created. |
SANDKILN_JAILER_UID_GID_BASE | 600000 | First uid in the range dedicated to jailed VMs, one per concurrent VM. |
SANDKILN_JAILER_SELF_CHECK | true | At startup, run the real jailer once against a throwaway jail and refuse to start if the daemon cannot use the result. Turn off only to diagnose a jailer setup. |
SANDKILN_JAILER_POOL_SIZE | 32 | How many distinct uids, which is the maximum number of concurrent jailed sandboxes. |