MicroVM vs container: what Firecracker isolates that Docker doesn't

Last updated

Where the kernel is

Container

one system call away

Firecracker microVM

hardware virtualization (KVM)

Container Code you didn't write

Every system call the container makes is handled by the host kernel. gVisor's documentation: "the workload is only one system call away from host compromise."

Container Namespaces and cgroups

Namespaces give the process its own view of files, processes and the network; cgroups "implement resource accounting and limiting"; Docker also drops capabilities by default.

Container Container runtime

The container runtime is part of the attack surface too: CVE-2024-21626 in runc allowed "several container breakouts due to internally leaked fds".

Container Host kernel

"A container shares the kernel of the machine it runs on." A kernel bug or a container-runtime escape reaches the host from a container.

Firecracker microVM Code you didn't write

Code in the guest talks to its guest kernel. Firecracker's design assumes it will try to get out: "all vCPU threads are considered to be running malicious code as soon as they have been started."

Firecracker microVM Guest kernel

A microVM boots its own kernel. A kernel bug or a container-runtime escape only reaches the guest kernel from a microVM.

Firecracker microVM A handful of emulated devices

The guest kernel talks to a handful of emulated devices: VirtIO network, block and vsock devices, a serial console and a partial keyboard controller.

Firecracker microVM Host kernel

To reach the host, an exploit has to get through the guest kernel and then through the virtual machine monitor. Each microVM is one Firecracker process.

What sits between the code an agent runs and the host. Docker's, gVisor's and Firecracker's own documentation, 5 November 2026.

A container is a process that shares the host's kernel, fenced by namespaces and cgroups. A microVM is a small virtual machine with its own guest kernel, behind hardware virtualization. For an AI agent that runs code you didn't write, that is the difference that matters: a kernel bug or a container-runtime escape reaches the host from a container, and only reaches the guest kernel from a microVM. gVisor and Kata Containers sit in between, and a microVM still does nothing about network egress on its own.

Container (Docker, runc) gVisor (runsc) Kata Containers Firecracker microVM Full VM
Kernel the workload talks to The host's gVisor's Sentry, a kernel in Go, in userspace Its own guest kernel Its own guest kernel Its own guest kernel
Boundary Namespaces, cgroups, seccomp, capabilities Sentry, plus a small set of host syscalls Hardware virtualization Hardware virtualization (KVM), small device model Hardware virtualization, full device model
Image OCI image OCI image OCI image Kernel + root filesystem Disk image
Typical use Packaging, trusted code Sandboxed containers on Docker or Kubernetes VM isolation behind a container API Serverless, agent sandboxes Long-lived servers

Every third-party fact on this page was checked on 5 November 2026, on the project's own documentation.

What is the difference between a microVM and a container?

Where the kernel is.

Docker puts it plainly: "A container shares the kernel of the machine it runs on." It is "a process isolated by namespaces and cgroups in the kernel it shares with the machine", and "no flag on docker run produces a second kernel." Namespaces give the process its own view of files, processes and the network; cgroups "implement resource accounting and limiting"; Docker also drops capabilities by default. But every system call the container makes is handled by the host kernel. gVisor's documentation sums up what that means for untrusted code: "the workload is only one system call away from host compromise."

The container runtime is part of the attack surface too. In January 2024, CVE-2024-21626 in runc (versions 1.0.0-rc93 to 1.1.11, fixed in 1.1.12) allowed "several container breakouts due to internally leaked fds": a process could get a working directory in the host's filesystem.

A microVM boots its own kernel. Firecracker "uses the Linux Kernel Virtual Machine (KVM) to create and run microVMs", and each microVM is one Firecracker process. Code in the guest talks to its guest kernel, which talks to a handful of emulated devices: VirtIO network, block and vsock devices, a serial console and a partial keyboard controller. To reach the host, an exploit has to get through the guest kernel and then through the virtual machine monitor. Firecracker's design assumes it will try: "all vCPU threads are considered to be running malicious code as soon as they have been started."

MicroVM vs container vs VM

A microVM is a VM, with less in it. Firecracker "excludes unnecessary devices and guest-facing functionality to reduce the memory footprint" and the attack surface of each microVM: the guest gets the few devices above and little else. Less to emulate means less code an exploit can reach, less memory per VM and a faster boot than a VM with a full device model.

Firecracker was built at AWS for Lambda and Fargate, which is to say for running many small, short-lived, untrusted workloads side by side. A full VM, on QEMU or a cloud instance, brings a full device model; for a coding agent, that is mostly weight it doesn't use.

Firecracker vs Docker

Docker Firecracker
What you start A container: a process on the host kernel A microVM: a guest kernel and a root filesystem
Isolation Namespaces, cgroups, seccomp, capabilities KVM hardware virtualization, seccomp filters on the VMM; in production, the jailer adds cgroup and namespace isolation, then drops privileges
Start time Starting a process ≤ 125 ms to the guest's init, per the spec (minimal guest)
Images OCI images from a registry A kernel and a disk image you build, or a service's
Network A bridge network; containers "can make outgoing connections" by default A TAP device; "Firecracker does not perform any network traffic filtering"
Needs A Linux kernel with namespaces and cgroups Linux with KVM (bare metal or nested virtualization)
Tooling docker run, Compose, every CI A REST API on a Unix socket per VM: the rest is yours or a service's

Firecracker isn't a Docker replacement for packaging software; it's a different boundary. You can, and often do, run Docker inside a Firecracker VM (below). Kata Containers goes the other way: it can use Firecracker, QEMU or Cloud Hypervisor to run each container in a lightweight VM, behind the usual container API.

Where do gVisor and Kata sit?

gVisor is "an application kernel that implements a Linux-like interface", written "in a memory-safe language (Go)" and running "in userspace". Its OCI runtime, runsc, plugs into Docker and Kubernetes. The application's system calls go to gVisor's Sentry, and "no system call is passed through directly to the host"; the Sentry itself makes "a minimal set of host system calls". gVisor calls itself "not a VM in the everyday sense of the term", but a "distinct third approach". It intercepts calls through a platform: systrap by default (seccomp traps, works inside VMs), or KVM, which "runs best on bare-metal setups".

Kata Containers runs containers in "lightweight virtual machines that feel and perform like containers", using "hardware virtualization technology" for "stronger workload isolation". It supports several hypervisors, "including QEMU, Cloud-Hypervisor and Firecracker".

Firecracker vs gVisor

  • Boundary. Firecracker puts a guest kernel behind KVM. gVisor reimplements the kernel interface in a userspace process; its KVM platform uses the same hardware, but gVisor's own docs warn that "one should not assume that the mere use of virtualization hardware makes a system more or less secure."
  • Compatibility. A Firecracker guest is a real Linux kernel, so anything Linux runs, runs: Docker, systemd, kernel modules you build in. gVisor runs what its Sentry implements.
  • Overhead. gVisor's cost is per system call: "small operations impose a large overhead", and the workloads that pay most are "system call bound, which tend to be high-performance data stores and static network services". Firecracker's cost is a guest kernel's memory and boot, then near-native compute.
  • Where it runs. gVisor recommends systrap inside VMs and on machines without virtualization support. Firecracker needs KVM: bare metal or nested virtualization.

How much overhead does a microVM add?

Firecracker's specification, measured on M5D.metal (hyperthreading off) and M6G.metal instances:

What Firecracker spec
InstanceStart to guest init ≤ 125 ms, with a minimal kernel and root filesystem, serial console off
VMM memory overhead ≤ 5 MiB, for a 1 vCPU, 128 MiB guest
Guest CPU, compute only > 95 % of bare metal (integration test pending)
Network up to 14.5 Gbps with ≤ 80 % of a host core, 25 Gbps with a full core
Storage up to 1 GiB/s with ≤ 70 % of a host core

A real agent VM is heavier: a full Ubuntu with systemd and sshd, not a minimal init. Here is what we measured on flockvm's Paris host (Intel Xeon E3-1230 V2, RAID1 SATA SSDs; retired on 2026-11-10), with the Minimal image only (Ubuntu 24.04 at the time), creating VMs one after the other, on 31 October 2026:

Step, Minimal image Time
Firecracker start → SSH banner 0.69–0.75 s
API create → running, small or default 0.81–0.89 s
API create → first ssh root@GUEST_IP true, from the host 1.09–1.19 s

On the same host and image, an idle 2 vCPU / 4 GiB VM held 255–262 MiB of host RAM: guest memory is allocated as it's touched. The default Agent image, with its toolchains and agent CLIs, and the Ubuntu 26.04 images were not timed on that host. On the host in France that runs VMs today (AMD Ryzen 9 9900X), 12 VMs on the Agent image took 0.43 to 1.34 s from creation to SSH answering, median about 1.1 s, on 9 and 10 November 2026. These are single-host numbers, not a benchmark.

A container skips the guest kernel, so it starts faster and uses less memory per instance. For an agent session that runs for minutes or hours, a second of boot and a few hundred MiB rarely decide it; for thousands of very short calls, they can.

What a microVM adds

Firecracker's spec

from InstanceStart to guest init. With a minimal kernel and root filesystem, serial console off.
≤ 125 ms
of VMM memory overhead. For a 1 vCPU, 128 MiB guest.
≤ 5 MiB
of bare metal, guest CPU. Compute only (integration test pending).
> 95 %

Measured

Spec: Firecracker's specification, minimal guest. Measured: flockvm's former host (retired on 2026-11-10), Minimal image, VMs created one after the other, 31 October 2026; in accent, the host in France that runs VMs today, 12 VMs on the Agent image, median about 1.1 s, 9 and 10 November 2026. Single-host numbers, not a benchmark.

Can you run Docker inside a microVM?

Yes, and for coding agents it's often the point: the agent gets its own Docker daemon without touching the host's. The guest kernel needs what Docker needs. On flockvm, Firecracker's stock CI kernel boots but has no nf_tables, so Docker's iptables-nft calls fail; our guest kernel adds nf_tables, overlayfs and FUSE, and docker run hello-world is part of the host's self-test. Both flockvm images ship Docker 29 with buildx and Compose, started on first use so it costs no memory until then.

Docker's own Docker Sandboxes follows the same idea on your laptop: "Each sandbox has a private Docker daemon inside the microVM, so build and compose work without a host socket mount and without host privileges."

Docker's wording names the alternative it avoids: a host socket mount, or host privileges. Docker's daemon "requires root privileges unless you opt-in to Rootless mode", so a container that can drive a root daemon on the host has a path to the host.

When is a container enough?

  • The code is yours or trusted, and the container is there for reproducibility, not containment.
  • You control the kernel and patch it, and you add seccomp, a non-root user, no extra capabilities and no Docker socket.
  • You need density or start time above all: thousands of short tasks, where a guest kernel per task costs too much.
  • You run on a cloud VM without nested virtualization. Then gVisor (systrap) is the stronger option you can actually run.

Pick a microVM when the code is untrusted, when an AI agent runs with permissions skipped, when you need Docker or systemd inside, or when one tenant's kernel exploit must not reach another. Anthropic's Claude Code docs say the same about agents: a VM gives "the strongest separation", for "untrusted code" or when policy "requires kernel-level separation". Claude Code sandbox options maps each layer to what it blocks.

Either way, a microVM doesn't filter the network. Firecracker: "All egress traffic from a guest is therefore considered untrusted, and should be filtered at the host-level." Isolation keeps the agent off your host; only an egress policy keeps your data in.

A container, or a microVM?

What is your case?

The code is yours or trusted

A container is enough

The container is there for reproducibility, not containment.

You control the kernel and patch it

A container is enough

And you add seccomp, a non-root user, no extra capabilities and no Docker socket.

You need density or start time above all

A container is enough

Thousands of short tasks, where a guest kernel per task costs too much.

A cloud VM without nested virtualization

gVisor

Then gVisor (systrap) is the stronger option you can actually run.

Read that part

The code is untrusted, or an agent skips permissions

A microVM

Anthropic's Claude Code docs say the same about agents: a VM gives "the strongest separation", for "untrusted code" or when policy "requires kernel-level separation".

You need Docker or systemd inside

A microVM

A Firecracker guest is a real Linux kernel, so anything Linux runs, runs: Docker, systemd, kernel modules you build in.

Read that part

The cases of this section, one pick each.

When flockvm is the wrong pick

flockvm runs one Firecracker microVM per agent or CI job, on one host in France. It is the wrong pick when:

  • you need Kubernetes pods: use gVisor or Kata on your own cluster;
  • you need thousands of short sandboxes per minute: the host in France runs at most 15 small VMs (2 vCPU / 4 GiB) at once today, it is the one region, and more are planned;
  • you need an egress allowlist or a secrets proxy: outbound IPv4 from a flockvm VM is open (except private ranges, cloud metadata, other VMs, the host and SMTP port 25), and there is no secrets proxy yet;
  • you want to run Firecracker yourself: Firecracker sandboxes lists what you'd build around it.

Otherwise: SSH, pause with memory (how Firecracker snapshots work), billed per second ($0.016 an hour for a small VM on 5 November 2026) against an $18 monthly plan that comes back as VM time, and a 7-day free trial (card required, nothing charged for 7 days).

FAQ

Is a microVM more secure than a container?

It has a stronger boundary: a guest kernel behind hardware virtualization instead of the host's kernel. It isn't a full answer: a microVM still lets the guest reach the network unless the host filters it, and what you put inside the VM can leak.

Is Firecracker a container runtime?

No, it's a virtual machine monitor. It runs a kernel and a root filesystem, not OCI images. Kata Containers and Flintlock integrate it into container tooling.

Is gVisor a microVM?

No. gVisor is a userspace application kernel; on its KVM platform it uses virtualization hardware, but it doesn't boot a guest Linux kernel.

Does Docker Sandboxes use containers or microVMs?

MicroVMs: Docker says "Docker Sandboxes run AI agents in microVMs", with a "separate kernel per sandbox".

Can a microVM run on macOS?

Firecracker needs Linux with KVM, so not directly on a Mac. You run it on a Linux server, or use a service that does.

Run your agents in their own microVMs

flockvm gives each coding agent a Firecracker microVM that pauses with its memory and resumes, billed per second. France is live, and you can start with a 7-day free trial.

Start your 7-day free trial

Card required. Nothing charged for 7 days.