Skip to main content
A snapshot is a portable, on-disk capture of a sandbox’s writable filesystem. Move it with scp, archive it as .tar.zst, or boot fresh sandboxes from it.
Snapshots are disk-only and require a sandbox that is not running. You can snapshot stopped and crashed sandboxes; microsandbox rejects running, draining, and paused sandboxes.

What gets captured

Booting from a snapshot is a cold boot of a fresh VM that starts from the captured filesystem changes.

Quick start

You’ll usually reach for the CLI first:
By default, the snapshot lives at ~/.microsandbox/snapshots/after-pip-install/. That whole directory is the snapshot.

Snapshot a sandbox

Snapshot under a bare name, resolved to ~/.microsandbox/snapshots/<name>/ by default. The name is the snapshot’s identity; pass a destination directory to create the artifact on a different volume (DIR/<name>). Either way the directory is the whole artifact; move it with save/load (or plain mv):
The sandbox must be stopped or crashed; microsandbox rejects running sandboxes.

Boot from a snapshot

A snapshot already pins its image, so booting from one is mutually exclusive with the image source:
Booting validates the snapshot, resolves the pinned image, and gives the new sandbox its own writable copy.

List, inspect, and remove

list and get use a local index for fast lookup. If the index gets out of sync, reindex rebuilds it from the snapshot artifacts on disk.

Move snapshots between machines

The snapshot directory is the whole artifact; there is no hidden daemon state. Copy the directory directly, or save it as an archive:
Archives default to .tar.zst. Pass --plain-tar for a plain .tar. SDKs expose the same save and load operations as the CLI.

Integrity verification

By default, snapshot creation records structural metadata without hashing the writable layer. Opt in when you need a persistent content check. Current snapshots use a fixed 64 KiB-leaf BLAKE3 Merkle tree: known sparse holes collapse into precomputed zero subtrees, while allocated bytes are read and hashed.
msb snapshot save and msb snapshot load preserve recorded integrity but do not silently execute it. They still enforce the archive grammar, path confinement, entry sizes, descriptor identities, and ordinary archive-entry hashes. Run msb snapshot verify explicitly after receiving a snapshot when your workflow requires an independent payload scan. Released msb-sparse-sha256-v1 descriptors remain readable and verifiable, but ordinary open, boot, save, load, and upgrade paths do not pay their full logical-size SHA cost.

Use cases

  • Reusable build state. Install dependencies once, snapshot, then msb run --from-snapshot ... repeatedly without paying the install cost. Common pattern for CI, agent workloads, and reproducible dev environments.
  • Portable scratch state. Capture a sandbox after a long setup, hand the artifact to a teammate or push it to shared storage, and let them boot from the same starting point.
  • Local fork-by-copy. Multiple sandboxes from one snapshot are independent; each copy of the upper layer diverges on its own.
  • Disaster recovery. Snapshot a sandbox before a risky migration; if it goes wrong, msb rm the broken one and msb run --from-snapshot from the pre-migration artifact.