Use this file to discover all available pages before exploring further.
Volumes give a sandbox direct filesystem access to host-side directories. They’re useful for persisting data across restarts, sharing data between sandboxes, or mounting host directories into the guest. They’re also significantly faster than the filesystem API (which transfers files individually), so for anything beyond ad-hoc reads and writes, volumes are the way to go.microsandbox supports three types of mounts: bind mounts, named volumes, and tmpfs.
Named volumes are managed by microsandbox and stored at ~/.microsandbox/volumes/<name>/. They persist independently of any sandbox, so you can create a volume, populate it, and mount it into different sandboxes over time.
When sharing volumes between sandboxes, both sandboxes access the same underlying host directory. There’s no built-in locking, so if two sandboxes write to the same file concurrently, you’ll get the usual race conditions. Use the read-only flag on the reader side to make intent explicit.
An in-memory filesystem that disappears when the sandbox stops. Useful for scratch space, build artifacts, or anything that doesn’t need to outlive the sandbox.
let sb = Sandbox::builder("worker") .image("alpine") .volume("/tmp/scratch", |v| v.tmpfs().size(100)) .create() .await?;