Skip to content
Blog

Firecracker, MicroVMs, and the Isolation Spectrum

How AWS built a KVM-based microVM for Lambda and Fargate, why it boots in ~125 ms, and where it sits between containers, gVisor, and full virtual machines on the isolation spectrum.

Published on • November 15, 2026

AI Assistant

Isolation is not a binary switch. Between a runc container that shares the host’s kernel and a full QEMU virtual machine that boots a BIOS, a PCI bus, and an init system, there is a wide band of options with very different security boundaries and very different overheads. Firecracker occupies the sweet spot AWS needed for Lambda and Fargate: hardware-backed VM isolation at roughly container speed. This post walks through what Firecracker actually is, why AWS built it, and how to place it — along with gVisor and conventional VMs — on the isolation spectrum.

What Firecracker Actually Is

Firecracker is an open-source virtual machine monitor (VMM) written in Rust that uses Linux KVM to run lightweight VMs called microVMs. It was developed at Amazon Web Services to power services like AWS Lambda and AWS Fargate, and it is released under the Apache 2.0 license.

Several design decisions explain its speed and small attack surface:

  • It is a single, minimal process. One Firecracker VMM process runs one microVM. When it starts, it exposes a REST API (specified in OpenAPI format) on a Unix socket, which you use to configure vCPUs (default 1), memory (default 128 MiB), network interfaces, block devices, vsock, and rate limiters.
  • It boots a Linux kernel directly. There is no BIOS, no UEFI firmware, no boot device enumeration. You hand Firecracker a kernel image, a root filesystem (or initrd), and boot arguments, and the guest starts. This alone removes hundreds of milliseconds of legacy boot machinery.
  • It has a deliberately tiny device model. Virtio devices only: network, block, vsock, entropy, pmem. No display, no USB, no sound, no PCI passthrough by default. The Firecracker specification exists precisely to document these performance and behavioral guarantees — and CI enforces them.
  • It hardens the host side too. The jailer binary wraps Firecracker in production: it applies a cgroup and namespace isolation barrier, chroots, then drops privileges before starting the VMM. Firecracker also installs thread-specific seccomp filters, and demand-fault paging with CPU oversubscription is on by default.

The result, per Firecracker’s own specification, is a microVM that starts in about 125 ms from process start to guest init — and restores from a snapshot in single-digit milliseconds. That is close enough to container startup that serverless platforms stopped having to choose between the two.

Firecracker is also not AWS-only: it has been integrated into container runtimes such as Kata Containers and Flintlock, and it is used in production by companies like Fly.io and CodeSandbox for per-tenant compute isolation.

The Isolation Spectrum

Every workload isolation technique trades a security boundary against cost. The four points on the spectrum that matter in practice:

LayerBoundaryStartupMemory overheadMain weakness
Containers (runc)Namespaces, cgroups, seccomp, AppArmor/SELinux — still one shared kernelMillisecondsNear zeroA single kernel bug can escape the sandbox
gVisor (runsc)User-space kernel intercepts all syscallsMillisecondsSmall, fixedCompatibility gaps; syscall-heavy workloads slow down
MicroVMs (Firecracker)Hardware virtualization (KVM), separate guest kernel~125 msGuest kernel + VMM footprintMore moving parts than a container
Full VMs (QEMU/KVM)Hardware virtualization with a full device modelSecondsHundreds of MBSlow, heavy, large attack surface

Containers are the cheapest and the weakest. Everything the workload does ultimately lands in the host kernel, so the sandbox is, in gVisor’s own documentation’s phrasing, “one system call away from host compromise.” Seccomp filters and hardening shrink the exposed surface, but they do not create a second kernel.

gVisor inserts a user-space kernel (the Sentry) between the workload and the host, servicing syscalls in memory-safe Go. It keeps container-like density and startup, but it re-implements Linux, so anything not re-implemented is unavailable, and syscall-dense workloads pay a tax.

MicroVMs give you a real second kernel — a full Linux guest — enforced by hardware. The guest can run an unmodified kernel and arbitrary drivers; the boundary is the VM exit, which is the strongest practical boundary short of a separate physical machine.

Full VMs add a complete device model, firmware, guest agents, and management tooling. That buys compatibility (virtiofs, VFIO passthrough, live migration, Windows guests) and pays for it in boot time, memory, and attack surface.

Where Firecracker Sits — and What You Give Up

Firecracker deliberately picks the microVM point and then shaves everything non-essential off it. The trade-offs are worth being explicit about:

  • You manage the VM from the host, not from inside it. There is no guest agent, no SSH, no cloud-init. Configuration happens over the Firecracker API socket. That is fewer components to attack, but it changes your operational model.
  • Your kernel and rootfs are your responsibility. Firecracker boots your kernel image, so patching means rebuilding and redeploying guest kernels — not apt upgrade on a long-lived VM.
  • Some conveniences are missing or new. Live migration is not part of the model. Memory hotplug exists; virtio PCI hotplug/hot-unplug is only in Developer Preview. Devices like the aarch64 pl031 RTC have known limitations (no interrupt support, so hwclock alarms fail).
  • Security depends on the host configuration. The maintainers are explicit: overall microVM security depends on a well-configured Linux host, and the repository ships a production host setup document covering kernel versions, cgroups, and hardening. Running Firecracker on a stock, unhardened host does not meet the multi-tenant bar.

Firecracker vs Cloud Hypervisor

The most common alternative you will evaluate is Cloud Hypervisor — also a Rust VMM, also KVM-based, but with a different philosophy:

FirecrackerCloud Hypervisor
Design goalMinimal VMM for serverless sandboxesGeneral-purpose modern VMM
BootDirect kernel bootUEFI/OVMF firmware boot
Device modelVirtio only, no PCI by default (hotplug is preview)PCI, ACPI, VFIO passthrough, virtiofs
Guest agents / vTPMNoSupported
Typical usePer-tenant function/container isolationKata Containers’ default VMM, VM-like workloads

Cloud Hypervisor is the default VMM for Kata Containers 3.x and is the better fit when your microVM needs to look like a real machine: GPU passthrough, virtiofs shared directories, firmware-based boots, or guest-side management. Firecracker is the better fit when you want the smallest possible trusted computing base for thousands of short-lived, single-tenant sandboxes — which is exactly Lambda’s shape.

Neither is universally “more secure.” Firecracker’s smaller device model means less code in the VMM; Cloud Hypervisor’s richer feature set means better workload compatibility. Pick the boundary your threat model needs, then pay only the overhead that boundary costs.

Choosing Your Point on the Spectrum

A practical decision rule:

  1. Trusted code, single tenant, your own cluster — plain containers with a hardened runtime (gVisor if you want defense in depth) are usually enough.
  2. Untrusted code, but you need density and fast cold starts — gVisor, if the workload passes compatibility testing; its user-space kernel avoids guest boot entirely.
  3. Untrusted multi-tenant code where a kernel escape is unacceptable — microVMs. Firecracker for serverless-shaped workloads; Kata Containers with Firecracker or Cloud Hypervisor if you want Kubernetes pod semantics with VM isolation.
  4. Workloads that need real hardware, firmware, or passthrough — full VMs or Cloud Hypervisor with VFIO.

The isolation spectrum is ultimately a budgeting exercise: every boundary you add costs startup latency, memory, and operational complexity, and every boundary you remove spends security. Firecracker’s contribution was proving that the middle of the spectrum could be cheap enough that the security choice stopped being a luxury.

References