auto; SmolVM picks the right one for the host, guest, and image you are using.
How SmolVM picks a backend
SmolVM resolves the backend in this order:- Explicit argument -
SmolVM(backend="qemu") - Environment variable -
SMOLVM_BACKEND=firecracker - Automatic default - macOS uses QEMU, Linux uses Firecracker
auto, firecracker, qemu, and libkrun.
libkrun is available as an experimental backend. Use it when you are testing libkrun specifically. Firecracker and QEMU are the stable choices for everyday sandbox work.Choose a backend
Use this table when you know what kind of host or workload you have.Comparison matrix
Firecracker
Firecracker is a small virtual machine monitor built for serverless workloads. It is the default on Linux because it starts quickly, keeps virtual hardware narrow, and works well for many short-lived sandboxes.Requirements
- Linux host
- KVM enabled
- Firecracker binary available to SmolVM
- Network setup for TAP devices and nftables rules
Strengths
- Small attack surface - Firecracker exposes a narrow set of virtual devices.
- Linux production default - SmolVM uses Firecracker automatically on Linux when
backend="auto". - Snapshots - Firecracker supports snapshot and restore for checkpointing and resume flows.
- vsock control - Recent SmolVM images can use the Rust guest agent over vsock for low-latency commands.
Limits
- Firecracker runs on Linux hosts with KVM.
- It does not run on macOS.
- It supports fewer device types than QEMU by design.
- Windows guests require QEMU instead.
Use Firecracker from Python
Use Firecracker from the CLI
Force Firecracker for a process
QEMU
QEMU is a mature, full-featured virtualizer that works across platforms. On macOS it uses Apple’s Hypervisor Framework (HVF) for near-native performance. It is also available on Linux for environments without KVM, and is the only backend for Windows guests. On Linux x86_64 direct-kernel guests, QEMU now uses its fastermicrovm machine model by default. You can still force the older q35 model when you need broader device compatibility.
Requirements
- macOS or Linux host
- QEMU binaries available to SmolVM
- KVM on Linux for hardware acceleration, or Hypervisor.framework on macOS
Strengths
- Cross-platform host support - QEMU works on macOS and Linux.
- Windows guests - SmolVM uses QEMU for Windows sandbox images.
- Broad compatibility - QEMU can expose more virtual hardware than Firecracker.
- Fast Linux microvm path - QEMU uses
microvmautomatically for supported direct-kernel Linux guests.
Limits
- QEMU has a larger device model than Firecracker.
- QEMU is the compatibility choice for production Linux only when you need its features.
q35is broader but slower than the QEMUmicrovmpath for supported Linux guests.
Use QEMU from Python
Use QEMU from the CLI
Choose a QEMU machine
Leaveqemu_machine as auto for normal use:
QEMU networking modes
QEMU supports two network modes through theqemu_network field on VMConfig:
Set
qemu_network="tap" when you are building a custom image configuration and want Linux QEMU guests to use the host TAP path.
libkrun
libkrun runs Linux guests through the libkrun stack. SmolVM exposes it as an experimental backend for testing the next runtime path.
Switching backends
Per sandbox
Use this when one test or workload needs a specific runtime.Per shell session
Use this when every sandbox launched by a script should use the same backend.Per application
Set the environment variable before importing SmolVM.Native helper path
Recent SmolVM releases move several hot host-side operations into the Rustsmolvm-core helper package. Most users do not need to call it directly; the main smolvm package uses it automatically when the matching wheel is installed.
The native helpers cover:
- Linux networking setup for TAP devices, routes, and sysctls
- Sparse disk copy and zstd decompression for image startup
- QEMU monitor control for pause, resume, and snapshots
- Firecracker API socket control
smolvm-core.
Recommendations
For Linux production
Useauto or firecracker.
For macOS development
Useauto or qemu.
For Linux CI
Use the backend you deploy with. For production parity on Linux, that usually means Firecracker.For macOS CI
Use QEMU because Firecracker is Linux-only.Diagnostics
Usesmolvm doctor to check backend availability before you launch sandboxes:
Troubleshooting
KVM is not available on Linux
- Verify KVM modules:
lsmod | grep kvm - Check virtualization support in your BIOS or cloud instance type.
- Run host setup again:
smolvm setup - Run diagnostics:
smolvm doctor --backend firecracker --strict
QEMU is not found on macOS
The wrong backend was selected
Force a backend for one command:Next steps
Control channel
See how SmolVM runs commands inside a sandbox
Networking
Configure host networking and isolation
Performance
Compare boot and command latency
Troubleshooting
Fix backend and startup issues
