Working in the MicroVM
Filesystem operations
Move files across the host and guest boundary safely.
Filesystem operations cross a trust boundary. Keep paths narrow, copy only the files required for the task, and avoid broad host mounts for generated or third-party code.
Copy files
Section titled “Copy files”mvmctl machine cp ./input.json agent-sandbox:/work/input.jsonmvmctl machine cp agent-sandbox:/work/output.json ./output.jsonUseful options:
mvmctl machine cp --create-parents ./input.json agent-sandbox:/work/in/input.jsonmvmctl machine cp --force agent-sandbox:/work/output.json ./output.jsonmvmctl machine cp --max-bytes 16777216 agent-sandbox:/work/output.json ./output.jsonExactly one endpoint uses VM:/absolute/path form. Guest paths are validated by the guest filesystem policy before read or write.
Use controlled mounts
Section titled “Use controlled mounts”For short-lived one-shot runs:
mvmctl run --mount ./fixtures:/work:ro -- python /work/test.pyTransient host-directory shares are read-only. Use mvmctl machine cp or a managed
volume when the guest must produce host-visible changes.
Volumes
Section titled “Volumes”Managed local volumes are encrypted at rest by mvm and must be unlocked before mounting:
mvmctl machine volume create agent-cachemvmctl machine volume unlock agent-cachemvmctl machine volume mount agent-sandbox --volume agent-cache --guest /cache --rwLock the volume again after use:
mvmctl machine volume lock agent-cacheSee Persistent workspaces for volume lifecycle, snapshots versus volumes, and cleanup policy.
Security notes
Section titled “Security notes”- Do not mount
$HOME, credential directories, SSH agents, cloud config, or browser profiles into untrusted guests. - Prefer copy-in/copy-out over writable mounts for agent tasks.
- Use byte caps for machine-driven downloads.
- Treat guest output files as untrusted input when reading them on the host.