SmolVM supports two backends for running sandboxes: Firecracker on Linux and QEMU on macOS. You usually don’t need to think about this — SmolVM picks the right one for your platform automatically.Documentation Index
Fetch the complete documentation index at: https://docs.celesto.ai/llms.txt
Use this file to discover all available pages before exploring further.
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, and is the only backend for Windows guests.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
Networking modes
The QEMU backend supports two networking modes, controlled by theqemu_network field on VMConfig:
"slirp"(default) — Userspace NAT with host port forwards. Works without root or extra host setup, which makes it the right choice for local macOS development."tap"— Linux-only. Attaches the guest to a host TAP device so it gets a real routable IP and falls under the same nftables NAT and isolation rules as Firecracker (egress masquerade, cross-sandbox drop, and IMDS block). Use this when you need Firecracker-level network isolation on a QEMU host — for example, running QEMU on a Linux production host for multi-tenant or untrusted workloads.
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
