SmolVM supports two microVM backends: Firecracker (Linux) and QEMU (macOS/cross-platform). This page explains how backend selection works and the trade-offs between them.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CelestoAI/SmolVM/llms.txt
Use this file to discover all available pages before exploring further.
Backend Resolution
SmolVM automatically selects the appropriate backend based on your platform:Resolution Order
Backends are resolved in this priority order:- Explicit argument:
SmolVM(backend="firecracker") - Environment variable:
SMOLVM_BACKEND=qemu - Platform default:
- macOS (Darwin) →
qemu - Linux →
firecracker
- macOS (Darwin) →
Supported Backends
Firecracker Backend (Linux)
Overview
Firecracker is AWS’s purpose-built VMM (Virtual Machine Monitor) designed for serverless and container workloads. Best for: Production Linux deployments, CI/CD, high-density environmentsPrerequisites
- OS: Linux (Ubuntu, Debian, Fedora, etc.)
- CPU: KVM support (Intel VT-x or AMD-V)
- Kernel: Modern Linux kernel with KVM modules
Installation
Advantages
Performance- Sub-second boot times (~572ms create + start)
- Minimal memory overhead
- Optimized for high-density workloads
- Command execution: ~43ms
- Purpose-built for isolation
- Minimal attack surface
- No legacy device emulation
- Trusted by AWS Lambda
- Lightweight process model
- Efficient memory management
- Fast snapshot/restore (future feature)
Limitations
- Linux-only: Requires KVM support
- Architecture: x86_64 or aarch64 only
- Device support: Minimal (by design)
Configuration
Environment Variable
QEMU Backend (macOS)
Overview
QEMU is a mature, full-featured emulator and virtualizer that works across platforms. Best for: macOS development, cross-platform testing, environments without KVMPrerequisites
- OS: macOS (or Linux without KVM)
- Homebrew: For package management
- QEMU:
qemu-system-*binaries
Installation
Advantages
Cross-Platform- Works on macOS, Linux, Windows
- Doesn’t require KVM
- Broad hardware support
- Emulates various architectures
- Extensive device support
- Mature, well-tested
- Rich configuration options
- Snapshot and migration support
- Debugging tools
Limitations
Performance- Slower than Firecracker on Linux
- Higher memory overhead
- Longer boot times
- More moving parts
- Larger binary size
- More configuration options
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 | Planned | ✅ 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.
- Optimized performance
- Minimal overhead
- Security-focused design
- Battle-tested in AWS Lambda
For Development (macOS)
Use QEMU for local macOS development.
- Only option on macOS
- Good enough for development
- Cross-platform testing
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