Skip to main content
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.

Backend Resolution

SmolVM automatically selects the appropriate backend based on your platform:

Resolution Order

Backends are resolved in this priority order:
  1. Explicit argument: SmolVM(backend="firecracker")
  2. Environment variable: SMOLVM_BACKEND=qemu
  3. Platform default:
    • macOS (Darwin) → qemu
    • Linux → firecracker

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 environments

Prerequisites

  • 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
Security
  • Purpose-built for isolation
  • Minimal attack surface
  • No legacy device emulation
  • Trusted by AWS Lambda
Resource Efficiency
  • 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 KVM

Prerequisites

  • 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
Compatibility
  • Emulates various architectures
  • Extensive device support
  • Mature, well-tested
Flexibility
  • Rich configuration options
  • Snapshot and migration support
  • Debugging tools

Limitations

Performance
  • Slower than Firecracker on Linux
  • Higher memory overhead
  • Longer boot times
Complexity
  • More moving parts
  • Larger binary size
  • More configuration options

Configuration

Environment Variable

Comparison Matrix

Backend Diagnostics

SmolVM provides a diagnostic tool to check backend availability:
Example output:

Switching Backends

Per-VM Basis

Environment-Wide

Application-Wide

Recommendations

For Production (Linux)

Use Firecracker for production Linux deployments.
Why?
  • Optimized performance
  • Minimal overhead
  • Security-focused design
  • Battle-tested in AWS Lambda

For Development (macOS)

Use QEMU for local macOS development.
Why?
  • Only option on macOS
  • Good enough for development
  • Cross-platform testing

For CI/CD

Linux Runners:
macOS Runners:

Troubleshooting

”Unsupported backend” Error

Solution: Check spelling and use one of: auto, firecracker, qemu

KVM Not Available (Linux)

Solution:
  1. Verify KVM modules: lsmod | grep kvm
  2. Check virtualization in BIOS
  3. Run system setup: sudo ./scripts/system-setup.sh --configure-runtime

QEMU Not Found (macOS)

Solution:

Wrong Backend Auto-Selected

Next Steps