Skip to main content
SmolVM can run your sandbox with different local engines. Most users can leave the backend on 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:
  1. Explicit argument - SmolVM(backend="qemu")
  2. Environment variable - SMOLVM_BACKEND=firecracker
  3. Automatic default - macOS uses QEMU, Linux uses Firecracker
The supported values are 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
Run setup before your first Firecracker sandbox:

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 faster microvm 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
Run setup before your first QEMU sandbox:

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 microvm automatically 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.
  • q35 is broader but slower than the QEMU microvm path for supported Linux guests.

Use QEMU from Python

Use QEMU from the CLI

Choose a QEMU machine

Leave qemu_machine as auto for normal use:
Force the compatibility path when you are debugging old QEMU behavior or need a broader virtual hardware model:
Supported values are:

QEMU networking modes

QEMU supports two network modes through the qemu_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.
See network configuration for the host setup TAP mode reuses.

libkrun

libkrun runs Linux guests through the libkrun stack. SmolVM exposes it as an experimental backend for testing the next runtime path.
libkrun does not support pause, resume, snapshots, or snapshot restore yet. Use Firecracker or QEMU when those lifecycle operations matter.

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 Rust smolvm-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
Check what your install can use:
If a native helper is unavailable, SmolVM either falls back to the slower Python or subprocess path, or reports the missing helper with a fix such as reinstalling smolvm-core.

Recommendations

For Linux production

Use auto or firecracker.
Firecracker keeps the production device model small and uses SmolVM’s Linux networking path.

For macOS development

Use auto or qemu.
QEMU is the stable local backend on macOS.

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

Use smolvm doctor to check backend availability before you launch sandboxes:

Troubleshooting

KVM is not available on Linux

Try these checks:
  1. Verify KVM modules: lsmod | grep kvm
  2. Check virtualization support in your BIOS or cloud instance type.
  3. Run host setup again: smolvm setup
  4. Run diagnostics: smolvm doctor --backend firecracker --strict

QEMU is not found on macOS

Install QEMU through setup:

The wrong backend was selected

Force a backend for one command:
Or pass the backend in code:

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
Last modified on June 24, 2026