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 mount flags use SOURCE:DEST[:OPTIONS]. The : before OPTIONS starts the option block, and commas separate options inside that block.
| Flag | Source | Options |
|---|---|---|
--mount-dir | Host directory | ro, rw, noexec, nosuid, nodev, stat-virt=strict|relaxed|off, host-perms=private|mirror |
--mount-file | Host file | ro, rw, noexec, nosuid, nodev, stat-virt=strict|relaxed|off, host-perms=private|mirror |
--mount-named | Named volume | ro, rw, noexec, nosuid, nodev, kind=dir|disk, size=<size> for kind=disk, quota=<size> for directory volumes; directory-backed named volumes also support stat-virt=strict|relaxed|off, host-perms=private|mirror |
--mount-disk | Host disk image | ro, rw, noexec, nosuid, nodev, format=raw|qcow2|vmdk, fstype=<type> |
--tmpfs | Guest path | ro, rw, noexec, nosuid, nodev; size may be passed as PATH:SIZE[:OPTIONS] |
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.