Overview
smolvm is a command-line tool for running custom Linux virtual machines locally with sub-second cold start, elastic memory use and cross-platform support on macOS, Linux and Windows. Built in Rust on libkrun, it does two things: it manages microVMs on your machine, and it packs a stateful virtual machine into a single .smolmachine file that can be rehydrated on any supported platform or pushed to an OCI registry like any other artifact.
The isolation boundary is a hypervisor, not a namespace, which is why it shows up as a sandbox for agent-generated and untrusted code. Networking is off by default so a program cannot phone home, and when you do enable it you can restrict egress to an explicit allow-list of hosts. A machine is declared in a Smolfile — a TOML file that is to a whole VM what a Dockerfile is to a container image — covering image, CPU, memory, ports, volumes, mounts, network policy and setup commands. Unknown keys are rejected rather than ignored, so a typo fails at create time instead of silently doing nothing.
Beyond one-shot sandboxing, smolvm can branch a running machine: start it as branchable, then create independent copy-on-write children from its live RAM and disk state, including a whole batch in parallel — useful when many agent attempts should start from the same prepared environment. Machines can also be snapshotted into a reusable image without writing a Dockerfile, or packed into a self-contained executable that boots in under 200 ms with no install step. Local container images are supported directly: feed --image a docker save archive, a piped stream, or an unpacked rootfs directory.
What it does
- Sub-second cold start microVMs with elastic memory, on macOS, Linux and Windows (via the Windows Hypervisor Platform)
- Hardware isolation for untrusted code: network off by default, and per-host egress allow-lists when it is on
- Smolfile, a TOML declaration of a whole VM — image, cpus, memory, ports, volumes, env, init commands and network/auth/health tables — that rejects unknown keys
- Branch a running machine into copy-on-write children from its live RAM and disk state, sequentially or in parallel batches
- Pack a stopped machine into a portable .smolmachine artifact and push or pull it from any OCI registry
- Pack a workload into a self-contained executable with dependencies pre-baked and no runtime downloads
- Boot from local container images: a docker save / podman save archive, a piped stream, or an unpacked rootfs directory
Getting started
Install the CLI, then run a command in a throwaway VM to check the setup. On Windows, download the windows-x86_64 release and enable the Windows Hypervisor Platform feature first.
Install on macOS or Linux
A single install script; releases are also downloadable from GitHub.
curl -sSL https://smolmachines.com/install.sh | bashRun something in an ephemeral VM
The machine is cleaned up when the command exits. Drop --net to keep the VM off the network entirely.
smolvm machine run --net --image alpine -- sh -c "echo 'Hello world from a microVM' && uname -a"Lock down egress for untrusted code
With --net and one or more --allow-host flags, only the named hosts are reachable; everything else fails.
smolvm machine run --net --image alpine --allow-host registry.npmjs.org -- wget -q -O /dev/null https://registry.npmjs.orgDeclare a machine in a Smolfile
Check the TOML into your repository, then create and start the machine from it.
image = "python:3.12-alpine"
net = true
cpus = 4
memory = 4096
ports = ["8000:8000"]
volumes = ["./src:/app"]
init = ["pip install -r /app/requirements.txt"]
[network]
allow_hosts = ["api.stripe.com", "pypi.org"]Create, start and branch it
A branchable machine can be forked into independent copy-on-write children from its live state — for example eight parallel workers off one prepared environment.
smolvm machine create --name myvm -s Smolfile
smolvm machine start --name myvm --branchable
smolvm machine branch --from myvm --count 8 --name-prefix worker --parallel 8Pack it into a portable artifact
Stop the machine, pack it into a .smolmachine file, and push it to any OCI registry so others can pull and boot the identical machine.
smolvm machine stop --name myvm
smolvm pack create --from-vm myvm -o myvm
smolvm pack push --file myvm.smolmachine ghcr.io/you/myvm:v1Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Give a coding agent a hardware-isolated place to execute the code it just wrote, with the host filesystem, network and credentials behind a hypervisor boundary
- Fan out many attempts at a task from one prepared environment by branching a running machine instead of rebuilding it each time
- Ship a reproducible development or CI environment as a single file that boots the same way on macOS, Linux and Windows
- Run a workload air-gapped or on a locked-down host by booting from a local container archive with no registry access
How smolvm compares
smolvm alongside other open-source code sandboxes & isolation tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Daytona | ★ 71.7k | Daytona is an open-source runtime that spins up isolated sandboxes in under 90ms so agents can safely run and persist AI-generated code. |
| NVIDIA NemoClaw | ★ 22.5k | NVIDIA's reference stack for running OpenClaw, Hermes and LangChain Deep Agents Code inside OpenShell sandboxes, adding managed inference, network policy, snapshots and CLI lifecycle control. |
| OpenSandbox | ★ 15.4k | OpenSandbox gives AI agents a safe place to run code and commands, with one unified API across Docker and Kubernetes runtimes and SDKs in five languages. |
| E2B | ★ 13.8k | E2B is open-source infrastructure that runs AI-generated code inside secure, isolated cloud sandboxes, controlled from JavaScript or Python SDKs. |
| Astrid | ★ 10.3k | A portable Rust runtime that executes software as sandboxed WebAssembly capsules, where every file, network, process and tool call is gated by a signed, revocable, per-principal capability instead of ambient authority. |
| Cloudflare Computer | ★ 9.2k | A virtual filesystem inside a Durable Object that gives an agent one execution surface across Workers isolates and full Linux containers. |
| smolvm | ★ 6.1k | Ship and run software with isolation by default — sub-second Linux microVMs from one CLI |
| micropython-wasm | ★ 174 | Runs untrusted Python inside a WASI MicroPython module via Wasmtime, with memory caps, a CPU fuel budget, a wall-clock timeout and no network access. |