Cycle's hosted MCP is live. Your AI tooling just learned DevOps.Read the announcement

What Is a MicroVM?.

A microVM is a virtual machine stripped down to the minimum devices and features a modern Linux guest needs, so it boots fast and uses little memory. It keeps the isolation of hardware virtualization: each microVM runs its own guest kernel behind a hardware hypervisor, usually KVM, instead of sharing the host's kernel the way a container does.

The best-known microVM monitor is Firecracker, which Amazon Web Services built for AWS Lambda and AWS Fargate. The design fits any host that runs code from many tenants, from serverless functions to AI sandboxes. This page covers how a microVM differs from a traditional VM and from a container, the projects that build them, where they fall short, and how to start a Firecracker microVM by hand.

How a microVM works

Every KVM virtual machine has two layers. The kernel's KVM module does the hardware virtualization, and a user-space virtual machine monitor (VMM) creates guest memory and vCPUs through /dev/kvm and emulates the devices the guest sees, as covered in what a hypervisor is.

A microVM is defined by how little the VMM does. Firecracker's FAQ lists its emulated devices as virtio-net, virtio-block, virtio-vsock, virtio-balloon, a serial console and a minimal keyboard controller used only to stop the microVM. Later releases added a few optional virtio devices, such as an entropy source and pmem. There's no USB, no graphics, no sound card and no emulated disk controller.

The boot path is usually cut down the same way. With Firecracker, you hand the VMM a kernel image and a root filesystem, and it loads the kernel into guest memory itself. There's no BIOS or UEFI stage and no bootloader, so a whole phase of a normal VM boot never runs. QEMU's microvm machine type keeps a minimal firmware stage instead, covered below.

MicroVM vs traditional VM

A general-purpose VMM like QEMU is built to boot almost any operating system, so by default it emulates a full PC: a chipset with PCI and ACPI, firmware, and optional devices from VGA cards to SATA and USB controllers. All of that code runs on the host, and every emulated device is attack surface a malicious guest can probe.

A microVM keeps only what a Linux guest with virtio drivers needs: little or no firmware stage, no legacy devices and a small API per VM process instead of libvirt or a GUI. That costs flexibility: guests are usually Linux with a kernel built for the VMM, and hotplug, device passthrough and live migration are limited or missing, depending on the VMM.

Virtio is paravirtualized. The guest knows it runs in a VM and talks to the host through shared memory queues instead of driving imitation hardware, which keeps the device code on the host small. For the general picture, see what a virtual machine is.

MicroVM vs container

The difference between a microVM and a container is the kernel. Containers on a host share one Linux kernel and are kept apart by namespaces, cgroups and seccomp filters. Every container still makes system calls into that kernel, so a kernel bug reachable from one container can be a path to the host and every container on it.

A microVM gives each workload its own guest kernel. Code that compromises that kernel controls one VM, not the host. To go further it has to break out through KVM or the VMM, and Firecracker's design document treats every vCPU thread as running malicious code from the moment it starts.

Firecracker adds layers around the VMM too. It installs seccomp filters on its own threads by default, and in production it's started by the jailer, which sets up cgroups, a chroot in a new mount namespace and optional PID and network namespaces, drops privileges and then runs Firecracker as an unprivileged process.

Containers work well as an isolated environment for code you trust. For quarantined code you don't trust, a microVM's separate kernel is the stronger boundary. Container security basics covers how far the container side can be pushed.

MicroVM vs container vs full VM

Container

MicroVM

Full VM

Isolation boundary

Shared host kernel with namespaces, cgroups, seccomp

Own guest kernel behind a hypervisor (usually KVM) and a minimal VMM

Own guest kernel behind a hypervisor and a full VMM

Guest OS

None, uses the host kernel

Usually Linux

Any

Boot

Starts a process

Direct kernel boot. Firecracker's specification: 125 ms or less from InstanceStart to guest /sbin/init

Firmware, bootloader and full OS boot

Host overhead

A process and its cgroup

Firecracker's specification: 5 MiB or less of VMM memory for a 1 vCPU, 128 MiB microVM, plus guest memory

A full VMM process plus guest memory

Devices

Host devices you mount in

virtio net, block, vsock and a few others

Emulated hardware, PCI passthrough, GPUs

The Firecracker numbers are the project's own, measured on bare-metal x86 and Arm hosts with a Firecracker-tuned guest kernel. The boot figure uses a minimal kernel and root filesystem with the serial console off. Your own hosts may not reach them. What Is Sandboxing? places all three among the other isolation layers, from seccomp filters to separate hardware.

MicroVM projects and runtimes

Three open-source VMMs build microVMs, and Kata Containers connects them to container runtimes.

Firecracker

Firecracker is written in Rust and runs on KVM on x86_64 and aarch64 Linux hosts. Each Firecracker VM is its own process. The design document says a process holds exactly one microVM, with an API thread, a VMM thread and one thread per vCPU. The API is REST over a Unix socket, and it sets vCPUs and memory, attaches drives and network interfaces, and starts the guest.

Firecracker also has snapshots, I/O rate limiters and a metadata service for passing configuration to the guest. Its design document cites "a steady mutation rate of 5 microVMs per host core per second" for a minimal guest with one vCPU and 128 MiB of memory.

Cloud Hypervisor

Cloud Hypervisor is another Rust VMM built on the rust-vmm crates, and its README says a large part of its code is based on Firecracker and crosvm. It runs on KVM or the Microsoft Hypervisor (MSHV) and aims to be a general-purpose VMM for cloud workloads, not only containers and serverless.

That shows in the feature list: CPU, memory and PCI hotplug, VFIO device passthrough, Windows guests, and firmware boot as well as direct kernel boot. It's the option to look at when Firecracker's device model is too small.

QEMU's microvm machine type

QEMU ships a microvm machine type that its documentation describes as inspired by Firecracker and built after its machine model. By default it has no PCI bus, uses virtio-mmio devices and boots a minimal SeaBIOS build. ACPI support was added in QEMU 5.2 and is on by default; with ACPI turned off, it boots the smaller qboot firmware instead. PCIe can be enabled as an option. No current firmware can boot from a virtio-mmio disk, so the kernel is passed on the command line, as with Firecracker. It suits teams that already run QEMU and want a smaller machine model.

Kata Containers

Kata Containers is an OCI runtime that sits above these VMMs and runs each Kubernetes pod inside a lightweight VM. Kata ships as a containerd shim, so a container manager starts it like any other runtime. You keep your images and tooling, and every pod gets its own guest kernel.

Kata supports several hypervisors, including QEMU, Cloud Hypervisor and Firecracker. The choice matters: in Kata's own hypervisor comparison, only QEMU is marked as supporting GPUs.

Common microVM use cases

Serverless functions. Firecracker was built for this case. Its FAQ describes the goal as keeping strong isolation between customers while improving resource utilization over one full VM per customer. One microVM per tenant means one customer's code never shares a kernel with another's.

Multi-tenant code execution. Notebook services, online judges and plugin hosts all run code someone else wrote. A microVM per session gives that code a full Linux machine to work with and keeps the host a trusted environment.

AI agent sandboxes. An agent that writes and runs code needs somewhere to run it. An AI sandbox built on microVMs gives each session a quarantined agent with its own kernel, filesystem and network interface, and the whole VM can be thrown away when the session ends.

CI jobs. Build scripts often want root, Docker or kernel modules. A microVM per job gives them all three inside their own kernel without exposing the runner host.

Stronger isolation in Kubernetes. Kata Containers runs selected pods in VMs through a RuntimeClass while the rest keep the default runtime.

Limits and trade-offs

MicroVMs need hardware virtualization. On Linux hosts that means KVM, though Cloud Hypervisor can also run on the Microsoft Hypervisor. Firecracker requires read and write access to /dev/kvm, so it runs on bare metal or on a VM with nested virtualization. On a cloud provider, that means a bare-metal instance or an instance type that exposes nested virtualization. Nested setups also have to pass through the CPU features the VMM checks for, and Firecracker refuses to start a guest when KVM is missing one.

Device support is small by design. As of November 2026, Firecracker's API has no way to pass a GPU or other PCI device through to the guest, so GPU workloads need QEMU or Cloud Hypervisor. It has no shared filesystem like virtio-fs either, so files go in through block devices, the network or vsock.

No live migration in Firecracker. Its API has snapshot create and load endpoints but nothing for migrating a running microVM. A snapshot saves guest memory and device state so another Firecracker process can resume the guest. The snapshot docs say it must be resumed on identical software and hardware, and that resuming one snapshot more than once is insecure unless identifiers, random seeds and tokens are kept unique.

You manage a guest kernel and a root filesystem. A container image has no kernel. A microVM needs a guest kernel built with the right options, and Firecracker publishes a kernel support policy listing the host and guest kernel versions it validates.

Networking is your job. Firecracker network devices are backed by TAP devices on the host. Its design document says Firecracker does no traffic filtering and that all guest egress should be treated as untrusted and filtered on the host.

Starting a Firecracker microVM

This walk-through starts one Firecracker microVM through its API socket on an x86_64 Linux host with KVM. It skips the jailer and networking, which you'd add for anything past a test.

Check that the KVM module is loaded and /dev/kvm exists:

lsmod | grep kvm
ls -l /dev/kvm

You should see kvm plus kvm_intel or kvm_amd. Firecracker needs read and write access to /dev/kvm. The commands below get it through sudo, which the getting-started guide allows when the kvm group or an ACL isn't set up.

Download a release and install the binary:

ARCH="$(uname -m)"
VERSION="v1.18.0"
curl -fsSL "https://github.com/firecracker-microvm/firecracker/releases/download/${VERSION}/firecracker-${VERSION}-${ARCH}.tgz" | tar -xz
sudo install -m 0755 "release-${VERSION}-${ARCH}/firecracker-${VERSION}-${ARCH}" /usr/local/bin/firecracker
firecracker --version

The first line of output is Firecracker v1.18.0. The release directory also holds the jailer binary and the API's OpenAPI spec.

Firecracker also needs an uncompressed guest kernel and an ext4 root filesystem. The Firecracker getting-started guide has a script that downloads both from the project's CI, a vmlinux-* kernel and an Ubuntu image it converts to ubuntu-*.ext4. Run it in your working directory.

In a first terminal, start Firecracker with an API socket. It waits for configuration, and the guest's serial console prints here once it boots:

API_SOCKET=/tmp/firecracker.socket
sudo rm -f "$API_SOCKET"
sudo firecracker --api-sock "$API_SOCKET"

The guide's example adds --enable-pci, which attaches virtio devices over PCI instead of the default MMIO transport. The guest kernel then needs PCI support.

In a second terminal, from the same directory, set the machine size, the kernel and the root drive, then start the guest:

API_SOCKET=/tmp/firecracker.socket
KERNEL="$PWD/$(ls vmlinux-* | tail -1)"
ROOTFS="$PWD/$(ls *.ext4 | tail -1)"
sudo curl -sS --unix-socket "$API_SOCKET" -X PUT http://localhost/machine-config \
-H 'Content-Type: application/json' \
-d '{"vcpu_count": 1, "mem_size_mib": 256}'
sudo curl -sS --unix-socket "$API_SOCKET" -X PUT http://localhost/boot-source \
-H 'Content-Type: application/json' \
-d "{\"kernel_image_path\": \"$KERNEL\", \"boot_args\": \"console=ttyS0 reboot=k panic=1\"}"
sudo curl -sS --unix-socket "$API_SOCKET" -X PUT http://localhost/drives/rootfs \
-H 'Content-Type: application/json' \
-d "{\"drive_id\": \"rootfs\", \"path_on_host\": \"$ROOTFS\", \"is_root_device\": true, \"is_read_only\": false}"
sudo curl -sS --unix-socket "$API_SOCKET" -X PUT http://localhost/actions \
-H 'Content-Type: application/json' \
-d '{"action_type": "InstanceStart"}'

Each accepted request returns 204 No Content, so curl prints nothing. A rejected one prints a JSON fault_message. Then check the state from the host:

sudo curl -sS --unix-socket "$API_SOCKET" http://localhost/
{"id":"anonymous-instance","state":"Running","vmm_version":"1.18.0","app_name":"Firecracker"}

Before InstanceStart, the same call reports "state":"Not started". Firecracker exits when the guest shuts down or resets. Its docs give two clean ways to get there: run reboot inside the guest, which resets through the keyboard controller because of reboot=k, or send the SendCtrlAltDel action to /actions from the host.

If the state check fails with Couldn't connect to server, Firecracker has already exited, and the first terminal says why. Unexpected exit reason on vcpu run: Shutdown means KVM stopped the guest CPU after a fatal fault in the guest, a triple fault, and Firecracker exited with it.

If InstanceStart returns an error like this one, the host's KVM is missing a capability Firecracker checks for before booting:

{"fault_message":"Start microvm error: Kvm error: Missing KVM capabilities: 0x38"}

Capability 0x38 is KVM_CAP_XCRS, which depends on the CPU's XSAVE support. It shows up under nested virtualization when the outer hypervisor gives the VM a CPU model without XSAVE. Run on bare metal, or give the VM the host's CPU model.

Running microVMs past one host

Starting one microVM takes a handful of API calls. Running thousands means scheduling them, and each one needs a TAP device and firewall rules, a jailer chroot and cgroup, its own root filesystem copy and a host with spare capacity.

A layer above the VMM handles that work: Kata Containers under Kubernetes, firecracker-containerd under containerd, or a sandbox service that owns the lifecycle. Pick the VMM for the device model your workloads need, and the layer above it for how you want to schedule them.

Cookies

Cookies Preferences

We run basic, anonymous analytics by default to measure site traffic. By clicking "Accept," you allow additional cookies for advanced app improvements and tailored advertising. Choose what you share by clicking "Customize."