Skip to content

Run commands & processes

mvm has two command styles:

  • one-shot sandboxes that boot, run a command, and exit;
  • commands inside an already-running named microVM.

Use one-shot mode for isolated code execution. Use named-VM commands when you are working with persistent state, services, logs, or cold-mode recovery.

Terminal window
mvmctl run -- uname -a
mvmctl run --profile restrictive -- python -c 'print("hello")'
mvmctl run --timeout 30 --receipt /tmp/run-receipt.json -- python task.py

mvmctl run produces a transient sandbox. It can write a signed receipt with invocation hashes, output hashes, and exit status. Raw argv, env values, stdout, stderr, and host paths are not stored in the receipt.

Use dry-run mode to inspect policy effects without booting:

Terminal window
mvmctl run --dry-run --json -- python task.py
Terminal window
mvmctl up ./my-app --name agent-sandbox
mvmctl exec agent-sandbox -- python /work/task.py
mvmctl logs agent-sandbox -f

Use this path when the VM has state, files, services, or snapshots that should survive across commands.

ProfileUse it whenNotes
restrictiveRunning generated or untrusted code.No env injection and no host directory shares.
standardNormal local runs.Explicit env is allowed; host shares must be read-only.
devIterating on a local project.Writable host shares are allowed.
permissiveLast-resort debugging.Requires explicit acknowledgement.
  • Prefer argv arrays and explicit command arguments.
  • Avoid passing secrets through command-line args.
  • Use receipts for automation and audit correlation.
  • Keep writable host shares out of untrusted runs.
  • Treat stdout and stderr as sensitive because guest code controls them.