Creating a sandbox
At minimum, a sandbox needs a name and an image. Everything else has sensible defaults: 1 vCPU, 512 MiB memory, public-only networking,/bin/sh as the shell.
Configuration options
| Option | Default | Description |
|---|---|---|
image | — | OCI image, local path, or disk image |
cpus | 1 | Number of virtual CPUs |
memory | 512 | Guest memory in MiB |
workdir | — | Default working directory for commands |
shell | /bin/sh | Shell used by shell() calls |
env | {} | Environment variables |
volumes | [] | Volume mounts (bind, named, or tmpfs) |
network | public | Network policy and port mappings |
scripts | {} | Named scripts stored at /.msb/scripts/ |
Rootfs sources
microsandbox supports three ways to provide a root filesystem. The choice affects how the filesystem is assembled and what features are available.OCI images
The most common option. microsandbox pulls the image and stacks its layers as a copy-on-write filesystem. Changes inside the sandbox don’t modify the base image. If two sandboxes use the same image, they share the same cached layers on disk.Bind mounts
Use a local directory on the host as the root filesystem directly. The guest sees the directory contents as its/. This is useful for development when you have a pre-built rootfs, or for minimal environments where you’ve assembled the filesystem yourself.
The guest agent is automatically included in the rootfs during sandbox creation, regardless of rootfs source. You don’t need to add anything to your image or directory.