smolvm sandbox snapshot saves sandbox state so you can return to it later. Use snapshots before risky commands, before handing a sandbox to an agent, or after installing expensive dependencies.
Synopsis
Snapshots work on Firecracker and QEMU for Linux guests with isolated disks. Windows guests, workspace mounts, and extra drives are not supported yet.
create
Save a running or paused sandbox.Name or ID of the sandbox to snapshot.
Custom snapshot ID. If omitted, SmolVM creates one.
What to store. Use
full for a complete checkpoint, diff for a smaller disk artifact, or disk for QEMU disk-only state.Resume the source sandbox after the snapshot is created.
Keep a running QEMU sandbox available for the whole snapshot instead of briefly pausing it. Requires
--snapshot-type disk and --resume-source, and only works on QEMU. If the installed QEMU cannot do a live block backup, the command fails rather than falling back to a pause.How to handle the pre-snapshot guest filesystem flush for
--snapshot-type disk. required fails the snapshot if the flush fails, best-effort continues with a crash-consistent copy, and skip does not ask the guest to flush at all.--flush-policy to trade durability for speed. This example keeps a sandbox running through a live snapshot and doesn’t fail if the guest agent can’t flush:
restore
Restore a snapshot back into its sandbox identity.Snapshot ID to restore.
Resume the restored sandbox immediately.
Restore a snapshot even if SmolVM has already marked it restored.
list
List snapshots, optionally filtered by source sandbox.delete
Delete a snapshot and its files.Guest sync before disk snapshots
For disk snapshots, SmolVM asks the guest to flush filesystem state before it copies the disk. Recent images answer this through the SmolVM guest agent over the control channel, with SSH as a fallback where needed. Use--flush-policy to tune this step: required (default) fails the snapshot if the flush cannot succeed, best-effort continues with a crash-consistent copy, and skip bypasses the flush entirely.
If snapshot creation times out during guest sync, check Control channel and Troubleshooting before debugging storage or upload paths.
Related commands
smolvm sandbox list- Find sandbox namessmolvm sandbox shell- Inspect a restored sandbox- Snapshot and restore sandboxes - Learn when to use each snapshot type
