diff --git a/README.md b/README.md index 97bfea1..ca0baae 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ box down devbox ```yaml base: docker.io/library/alpine:latest -backend: podman # podman, krun or firecracker +backend: auto # firecracker when it fits, else podman; or name one isolation: strict # the VMM runs as a UID that is not yours network: bridge # or none, for no network at all warm: 2 # keep VMs booted so runs start in ms diff --git a/docs/docs.html b/docs/docs.html index 71e4747..e896d5d 100644 --- a/docs/docs.html +++ b/docs/docs.html @@ -77,7 +77,7 @@
One YAML file per sandbox at ~/.box/sandboxes/<name>/Boxfile. Unknown keys are rejected, so a typo fails loudly.
| Field | Values | Default | Meaning |
|---|---|---|---|
| base | image reference | alpine:latest | The image every VM starts from. |
| backend | podman, krun, firecracker | podman | What boots the VM. See Architecture. |
| isolation | standard, strict | standard | strict runs the VMM as a subordinate UID of the sandbox's own. |
| cpus | 1 to 16 | 2 | vCPUs. |
| ram_mib | 128 and up | 2048 | Guest RAM in MiB. |
| network | bridge, none | bridge | Internet access, or none at all. |
| readonly | bool | false | Read-only root; /tmp and /data stay writable. |
| timeout_seconds | int | 0 | Per-command limit; exits 124. 0 is unlimited. |
| warm | 0 to 8 | 0 | VMs kept booted for run (podman, krun). |
| warmup | shell lines | Run once in each warm VM before it serves a run. | |
| packages | names | Installed with the image's package manager. | |
| run | shell lines | Extra build steps. | |
| env | map | Environment for every command. | |
| mounts | host, guest, mode | Host directories shared in (podman, krun); ro by default. | |
| blueprint | users, write_files, runcmd | Provisioning applied at build time. | |
| pkgmgr | apk, apt, dnf | inferred | Override the package manager. |
| passt | bool | false | A real NIC with a default route (podman, krun). |
| seccomp | path | A seccomp profile for the VMM. | |
| base | image reference | alpine:latest | The image every VM starts from. |
| backend | auto, podman, krun, firecracker | podman (new Boxfiles: auto) | What boots the VM. auto picks firecracker when the sandbox is offline, has no host mounts, no warm pool and no forks, and the host can run it; podman otherwise. The pick is made once and shown by box inspect. See Architecture. |
| isolation | standard, strict | standard | strict runs the VMM as a subordinate UID of the sandbox's own. |
| cpus | 1 to 16 | 2 | vCPUs. |
| ram_mib | 128 and up | 2048 | Guest RAM in MiB. |
| network | bridge, none | bridge | Internet access, or none at all. |
| readonly | bool | false | Read-only root; /tmp and /data stay writable. |
| timeout_seconds | int | 0 | Per-command limit; exits 124. 0 is unlimited. |
| warm | 0 to 8 | 0 | VMs kept booted for run (podman, krun). |
| warmup | shell lines | Run once in each warm VM before it serves a run. | |
| packages | names | Installed with the image's package manager. | |
| run | shell lines | Extra build steps. | |
| env | map | Environment for every command. | |
| mounts | host, guest, mode | Host directories shared in (podman, krun); ro by default. | |
| blueprint | users, write_files, runcmd | Provisioning applied at build time. | |
| pkgmgr | apk, apt, dnf | inferred | Override the package manager. |
| passt | bool | false | A real NIC with a default route (podman, krun). |
| seccomp | path | A seccomp profile for the VMM. |
box builds the image, checks that the sandbox really has its own kernel, and refuses to run it if not. Hover over a line to see what it does.
I'm evaluating box (https://github.com/chxperiments/box) for something I'm building. Help me decide whether it fits, and if it does, how to set it up correctly. Use only the facts below about box; if something isn't covered here, say so instead of guessing. ## What box is @@ -244,7 +244,8 @@Not sure it fits? Ask your AI.
- `box data import|export <name> <dir>` copies files into or out of `/data`. Exported files are treated as hostile (symlinks never followed, setuid dropped). ## Backends (`backend:` in the Boxfile) -- podman (default): podman with the krun runtime (libkrun). Supports everything. Cold run ~1.3–1.5 s. +- auto (what new Boxfiles say): box picks once per sandbox and records why: firecracker when the Boxfile is offline, has no host mounts, no warm pool and no forks, and the host can run it; podman otherwise. It never moves a sandbox whose /data is on the other engine; it stops and says how to move the data. `box inspect` shows the choice. +- podman (a Boxfile without the key): podman with the krun runtime (libkrun). Supports everything. Cold run ~1.3–1.5 s. - krun: drives crun's libkrun handler directly. Cold run ~0.75–1.1 s. `isolation: standard` only for now. - firecracker: restores a snapshot per run, ~0.3 s, no pool needed. x86_64 Linux only; no networking, no host mounts, no forks yet. Measured: a warm `run` is ~20–45 ms; `exec` in a running sandbox is ~15 ms for a no-op. @@ -273,8 +274,8 @@Not sure it fits? Ask your AI.