Run MagicMtn sandboxes in local Linux microVMs with Firecracker.
Use a Linux host with a user-installed Firecracker binary, read/write access to /dev/kvm, Python 3.9+ with os.pidfd_open and signal.pidfd_send_signal, and an OpenSSH client.
Prepare a compatible Linux kernel, an ext4 root filesystem with SSH and GNU Coreutils timeout, and one TAP network slot per concurrent VM. For MagicMtn Pi sessions, the guest also needs the MagicMtn sandbox agent and its dependencies. The provider does not install Firecracker, download or convert images, or configure host networking.
Install from the MagicMtn Registry.
magic provider install firecrackerSet these variables in the environment of the process running the provider:
MAGICMTN_FIRECRACKER_CONFIG: absolute path to a private JSON file describing Firecracker, prepared images, and network slots.MAGICMTN_FIRECRACKER_IMAGES: optional JSON map from exact OCI image references with digests to prepared image labels in that file. You can instead record the image reference in the configuration entry.
See the configuration example for the file format and guest requirements. Set up the host and images before creating a sandbox. Prepare Canonical for the configured host, then start a sandbox using the default image.
magic images prepare canonical --provider firecracker
magic computer new --provider firecracker
magic computer exec SANDBOX_ID -- /bin/echo hello
magic computer terminate SANDBOX_ID --yesSubstitute the returned sandbox ID.
The provider supports prepared-image validation, creation, status, termination, and bounded command execution. Each VM receives two vCPUs, 2 GiB of memory, and a private copy of its root disk. Interactive SSH and SCP operations are not advertised by the provider; command execution uses SSH internally.
Firecracker runs directly as the host user without a jailer. This configuration is intended for personal local workloads on a trusted host. Host routing, NAT, DNS, and isolation are operator responsibilities. Review Firecracker's production host guidance before choosing a deployment environment.
Execution time and output are bounded, and guest SSH host keys are verified. A timeout does not prove every remote descendant stopped; inspect the guest before retrying work. VM state survives provider restarts, and sandboxes require explicit termination to release their disk and network slot.
See CONTRIBUTING.md for development, testing, and packaging.