smolvm
AGENTS.md6.6k starsChanged 2 months agoApache-2.0View on GitHub
A tool to build and run portable, self-contained virtual machines locally. <200ms boot time. No daemon, no Docker. Windows caveats: branches require --freeze-source, checkpoint capture rejects active virtiofs DAX mappings, and GPU acceleration is unavailable. pack create needs storage-template.ext4 / overlay-template.ext4 beside smolvm.exe (Windows has no host mkfs.ext4). Set SMOLVM_LIB_DIR (folder holding krun.dll + libkrunfw.dll) and SMOLVM_AGENT_ROOTFS when running from a non-standard layout.
- Reads credentials
- Installs packages
Trending
More talk lately.about the whole repository
Who's talking about smol-machines/smolvm
- A Hacker News story“Show HN: Smol machines – subsecond coldstart, portable virtual machines”Hacker News · Apr 17, 2026 · 499 points
- CelestoAI/celesto“[Question]: SmolVM vs smolvm”GitHub · Apr 20, 2026 · 2 reactions
- @betterhn20.e-work.xyz“Show HN: Smol machines – subsecond coldstart, portable virtual machines …”Bluesky · Apr 17, 2026 · 2 likes
- @github-trending-rs.bsky.social“📦 smol-machines / smolvm ⭐ 6,156 (+40) 🗒 Rust Branchable computing by using a portable, lightweight, …”Bluesky · Sep 20, 2026 · 1 likes
- openclaw/crabbox“Add support smolvm”GitHub · Jun 6, 2026 · 1 reactions
The biggest 5 of 47 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 47
Talked about on GitHub, Bluesky and Hacker News (47 times).
On GitHub · 36
- Apr 20, 2026[Question]: SmolVM vs smolvm — CelestoAI/celesto2 reactions · 12 comments
- Jun 6, 2026Add support smolvm — openclaw/crabbox1 reaction · 2 comments
- Oct 4, 2026chore(deps): update dependency smol-machines/smolvm to v1.19.3 — preloopdev/preloop0 reactions · 2 comments
- Oct 3, 2026chore(deps): update dependency smol-machines/smolvm to v1.19.2 — preloopdev/preloop0 reactions · 2 comments
- Oct 3, 2026chore(deps): update dependency smol-machines/smolvm to v1.19.1 — preloopdev/preloop0 reactions · 2 comments
31 more on GitHub
- Oct 2, 2026chore(deps): update dependency smol-machines/smolvm to v1.19.0 — preloopdev/preloop0 reactions · 2 comments
- Oct 1, 2026chore(deps): update dependency smol-machines/smolvm to v1.18.2 — preloopdev/preloop0 reactions · 3 comments
- Sep 23, 2026package smolvm through the signed store (machine-level supply chain) — rbelem/nau0 reactions · 1 comment
- Sep 17, 2026chore(deps): update dependency smol-machines/smolvm to v1.14.6 - autoclosed — preloopdev/preloop0 reactions · 2 comments
- Sep 16, 2026chore(deps): update dependency smol-machines/smolvm to v1.14.5 — preloopdev/preloop0 reactions · 2 comments
- Sep 16, 2026chore(deps): update dependency smol-machines/smolvm to v1.14.4 — preloopdev/preloop0 reactions · 2 comments
- Sep 15, 2026chore(deps): update dependency smol-machines/smolvm to v1.14.3 — preloopdev/preloop0 reactions · 2 comments
- Sep 11, 2026[Request]: smolvm — ScoopInstaller/Main0 reactions
- Sep 8, 2026chore(deps): update dependency smol-machines/smolvm to v1.14.2 — preloopdev/preloop0 reactions · 1 comment
- Sep 5, 2026Support of smolvm backend — microsoft/mxc0 reactions
- Sep 4, 2026fix(windows): boot WHP guests on AMD CPUs — Flux159/nebula0 reactions
- Aug 29, 2026docs: expand Smolfile reference — smol-machines/docs0 reactions · 3 comments
- Aug 29, 2026chore(deps): update dependency smol-machines/smolvm to v1.13.1 — preloopdev/preloop0 reactions · 4 comments
- Aug 26, 2026Suggest binaries: smolvm — prefix-dev/octoconda0 reactions
- Aug 22, 2026add smolvm under virtualization — x-cmd/install0 reactions
- Jul 11, 2026Support extracting GNU sparse (PAX GNU.sparse.*) tarballs (e.g. smol-machines/smolvm) — aquaproj/aqua0 reactions
- Jun 18, 2026Feat: Add support to Google Cloud Storage for workspace + GKE FUSE for agent sandbox K3s and Daytona, also add Google Cloud Function as an alternative for AWS Lambda server-less stateless sandbox — beeblastco/broods0 reactions · 3 comments
- Jun 15, 2026chore: update smol-machines/smolvm v1.0.3 to v1.0.4 — aquaproj/aqua-registry0 reactions · 1 comment
- Jun 1, 2026fix: persist .smolmachine layers per VM — LoganGrasby/smolvm0 reactions
- May 28, 2026Add smolvm as a microVM-based sandbox backend — stippi/code-assistant0 reactions
- May 20, 2026evaluate smolvm as a standard for local dev-env verification and reproducibility — psmfd/FingerTrap0 reactions · 1 comment
- May 5, 2026fix: move TSI egress policy to libkrun — smol-machines/libkrun0 reactions · 1 comment
- Apr 27, 2026smolvm doesn't work — aquaproj/aqua-registry0 reactions · 6 comments
- Apr 26, 2026fix: reject TSI_LISTEN with -EPERM ifthere is no port mapping — smol-machines/libkrun0 reactions
- Apr 19, 2026feat(runner): smolvm backend for stronger per-job isolation (opt-in) — redwoodjs/local-ci0 reactions · 5 comments
- Apr 18, 2026📱 SNS 콘텐츠 - 2026-04-18 23:40 KST — leaf468/autothreads0 reactions
- Apr 18, 2026🤖 AI 트렌드 리포트 - 2026-04-18 23:40 KST — leaf468/autothreads0 reactions
- Apr 18, 2026📅 AI Agent & Skills 每日情报简报 - 2026-04-18 — Arronzh/ai-agent-daily-summary0 reactions
- Apr 18, 2026📱 SNS 콘텐츠 - 2026-04-18 11:31 KST — leaf468/autothreads0 reactions
- Apr 18, 2026🤖 AI 트렌드 리포트 - 2026-04-18 11:31 KST — leaf468/autothreads0 reactions
- Apr 10, 2026Add a smolvm-backed assistant option — vellum-ai/vellum-assistant0 reactions · 3 comments
On Bluesky · 10
- Apr 17, 2026Show HN: Smol machines – subsecond coldstart, portable virtual machines https://github.com/smol-machines/smolvm… — @betterhn20.e-work.xyz2 likes and reposts
- Sep 20, 2026📦 smol-machines / smolvm ⭐ 6,156 (+40) 🗒 Rust Branchable computing by using a portable, lightweight, self-contained virtual machine — @github-trending-rs.bsky.social1 likes and repost
- Apr 25, 2026GitHub - smol-machines/smolvm: Tool to build & run portable, lightweight, self-contained virtual machines.… — @tech-trending.bsky.social1 likes and repost
- Apr 18, 2026Show HN: Smol machines – 1秒未満のコールドスタート、携帯可能な仮想マシン Show HN: Smol machines – subsecond coldstart, portable virtual machines 🔺 333 💬 35 🔗… — @hacker-news-jp.bsky.social1 likes and repost · 1 reply
- Apr 18, 2026Show HN: Smol machines - subsecond coldstart, portable virtual machines [Discussion] — @hacker-news.bsky.social1 likes and repost
5 more on Bluesky
- Apr 18, 2026Show HN: Smol machines – subsecond coldstart, portable virtual machines https://github.com/smol-machines/smolvm… — @newsyc200.bsky.social1 likes and repost
- Apr 17, 2026Smol Machines: VMs mit Subsekunden-Coldstart. Fuer alle, die Docker schon zu bloated fanden. — @kompetenztraining.bsky.social1 likes and repost · 1 reply
- Apr 17, 2026github.com/smol-machine... SmolBS.. ah non .. — @lea-linux.org1 likes and repost
- Apr 18, 2026Show HN: Smol machines – subsecond coldstart, portable virtual machines View Article | Join the HN Conversation Summary of HN discussion… — @hncompanion.com0 likes and reposts · 1 reply
- Apr 18, 20261/2 Smol machines: VMs ligeras con arranque en milisegundos Proyecto open source que lanza máquinas virtuales en menos de un segundo y se… — @eltableroglobal.bsky.social0 likes and reposts · 1 reply
On Hacker News · 1
- Apr 17, 2026Show HN: Smol machines – subsecond coldstart, portable virtual machines499 points · 152 comments
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 0 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 95
All commands use named flags (no positional args except machine create --name NAME and machine delete --name NAME).
- Very specific: line 141
Default registry: registry.smolmachines.com.
- Very specific: line 346
Not available on Windows (WHP) — --gpu has no effect there.
- Very specific: line 494
/workspaceshared directory: Every machine has a /workspace directory — bare VMs, image-based VMs, and machines created from .smolmachine … - Very specific: line 603
Start with smolvm serve start --listen 127.0.0.1:8080 or smolvm serve start --listen $XDG_RUNTIME_DIR/smolvm.sock.
- Very specific: line 635
machine updatemodifies a stopped machine: Add/remove mounts, ports, env vars, or change CPU/memory without recreating the VM.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
smolvm — Agent Reference
A tool to build and run portable, self-contained virtual machines locally. <200ms boot time. No daemon, no Docker.
Platform Support
| Host | Guest | Hypervisor | Requirements |
| macOS Apple Silicon | arm64 Linux | Hypervisor.framework | macOS 11+ |
| Linux x86_64 / aarch64 | matching Linux | KVM | /dev/kvm |
| Windows x86_64 | x86_64 Linux | Windows Hypervisor Platform (WHP) | WHP feature enabled |
Windows caveats: branches require --freeze-source, checkpoint capture rejects active virtiofs DAX mappings, and GPU acceleration is unavailable. pack create needs storage-template.ext4 / overlay-template.ext4 beside smolvm.exe (Windows has no host mkfs.ext4). Set SMOLVM_LIB_DIR (folder holding krun.dll + libkrunfw.dll) and SMOLVM_AGENT_ROOTFS when running from a non-standard layout.
Quick Reference
# Ephemeral (cleaned up after exit)
smolvm machine run --net --image alpine -- echo hello
smolvm machine run --net -it --image alpine -- /bin/sh # interactive shell
smolvm machine run --net --image python:3.12-alpine -- python3 script.py
# Persistent (survives across exec sessions and stop/start)
smolvm machine create --net --name myvm
smolvm machine start --name myvm
smolvm machine exec --name myvm -- apk add python3 # installs persist
smolvm machine exec --name myvm -- which python3 # still there
smolvm machine shell --name myvm # interactive shell (auto-starts if stopped)
smolvm machine stop --name myvm
smolvm machine delete --name myvm
# Image-based persistent (filesystem changes persist across exec sessions)
smolvm machine create --net --image ubuntu --name myvm
smolvm machine start --name myvm
smolvm machine exec --name myvm -- apt-get update
smolvm machine exec --name myvm -- apt-get install -y python3
smolvm machine exec --name myvm -- which python3 # still there after exit+re-exec
# SSH agent forwarding (git/ssh without exposing keys) — see "SSH Agent Forwarding" below
smolvm machine run --ssh-agent --net --image alpine -- sh -c "apk add -q openssh-client && ssh-add -l"
smolvm machine create --name myvm --image alpine --ssh-agent --net # persistent: then start + exec git/ssh
# Inject secrets into workload env (referenced from host env var / file)
smolvm machine run --secret-env OPENAI_API_KEY=OPENAI_API_KEY -- ./app
smolvm machine run -s Smolfile -- ./app # Smolfile [secrets] resolves at launch
# Pack into portable executable
smolvm pack create --image python:3.12-alpine -o ./my-python
./my-python run -- python3 -c "print('hello')"
# Create machine from packed artifact (fast start, no pull)
smolvm machine create --name my-vm --from ./my-python.smolmachine
smolvm machine start --name my-vm
smolvm machine exec --name my-vm -- pip install requests
# Use local container images (CI, air-gapped, fast iteration)
docker save myapp:latest -o myapp.tar
smolvm machine run --image ./myapp.tar -- ./app # from a docker/podman save archive
docker save myapp:latest | smolvm machine run --image - -- ./app # from stdin
smolvm machine run --image ./rootfs/ -- ./app # from an unpacked rootfs dir
smolvm machine create --name myvm --image ./myapp.tar # persistent, from a local archiveWhen to Use What
| Goal | Command |
| Run a one-off command in isolation | smolvm machine run --net --image IMAGE -- CMD |
| Interactive shell (ephemeral) | smolvm machine run --net -it --image IMAGE -- /bin/sh |
| Interactive shell (persistent) | smolvm machine shell --name NAME |
| Persistent dev environment | machine create → machine start → machine exec |
| Ship software as a binary | smolvm pack create --image IMAGE -o OUTPUT |
| Fast persistent machine from packed artifact | machine create --name NAME --from FILE.smolmachine |
| Use local container images (CI / air-gapped / fast iteration) | --image ./archive.tar, --image - (stdin), or --image ./rootfs/ |
| Use git/ssh with private keys safely | Add --ssh-agent to run or create |
| Inject API keys / tokens without putting them on the command line | --secret-env/--secret-file flags or Smolfile [secrets] |
| Minimal VM without image | smolvm machine run -s Smolfile (bare VM) |
| Change mounts/ports/resources on existing VM | machine update --name NAME -v ./src:/app -p 8080:8080 |
| Declarative VM config | Create a Smolfile, use --smolfile/-s flag |
| Move a running machine from an arm64 Mac to arm64 Linux | machine checkpoint --name NAME -o FILE.checkpoint on the Mac, then machine create --name NAME --from FILE.checkpoint + machine start on Linux (details) |
Persistence Model
machine run— ephemeral. All changes are discarded when the command exits.machine exec— persistent. Filesystem changes (package installs, config edits) persist across exec sessions for the same machine, whether bare or image-based. Changes are stored in an overlay on the machine's storage disk.machine stop+start— changes persist across restarts. The persistent overlay is remounted preserving previous changes.machine create --stop-on-exit(or Smolfilestop_on_exit = true) — the machine stops by itself when its workload (image entrypoint/cmd, or the command after--) exits, whatever the exit status. Storage is flushed exactly as formachine stop, so nothing the workload wrote is lost.machine execsessions never trigger it. The machine's restart policy then applies as for any stop (the default,never, leaves it stopped); the workload's own exit status is not passed on.pack run— ephemeral. Each run starts fresh from the packed image.pack start+exec— daemon mode./workspacepersists across exec sessions and stop/start. Container overlay resets per exec (package installs don't persist — use/workspacefor durable data).machine create --from .smolmachine— creates a persistent named machine from a packed artifact. Boots from pre-extracted layers (~250ms, no image pull). Fullmachine execpersistence — package installs, file writes all survive across exec and stop/start.- Memory-backed paths —
/tmp,/run, and/dev/shmare tmpfs regardless of the mode above. They keep their contents while the machine runs, including acrossexecsessions, but are empty again after a stop and start./workspaceand the rest of the machine filesystem are on the storage disk, so write anything that must outlive a restart there — including credentials and configuration, which should not sit in/tmpor behind a symlink into it.
CLI Structure
All commands use named flags (no positional args except machine create --name NAME and machine delete --name NAME).
smolvm machine run --image IMAGE [-- COMMAND] # ephemeral
smolvm machine exec --name NAME [-- COMMAND] # run in existing VM
smolvm machine shell [--name NAME] # interactive shell (auto-starts)
smolvm machine create --name NAME [OPTIONS] # create persistent
smolvm machine create --name NAME --from FILE.smolmachine # from packed artifact
smolvm machine start [--name NAME] # start (default: "default")
smolvm machine stop [--name NAME] # stop
smolvm machine delete --name NAME [-f] # delete
smolvm machine status [--name NAME] # check state
smolvm machine ls [--json] # list all
smolvm machine update --name NAME [OPTIONS] # modify stopped machine settings
smolvm machine cp SRC DST # copy files (host↔VM)
smolvm machine exec --stream --name NAME -- CMD # streaming output
smolvm machine monitor [--name NAME] # foreground health + restart
smolvm pack create --image IMAGE -o PATH # package
smolvm pack create --from-vm NAME -o PATH # pack from VM snapshot
smolvm pack run [--sidecar PATH] [-- CMD] # run .smolmachine
smolvm serve start [--listen ADDR:PORT|PATH] # HTTP API
smolvm config registries edit # registry auth
# Secrets are references to host env vars / files, resolved at launch — no
# built-in store. Attach them on the command line or in a Smolfile [secrets].
smolvm machine run --secret-env GUEST_VAR=HOST_VAR # from host env var
smolvm machine run --secret-file GUEST_VAR=/abs/path # from host file
smolvm machine create --name NAME --secret-env GUEST_VAR=HOST_VAR # persists the ref
smolvm machine exec --name NAME --secret-env GUEST_VAR=HOST_VAR -- cmdArtifact References
Artifact references follow OCI conventions and support both tags and digests:
python-dev # bare name (default registry + latest)
python-dev:v1.0 # name + tag
binsquare/custom:v1 # namespace + name + tag
smolmachines.com/python-dev:latest # registry + name + tag
smolmachines.com/binsquare/custom:v1 # registry + namespace + name + tag
python-dev@sha256:abcdef0123... # digest reference (immutable)Default registry: registry.smolmachines.com. Digest references require sha256: followed by exactly 64 hex characters.
Local container images
--image also accepts a local source — useful for CI, air-gapped hosts, and fast
local iteration. smolvm stays a microVM runtime and delegates all image work
(flatten, whiteouts, config) to container tooling (crane/docker/podman); the
archive is flattened with crane export.
./image.tar ./image.tar.gz ./image.tgz # a `docker save` / `podman save` archive (gzip ok)
- # the same archive streamed on stdin
./rootfs/ # an already-unpacked root filesystem directoryA source is treated as local when it starts with /, ./, ../, is -, or ends in
.tar/.tar.gz/.tgz; everything else is a registry reference (so bare alpine
still pulls). Archives are cached content-addressed by hash and re-resolved on
machine start. --image - cannot be combined with -i/-t (both read stdin).
smolvm boots images, it does not build them: a Dockerfile passed to --image is
rejected with a hint to build first (docker build … && docker save … | … --image -).
Key Flags
| Flag | Short | Used on | Description |
--image | -I | run, create, pack create | OCI image, or a local source: a docker save archive (./img.tar, or - for stdin) or unpacked rootfs dir (./rootfs/) |
--name | -n | run, start, stop, status, exec, update | Machine name (default: "default") |
--net | run, create | Enable outbound networking (off by default) | |
--gpu | run, create | Enable GPU acceleration (Vulkan via virtio-gpu) | |
--gpu-vram | run, create | GPU shared-memory region size in MiB (default: 4096). Ignored without --gpu. | |
--volume | -v | run, create, update | Mount host dir: HOST:GUEST[:ro] |
--allow-system-mounts | run, create, update, pack run | Permit trusted read-only /etc and /var/log mounts below /host | |
--port | -p | run, create, update | Port mapping: HOST:GUEST |
--smolfile | -s | run, create, pack create | Load config from Smolfile |
--interactive | -i | run, exec | Keep stdin open |
--tty | -t | run, exec | Allocate pseudo-TTY |
--allow-cidr | run, create | CIDR egress filter (implies --net) | |
--allow-host | run, create | Hostname egress filter, resolved at VM start (implies --net) | |
--allow-host-pattern | run, create | Opt-in exact hostname or *.domain subdomains (implies --net) | |
--ssh-agent | run, create | Forward host SSH agent (git/ssh without exposing keys) | |
--nested-virt | run, create | Let the guest run its own VMs (nested KVM). Off by default; it exposes the host kernel's nested-KVM code to the guest, so enable it only for trusted workloads. Over the HTTP API it is nestedVirt, refused with 403 unless the server runs smolvm serve --allow-nested-virt. | |
--stop-on-exit | create | Stop the machine when its workload exits, whatever the exit status |
Smolfile Reference
A Smolfile is a TOML file declaring a VM workload. Use with --smolfile/-s.
# Top-level: workload definition
image = "python:3.12-alpine" # OCI image (omit for bare Alpine)
entrypoint = ["/app/run"] # overrides image ENTRYPOINT
cmd = ["serve"] # overrides image CMD
env = ["PORT=8080", "DEBUG=1"] # environment variables
workdir = "/app" # working directory
stop_on_exit = true # stop the machine when the workload exits (default: false)
# Resources
cpus = 2 # vCPUs (default: 4)
memory = 1024 # MiB (default: 8192, elastic via balloon)
net = true # outbound networking (default: false)
gpu = true # GPU acceleration (default: false)
gpu_vram = 4096 # GPU VRAM MiB (default: 4096, ignored unless gpu=true)
storage = 40 # storage disk GiB (default: 20)
overlay = 4 # overlay disk GiB (default: 2)
# Network policy — egress filtering by hostname and/or CIDR
[network]
allow_hosts = ["api.stripe.com"] # resolved at VM start (implies net)
allow_host_patterns = ["api.example.com", "*.files.example.com"] # exact / subdomains
allow_cidrs = ["10.0.0.0/8"] # IP/CIDR ranges (implies net)
# Dev profile (used by `machine run` and `machine create`)
[dev]
volumes = ["./src:/app"] # host bind mounts
ports = ["8080:8080"] # port forwarding
init = ["pip install -r requirements.txt"] # run on every VM start
env = ["APP_MODE=dev"] # dev-only env (extends top-level)
workdir = "/app" # dev-only workdir
# Artifact profile (used by `pack create`)
[artifact]
cpus = 4 # override resources for distribution
memory = 2048
entrypoint = ["/app/run"] # override entrypoint for packed binary
oci_platform = "linux/amd64" # target OCI platform
# Health check (used by `machine monitor`)
[health]
exec = ["curl", "-f", "http://127.0.0.1:8080/health"]
interval = "10s"
timeout = "2s"
retries = 3
startup_grace = "20s"
# Credential forwarding
[auth]
ssh_agent = true # forward host SSH agent into the VM
# Secrets — references to host sources, resolved at workload launch
[secrets]
DATABASE_URL = { from_env = "PROD_DB_URL" } # host env var (at launch)
GCP_CREDS = { from_file = "/abs/creds.json" } # host file (at launch)Merge Precedence
CLI flags override Smolfile values:
image: --image flag > Smolfile image > None (bare Alpine)
entrypoint: Smolfile entrypoint > image metadata
cmd: trailing args (after --) > Smolfile cmd > image metadata
env: top-level env + [dev].env + CLI -e (all merged)
volumes: [dev].volumes + CLI -v (all merged)
ports: [dev].ports + CLI -p (all merged)
init: [dev].init + CLI --init (all merged)
cpus/mem: CLI flag > Smolfile > defaults (4 CPU, 8192 MiB)Networking
- Off by default — VMs have no outbound access unless
--netis specified --netenables full outbound (TCP/UDP, DNS)--allow-host api.stripe.comretains its legacy DNS behavior: the hostname and its subdomains are allowed (implies--net).--allow-host-pattern api.stripe.compermits the exact hostname.--allow-host-pattern '*.stripe.com'permits subdomains but not the apex. Both enable DNS filtering and imply--net.--allow-cidr 10.0.0.0/8enables egress only to specified IP ranges (implies--net)--allow-hostand--allow-cidrcan be combined and used multiple times--outbound-localhost-onlyrestricts to 127.0.0.0/8 and ::1 (implies--net)-p HOST:GUESTforwards a host port to the VM (TCP). The server inside the machine must listen on0.0.0.0(not127.0.0.1): a server bound only to the guest's loopback is unreachable from the host, and connections are reset.machine statusshows each published port's listening state.--guest-subnet 10.200.0.0/30moves the guest link off the default100.96.0.0/30(gateway and resolver.1, guest.2; implies--net, virtio-net). Use it when the guest runs Tailscale, another VPN or carrier NAT that claims100.64.0.0/10, which otherwise routes the gateway away and breaks DNS. API:guestSubneton create. Not combinable with--network- Smolfile: use
[network] allow_host_patternsfor exact/wildcard matching;allow_hostsretains legacy matching.
Proxy Support
Pass proxy settings into VMs with -e when behind a corporate proxy or VPN:
smolvm machine run --net \
-e https_proxy=http://proxy.corp:3128 \
-e http_proxy=http://proxy.corp:3128 \
-e no_proxy=localhost,127.0.0.1 \
--image alpine -- wget -q -O /dev/null https://example.comOr declare them in a Smolfile:
net = true
env = [
"https_proxy=http://proxy.corp:3128",
"http_proxy=http://proxy.corp:3128",
"no_proxy=localhost,127.0.0.1"
]Proxy vars are NOT forwarded automatically — each VM gets exactly the env you specify, unless you ask for the host's (below). The VM uses the host's DNS server (from /etc/resolv.conf) for name resolution.
Behind a corporate firewall
Two opt-in flags on machine run / machine create carry the host's network setup into the machine:
smolvm machine run --use-host-proxy --trust-host-certs --image python:3.12 -- pip install requests--use-host-proxy— the host'sHTTPS_PROXY/HTTP_PROXY/ALL_PROXY/NO_PROXY(or, on macOS, the system proxy when none is set) become the workload's proxy env, in both cases. A proxy on the host'slocalhostis rewritten to an address the machine can reach; the machine's own loopback is always inNO_PROXY. Implies--net. A PAC-file-only Mac gets an error asking forHTTPS_PROXY.--trust-host-certs— the certificates the host trusts (macOS: system roots + System keychain, where a corporate TLS-inspection root is installed; Linux: the system bundle) are mounted read-only at/etc/smolvm-host-trust/ca-bundle.pem, andSSL_CERT_FILE,NODE_EXTRA_CA_CERTS,REQUESTS_CA_BUNDLE,CURL_CA_BUNDLE,GIT_SSL_CAINFO,PIP_CERT,AWS_CA_BUNDLE,CARGO_HTTP_CAINFO,DENO_CERTpoint at it.SMOLVM_HOST_CA_BUNDLE=/pathreads a different bundle (Nix, custom stores). Not combinable with--credentialyet. Tools with their own trust store (Java keystores,aptover HTTPS) still need it configured in the image.
Values passed with -e win over both flags, and machine create persists them.
SSH Agent Forwarding
Forward the host's SSH agent into the VM so git, ssh, and scp work with your keys — without the private keys ever entering the VM.
# Quick check the agent is forwarded (alpine needs openssh-client for ssh-add):
smolvm machine run --ssh-agent --net --image alpine -- sh -c "apk add -q openssh-client && ssh-add -l"
# Persistent VM — create, start, install tooling, then use the agent:
smolvm machine create --name myvm --image alpine --ssh-agent --net
smolvm machine start --name myvm
smolvm machine exec --name myvm -- apk add -q git openssh-client
# Smolfile
# [auth]
# ssh_agent = trueInside the VM, SSH_AUTH_SOCK is set automatically. Any tool that uses the SSH agent protocol (git, ssh, scp) works transparently:
smolvm machine exec --name myvm -- git clone git@github.com:org/private-repo.git
smolvm machine exec --name myvm -- ssh deploy@server "systemctl restart app"The host SSH agent signs challenges but never sends private keys across the boundary. Even with root inside the VM, keys cannot be extracted — this is enforced by the SSH agent protocol and the hypervisor isolation.
Requires SSH_AUTH_SOCK to be set on the host. If missing, smolvm exits with an error and remediation instructions.
GPU Acceleration
Enable the host GPU inside a VM with --gpu. Guest Vulkan talks to the host GPU via virtio-gpu/Venus; ANGLE uses it as the WebGL/OpenGL ES backend.
Not available on Windows (WHP) — --gpu has no effect there.
Host setup:
- macOS — bundled, no extra installs needed.
- Linux — install virglrenderer from the system package manager before use:
- Alpine:
apk add virglrenderer mesa-vulkan-intel(ormesa-vulkan-atifor AMD) - Debian/Ubuntu:
apt install virglrenderer0 mesa-vulkan-drivers
- Alpine:
# One-shot GPU workload
smolvm machine run --net --gpu --image alpine -- sh -c '
apk add --no-cache mesa-vulkan-virtio vulkan-loader vulkan-tools
vulkaninfo --summary 2>/dev/null | grep deviceName
'
# → deviceName = Virtio-GPU Venus (Intel(R) UHD Graphics ...)
# Persistent GPU machine
smolvm machine create --name browser --gpu --gpu-vram 2048
smolvm machine start --name browser
smolvm machine exec --name browser -- \
chromium --headless=new --no-sandbox --use-gl=angle --use-angle=vulkan \
--screenshot=/tmp/out.png --window-size=1280,800 https://example.comThe guest does not need VK_ICD_FILENAMES: Mesa's ICD manifest is where the
Vulkan loader already looks, and on a glibc image smolvm bind-mounts its own
Venus driver and pins the loader to it. Setting the variable overrides that
pin, and the manifest name is architecture-specific
(virtio_icd.x86_64.json / virtio_icd.aarch64.json), so a hardcoded path
breaks on the other arch:
gpu = true
gpu_vram = 2048For a complete working example see examples/headless-browser/browser.smolfile.
CUDA (experimental)
--cuda remotes guest CUDA Driver-API calls to the host NVIDIA GPU over
vsock — separate from --gpu (Vulkan graphics). The host needs a working
NVIDIA driver (libcuda.so.1 + loaded kernel module); no CUDA toolkit is
required on host or guest. Enable with --cuda on machine run/create, or
cuda = true in a Smolfile.
Guest programs reach the GPU through the drop-in driver library built from
crates/smolvm-cuda-shim (a cdylib with soname
libcuda.so.1). Mount or install it in the guest and unmodified Driver-API
programs work with no code changes:
cargo build --release -p smolvm-cuda-shim # → target/release/libcuda.so
mkdir -p /tmp/shim && cp target/release/libcuda.so /tmp/shim/libcuda.so.1
smolvm machine run --net --cuda -v /tmp/shim:/opt/shim:ro --image debian:bookworm-slim -- \
sh -c 'gcc myapp.c -o myapp -L/opt/shim -l:libcuda.so.1 && LD_LIBRARY_PATH=/opt/shim ./myapp'Covered surface: init/device queries (name, attributes, uuid, total/free mem),
contexts (incl. the primary-context flow the CUDA runtime uses), module
load/unload (PTX, cubin, fatbin), mem alloc/free/HtoD/DtoH/DtoD/memset,
kernel launch (param sizes come from the host via cuFuncGetParamInfo,
CUDA 12.4+ drivers), streams, events, cuGetProcAddress. All work executes
synchronously host-side; *Async calls complete before returning (permitted
by the CUDA contract).
This covers programs written against the Driver API (the cu* C API), not
the Runtime API. A program built with nvcc (or PyTorch, RAPIDS, etc.) links
NVIDIA's libcudart, which bootstraps by requesting a private internal
driver interface via cuGetExportTable (a versioned UUID whose function ABIs
are undocumented). A pure libcuda shim cannot provide it, so libcudart
aborts during context init. Hosting Runtime-API workloads therefore requires
remoting at the libcudart level instead — a separate, larger effort (see
docs/cuda-support-plan.md, Phase 4). Set SMOLVM_CUDA_SHIM_TRACE=1 to log
which driver entry points a program resolves through the shim.
Without an NVIDIA driver the host serves a CPU-emulation backend (test-only:
it knows the vecadd test kernel), so the transport stays testable anywhere.
Secrets
smolvm stores no secret material. A secret is a reference to a value that
already lives on the host — a host environment variable or a host file — and is
resolved into the workload's process environment at launch time. Bring your own
secrets manager (Vault, 1Password, AWS, sops, your shell): render the value into
an env var or file, then point a ref at it. Only the reference is ever
persisted; the resolved value never lands in the VM record, the database, or a
.smolmachine pack.
Attach refs on the command line:
# From a host environment variable (GUEST_VAR=HOST_VAR)
smolvm machine run --secret-env OPENAI_API_KEY=OPENAI_API_KEY -- ./app
smolvm machine create --name web --secret-env DATABASE_URL=PROD_DB_URL # persists the ref
smolvm machine exec --name web --secret-env TOKEN=CI_TOKEN -- ./deploy
# From a host file (GUEST_VAR=/absolute/path)
smolvm machine run --secret-file GCP_CREDS=/abs/creds.json -- ./app
# Bridge any external manager through the env/file seam, e.g. 1Password:
op run --env-file=secrets.env -- smolvm machine run -- ./appOr reference them from a Smolfile. The left-hand key becomes the env var name in the guest workload:
[secrets]
DATABASE_URL = { from_env = "PROD_DB_URL" } # host env var (at launch)
GCP_CREDS = { from_file = "/abs/creds.json" } # absolute host file (at launch)Exactly one of from_env, from_file must be set per entry; from_file paths
must be absolute. Resolved values are appended after top-level env and CLI
-e flags. Resolution is late-bound, so rotating the underlying env var or file
takes effect at the next launch with nothing to re-sync.
Threat model: this is defense-in-depth, not zero-knowledge. The target
process sees plaintext in its own environment, and root inside the guest can
read any /proc/*/environ. Use SSH agent forwarding instead when a secret must
never leave the host.
Where they're resolved: machine run, machine create + machine start,
and machine exec resolve refs against this host under a trusted-local scope.
Untrusted surfaces — HTTP API request bodies and portable .smolmachine packs —
are treated as untrusted callers and may carry no resolvable secret ref:
from_env would expose the server's env and from_file would be an arbitrary
host-file read, so both are rejected. Configure secrets locally instead.
File Copy
Copy files between the host and a running machine using machine:path syntax:
# Upload a file to the VM
smolvm machine cp ./script.py myvm:/workspace/script.py
# Download a file from the VM
smolvm machine cp myvm:/workspace/output.json ./output.jsonImage-based VMs (--image): Files copied with cp are visible to
exec at the same path, and vice versa. This works for any path —
/tmp, /home, /workspace, etc. Under the hood, cp routes
through the container's overlay filesystem so both commands see the
same files.
/workspace shared directory: Every machine has a /workspace
directory — bare VMs, image-based VMs, and machines created from
.smolmachine artifacts. It persists across exec sessions and
across stop/start cycles. It's a good default location for
scripts, data, and results. Passing -v /host/dir:/workspace replaces
the default storage-disk workspace with your host directory for that
run — the host mount takes priority and the storage workspace is skipped:
# Typical agent workflow: copy code in, execute, extract results
smolvm machine create --name r-sandbox --image r-base:latest --net
smolvm machine start --name r-sandbox
smolvm machine cp analysis.R r-sandbox:/workspace/analysis.R
smolvm machine exec --name r-sandbox -- Rscript /workspace/analysis.R
smolvm machine cp r-sandbox:/workspace/results.csv ./results.csv
smolvm machine stop --name r-sandboxBehavior and limits:
- Files up to 1 MiB transfer as a single message — no perceptible overhead beyond the agent round-trip.
- Larger files stream automatically: 1 MiB chunks for upload, 16 MiB chunks for download. The split is asymmetric because the host→guest direction has tighter socket-buffer headroom.
- Per-transfer cap is 4 GiB in either direction. Files at or
above this size are rejected up front (
total_size exceeds maximumon upload;exceeding the byte capon download). For larger blobs, mount a host directory with--volumeinstead of copying. - A throttled progress line prints to stderr while large transfers
run, including bytes-so-far, percentage (uploads), and rate.
Pipe captures (
> file) only see the upload/download summary, not the progress noise. - Atomic on the guest side: a partially-written file never appears at the target path. If the transfer fails or the connection drops mid-stream, the staging file is cleaned up and the original destination (if any) is unaffected.
Typical throughput on macOS (Apple Silicon): ~35-42 MB/s upload, ~170 MB/s download.
Streaming Exec
Stream command output in real-time instead of buffering:
# CLI — prints output as it arrives
smolvm machine exec --stream --name myvm -- python3 train.py
# API — Server-Sent Events
POST /api/v1/machines/:name/exec/stream
Content-Type: application/json
{"command": ["python3", "train.py"]}
# Response: text/event-stream
# event: stdout
# data: Epoch 1/10...
# event: exit
# data: {"exitCode":0}Bare VM Mode
machine run works without --image when a Smolfile provides the workload config, or for direct Alpine shell access:
# Bare Alpine shell
smolvm machine run -it
# Smolfile with entrypoint/cmd (no container overhead)
smolvm machine run -s Smolfile
# Bare VM with init setup, detached
smolvm machine run -d -s SmolfileBare VMs run commands directly in the Alpine rootfs — no OCI image pull needed. Use this when you need a minimal Linux environment.
Packed Binaries (.smolmachine)
smolvm pack create produces two files:
my-app— stub binary with embedded VM runtime (platform-specific)my-app.smolmachine— VM payload: rootfs, OCI layers, storage (cross-platform)
The packed binary runs as a normal executable:
./my-app run -- python3 -c "print('hello')" # ephemeral, cleaned up after exit
./my-app start # persistent daemon mode
./my-app exec -- pip install x # exec into daemon
./my-app stop # stop daemonAlternatively, create a named machine from the .smolmachine for full lifecycle management:
smolvm machine create --name my-vm --from my-app.smolmachine
smolvm machine start --name my-vm # ~250ms boot, no image pull
smolvm machine exec --name my-vm -- pip install x # fully persistent
smolvm machine stop --name my-vm
smolvm machine ls # shows my-vmThe .smolmachine manifest includes registry-oriented metadata:
host_platform— host OS+arch this machine runs on (e.g.,darwin/arm64), distinct fromplatformwhich is the guestcreated— RFC 3339 timestamp of when the machine was packedsmolvm_version— version of smolvm that built it
HTTP API
Start with smolvm serve start --listen 127.0.0.1:8080 or smolvm serve start --listen $XDG_RUNTIME_DIR/smolvm.sock. Machines that ask for nested virtualization (nestedVirt) are refused unless the server is started with --allow-nested-virt; turning it off again also keeps existing nested machines from starting. Key endpoints:
POST /api/v1/machines Create machine
GET /api/v1/machines List machines
GET /api/v1/machines/:name Get machine
POST /api/v1/machines/:name/start Start machine
POST /api/v1/machines/:name/stop Stop machine
DELETE /api/v1/machines/:name Delete machine
POST /api/v1/machines/:name/exec Execute command
POST /api/v1/machines/:name/exec/stream Streaming exec (SSE)
PUT /api/v1/machines/:name/files/*path Upload file
GET /api/v1/machines/:name/files/*path Download file
GET /api/v1/machines/:name/logs Stream logs (SSE)
POST /api/v1/machines/:name/images/pull Pull OCI imageOpenAPI spec: smolvm serve openapi
Important Defaults
- Machine name defaults to
$SMOLVM_MACHINE_NAMEwhen set, else"default", when--nameis omitted. An explicit--namealways wins. Meant for per-workspace tooling (direnv);machine run,machine checkpoint, andmachine branchdeliberately ignore the variable - Network is off by default (security-first)
- CPUs: 4, Memory: 8192 MiB, Storage: 20 GiB, Overlay: 2 GiB
- Packed binaries use the same defaults (CPUs: 4, Memory: 8192 MiB)
- Memory and CPU are elastic via virtio balloon — the host only commits what the guest actually uses and reclaims the rest
Important Behaviors
- Observational commands don't stop running VMs.
machine images,machine status,machine lsand similar read-only commands leave a running VM in its current state. If the VM was already running before the command, it stays running after. machine pruneworks on a running VM. Regular prune only removes unreferenced layers and is safe while containers are active.prune --allrequires the VM to be stopped first since it deletes manifests for layers that may be in use.machine execpersists filesystem changes. Package installs, config edits, and file writes insideexecsurvive across sessions. This works for both bare VMs and image-based VMs (created with--image).machine updatemodifies a stopped machine. Add/remove mounts, ports, env vars, or change CPU/memory without recreating the VM. Changes take effect on nextmachine start. Requires the machine to be stopped.machine runis always ephemeral. The VM is created, the command runs, and everything is cleaned up. No state carries over.-v host:/workspacereplaces the default workspace. Every image-based VM exposes/workspacebacked by the VM's storage disk. Mounting a host directory at/workspacetakes priority — the host share is used instead and the storage-disk workspace is not mounted. Any other target path (e.g./data,/app) does not affect/workspace.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

