Requirements
Use an x86-64 or ARM64 Linux host with Firecracker installed and read/write access to /dev/kvm. The runner also needs Python 3.9+ with os.pidfd_open and signal.pidfd_send_signal, and OpenSSH client tools.
firecracker --version
test -r /dev/kvm && test -w /dev/kvm
Prepare a Linux kernel, an ext4 root filesystem containing the selected MagicMtn Canonical image's software, SSH server, timeout, and /workspace. Configure SSH authentication and a pinned guest host key. Each concurrent sandbox needs a TAP interface and guest address, with routing, outbound NAT, and DNS prepared on the host.
This provider runs Firecracker as the runner user without a jailer. It is intended for personal local workloads on a trusted host. See Firecracker's production host guidance for host isolation requirements.
Installation
magic provider install firecracker
This installs the MagicMtn adapter. See Requirements for any runtime or other software to install separately. Registry installation does not require a MagicMtn login or AWS credentials.
To remove the installed adapter:
magic provider uninstall firecracker
Usage
Before creating a sandbox, set these variables in the runner's environment:
MAGICMTN_FIRECRACKER_CONFIG: absolute path to a private JSON file describing the Firecracker binary, state directory, prepared kernel and root filesystem images, and network slots.MAGICMTN_FIRECRACKER_IMAGES: JSON map from the exact repository and SHA-256 digest of your MagicMtn Canonical image to its prepared image label in that file. The prepared root filesystem must contain that image's software.
The local sandbox guide includes a complete configuration example.
Each sandbox receives two vCPUs, 2 GiB of memory, a separate writable disk copy, and one network slot. The provider supports sandbox creation, status, termination, and bounded command execution. Terminating a sandbox removes its disk copy and frees its slot; a stopped VM retains its slot until cleanup.
Local use currently requires an existing saved runner connection. Run magic-provider-runner with that connection's catalog and credentials, and keep it running while using or deleting local sandboxes. Installing the adapter alone does not set up a connection.
With that connection available, set local-sandbox = true in ~/.config/magicmtn/config. Then magic sandbox new and Pi's /magic new use local placement. If the runner is offline, local mode does not fall back to cloud compute.