Cloud: Volumes use fast block storage managed by the platform. Every organization automatically gets an undeletable host volume: think of it as the disk of the one computer all its sandboxes run on, and it is what bind and disk-image mounts resolve against.
Bind mounts
Mount a directory from the host directly into the sandbox. Changes inside the sandbox are reflected on the host, and vice versa.--mount-file when you want to bind one host file instead of an entire directory.
Named volumes
microsandbox manages named volumes and stores them by default under~/.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.
Named volumes can be directory-backed or disk-backed. Directory volumes mount through virtiofs. Disk volumes are raw ext4 disk images managed by microsandbox and mount through virtio-blk.
CLI named mounts are idempotent. -v name:/path and --mount-named name:/path create a directory-backed named volume if it does not already exist, then mount it. If the volume already exists, microsandbox reuses it when the requested storage settings are compatible and errors when they are not. Use --mount-named name:/path:kind=disk,size=20G to create or reuse a disk-backed named volume from the mount flag itself.
SDK named(...) mount helpers are existing-only. They fail if the named volume does not already exist. Use each SDK’s explicit named-volume mode API when you want sandbox creation to create or ensure the volume.
Create a volume
Mount in a sandbox
pip-cache as a directory-backed named volume if it is missing. To create or reuse a disk-backed named volume while mounting it:
Sharing and host-side access
Mount the same directory-backed named volume into multiple sandboxes when they need to share files. Usereadonly on consumers that should not write. Disk-backed named volumes are attached as block devices; use one writable sandbox at a time, or read-only mounts where sharing is intended.
Directory-backed named volumes are also accessible from the host without a running sandbox, so you can pre-populate a cache or inspect output after the sandbox stops. Disk-backed named volumes store guest data inside disk.raw; host filesystem helpers operate on the managed volume directory, not the filesystem inside the disk image.
Manage volumes
Disk-image volumes
Disk-image volumes attach a host disk image as a virtio-blk device and mount its inner filesystem at a guest path. Use them when you want persistent state isolated from ordinary host filesystem metadata, or when distributing a prebuilt filesystem image. The disk format defaults from the file extension (.qcow2, .raw, .vmdk; otherwise raw), and the inner filesystem type is auto-detected unless you set fstype.
Tmpfs
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.Mount options
Mounts use normal Linux behavior by default: writable, executable, suid-enabled, and device-enabled. Adjust with:readonly/rowhen the guest should not write to the mount.noexecwhen files on the mount should not be executed directly.nosuidwhen setuid/setgid bits should be ignored.nodevwhen device files should be ignored.
noexec does not stop interpreters from reading scripts from the mount, for example sh /app/src/script.sh.
For stronger in-guest hardening, create the sandbox with the restricted security profile. Restricted sandboxes set no_new_privs, drop mount-admin capability from user commands, and force nosuid,nodev on user mounts. This profile is incompatible with workloads such as sudo and Docker-in-Docker.
CLI syntax and flags
CLI mount flags useSOURCE:DEST[:OPTIONS]. The : before OPTIONS starts the option block, and commas separate options inside that block.