Reference
Filesystem & Drives
Drive model, mount points, and filesystem layout inside microVMs.
Drive Model
Section titled βDrive ModelβA microVM built with mkGuest gets these virtio-block drives at fixed slots.
/init mounts the config and secret drives itself, before any user volume is
attached:
| Drive | Mount Point | Permissions | Purpose |
|---|---|---|---|
/dev/vda | / | Read-write (ext4) or read-only (squashfs) | Root filesystem |
/dev/vdb | /mnt/config | Read-only (ro,noexec,nosuid,nodev) | mvm instance metadata |
/dev/vdc | /mnt/secrets | Read-only (ro,noexec,nosuid,nodev) | Runtime-delivered credentials |
There is no fixed /dev/vdd data drive and no /mnt/data mount. Later slots are
assigned dynamically β the runtime overlay and the SDK sidecar arrive as
mvm.runtime_data=/dev/vdN / mvm.sdk_dev=/dev/vdN on the kernel cmdline, and
your own --mount host:guest:SIZE disk images take the slots after those.
/mnt/config and /mnt/secrets are runtime-owned. The host mount policy refuses
any user share that sits inside or shadows them, and /mnt is not an allow-root
at all: a user mount path must be under /data or /work.
Root Filesystem
Section titled βRoot FilesystemβThe rootfs is built by mkGuest and contains:
- Busybox β init system, core utilities
- Overlay-aware boot logic β the
/initpath and/mvm/runtimemount point needed to bring the guest runtime online - Guest agent β present directly in dev/preferred-overlay images; provided by the sealed runtime overlay on overlay-required boots
- Your packages β specified in the flakeβs
packagesparameter - The entrypoint β rendered from the flakeβs required
entrypointparameter - Probe drop-ins β one
/etc/mvm/probes.d/<name>.jsonperhealthChecks.<name>entry
mkGuest generates no service scripts: the top-level services attribute and
the entrypoint.services form are recorded but not implemented β the
multi-service supervisor is unwired, so nothing in the image starts or supervises
them.
Runtime Overlay
Section titled βRuntime OverlayβSealed workload boots can attach a second read-only, verity-protected runtime
overlay that is mounted inside the guest at /mvm/runtime.
- The overlay carries the guest runtime binaries such as
mvm-guest-agent,mvm-guest-netinit, andmvm-egress-client. - Only guest-executed runtime binaries belong in this artifact. Host-side helpers and bootstrap tools stay outside the overlay.
- The rootfs keeps the mount point and boot logic, but sealed
RequiredOverlayimages intentionally omit the baked fallback binaries. - The overlay is version-matched to the running
mvmctlbuild; mvm does not attach an arbitrary βlatestβ overlay. - The overlay is mounted read-only in the guest. A backend that cannot provide
that read-only contract must stay on the fallback policy instead of using
RequiredOverlay. - Before attach, mvm re-verifies the cached
overlay.ext4,overlay.verity,overlay.roothash, andVERSIONfiles against the recordedchecksums-sha256.txtmanifest and refuses the boot on any mismatch. - The artifact is shared across microVMs from the local cache under
~/.mvm/cache/runtime-overlay/<version>/<arch>/.
Runtime updates
Section titled βRuntime updatesβRuntime overlay updates are a next-boot operation:
- A stopped VM can pick up a newer version-matched overlay the next time it starts.
- A running VM keeps the overlay version it booted with until restart.
- mvm does not support hot-swapping or live-remounting a different runtime overlay into an already-running guest.
ext4 vs squashfs
Section titled βext4 vs squashfsβ| ext4 | squashfs | |
|---|---|---|
| Read-write | Yes | No (tmpfs overlays on /etc, /var) |
| Size | Larger | ~76% smaller (LZ4 compression) |
| Agent injection | Supported | Not supported (read-only) |
| Boot time | Similar | Similar |
Config Drive
Section titled βConfig DriveβThe config drive (/dev/vdb, mounted at /mnt/config/) contains non-sensitive configuration:
config.jsonβ mvm instance metadata (name, role, resources)- Application config files from host directories you mounted yourself
Files are written with mode 0444 (world-readable, read-only mount).
Secrets Drive
Section titled βSecrets DriveβThe secrets drive (/dev/vdc, mounted at /mnt/secrets/) contains sensitive data:
secrets.jsonβ tenant-level secrets- Application secret files from host directories you mounted yourself
Security hardening:
/initmounts itro,noexec,nosuid,nodev- Recreated on every start (never reused)
The serviceGroup argument to mkGuest does not affect this drive. Like
services and volumeMounts, it is recorded in passthru.mvm and warned about
at eval time; nothing re-owns or re-modes the secret files at boot.
The stronger property is that raw secret values never reach the guest at all: mvm substitutes credentials host-side at the per-VM egress endpoint. See the secrets guide rather than shipping values in on this drive.
Persistent Disk Volumes
Section titled βPersistent Disk VolumesβThere is no built-in data drive. Persistent storage is a user disk volume: a
three-part --mount spec (--volume is an alias) whose third field is a size in
MB. The host path is an ext4 disk image file mvm creates and attaches as
virtio-blk β not a directory. A two-part spec is a live host-directory share over
virtio-fs instead.
Volumes are read-only unless you write :rw, and the guest mount path must
be under /data or /work:
# 1 GB writable ext4 disk image, mounted at /data/store in the guestmvmctl machine run --flake . --mount ./store.img:/data/store:1024:rw:rw requires --profile dev or --profile permissive. A transient runβs
share is read-only under every profile.
For managed encrypted local volumes and workspace cleanup policy, see Persistent workspaces.
Filesystem Layout
Section titled βFilesystem Layoutβ/ # rootfs (ext4 or squashfs)βββ bin/ # busybox symlinksβββ etc/β βββ mvm/β βββ integrations.d/ # integration definitions (JSON); not written by mkGuestβ βββ probes.d/ # probe drop-ins (JSON) β where healthChecks landβββ init # busybox init scriptβββ mvm/β βββ runtime/ # read-only runtime overlay mount point when attachedβββ nix/store/ # Nix packagesβββ mnt/ # runtime-owned; not a user mount allow-rootβ βββ config/ # /dev/vdb (ro) β config driveβ βββ secrets/ # /dev/vdc (ro) β secrets driveβββ data/ # user mount allow-rootβββ work/ # user mount allow-rootβββ var/ # runtime state (tmpfs on squashfs)Host-Side Layout
Section titled βHost-Side LayoutβOn the host (on Linux) or inside the builder VM (on macOS), mvm stores data at:
~/.mvm/ # MVM_HOMEβββ templates/β βββ <name>/β βββ revisions/β βββ <hash>/β βββ vmlinuxβ βββ rootfs.ext4 (or rootfs.squashfs)β βββ warm-meta.json (if warmed)βββ vms/ βββ <name>/ βββ fc.pid # Firecracker pid file (libkrun.pid / qemu.pid / hvf.pid for the others) βββ fc.socket # Firecracker API socket βββ firecracker.log βββ console.log βββ run-info.json βββ vmlinux βββ rootfs.ext4 βββ config.ext4 βββ secrets.ext4 βββ runtime/ βββ v.sock # per-VM Firecracker vsock UDSEvery backend shares this one per-VM directory with disjoint file names, so the
marker file (fc.pid, libkrun.pid, qemu.pid, hvf.pid) is what identifies
which VMM owns a running VM.
The shared guest-runtime overlay cache lives separately under
~/.mvm/cache/runtime-overlay/<version>/<arch>/ and contains the sealed
overlay.ext4, overlay.verity, overlay.roothash, VERSION, and
checksums-sha256.txt metadata reused by every VM that boots that runtime
version.