How SmolVM picks a backend
SmolVM resolves the backend in this order:- Explicit argument —
SmolVM(backend="firecracker") - Environment variable —
SMOLVM_BACKEND=qemu - Platform default — macOS uses QEMU, Linux uses Firecracker
firecracker, qemu, and auto (the default).
Firecracker (Linux)
Firecracker is a lightweight virtual machine monitor built by AWS for serverless workloads. It starts sandboxes fast and uses very little memory, making it ideal for production and CI/CD.Prerequisites
- OS: Linux (Ubuntu, Debian, Fedora, etc.)
- CPU: KVM support (Intel VT-x or AMD-V)
- Kernel: Modern Linux kernel with KVM modules
Installation
Strengths
- Fast — sub-second boot (~572ms), ~43ms per command
- Lightweight — minimal memory overhead, optimized for running many sandboxes
- Secure — minimal attack surface, no legacy device emulation, trusted by AWS Lambda
- Snapshots — fast snapshot and restore for checkpointing
Limitations
- Linux only (requires KVM)
- x86_64 or aarch64 architectures only
- Minimal device emulation (by design)
Configuration
Environment variable
QEMU (macOS)
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.Prerequisites
- OS: macOS (or Linux without KVM)
- Homebrew: For package management
- QEMU:
qemu-system-*binaries
Installation
Strengths
- Cross-platform — works on macOS, Linux, and Windows without KVM
- Broad compatibility — emulates various architectures, extensive device support
- Mature — well-tested, rich configuration and debugging tools
Limitations
- Slower than Firecracker on Linux (~2-3s boot vs ~572ms)
- Higher memory overhead
- Larger binary and more moving parts
Configuration
Environment variable
Comparison matrix
| Feature | Firecracker | QEMU |
|---|---|---|
| Platform support | ||
| Linux | ✅ Native | ✅ Supported |
| macOS | ❌ Not supported | ✅ Native |
| Windows | ❌ Not supported | ✅ Supported |
| Performance | ||
| Boot time | ~572ms | Slower (~2-3s) |
| Command execution | ~43ms | Similar |
| Memory overhead | Minimal | Higher |
| Features | ||
| KVM acceleration | Required | Optional |
| Snapshot/restore | ✅ Available | ✅ Available |
| Device emulation | Minimal | Extensive |
| Architecture support | x86_64, aarch64 | Many |
| Use cases | ||
| Production Linux | ✅ Recommended | ⚠️ Fallback |
| macOS development | ❌ Not available | ✅ Recommended |
| CI/CD (Linux) | ✅ Recommended | ⚠️ Testing only |
| CI/CD (macOS) | ❌ Not available | ✅ Only option |
Backend diagnostics
SmolVM provides a diagnostic tool to check backend availability:Switching backends
Per-VM basis
Environment-wide
Application-wide
Recommendations
For production (Linux)
Use Firecracker for production Linux deployments.
For development (macOS)
Use QEMU for local macOS development.
For CI/CD
Linux runners:Troubleshooting
”Unsupported backend” error
auto, firecracker, qemu
KVM not available (Linux)
- Verify KVM modules:
lsmod | grep kvm - Check virtualization in BIOS
- Run system setup:
sudo ./scripts/system-setup.sh --configure-runtime
QEMU not found (macOS)
Wrong backend auto-selected
Next steps
- Configure networking
- Review security model
- Read architecture overview