Secure and fast microVMs for serverless computing
open sourceApache-2.0self-hostablefree
Firecracker is a virtual machine monitor that uses Linux KVM to create lightweight virtual machines, microVMs, which combine hardware-virtualization isolation with the speed of containers: it boots a guest in under 125 ms with under 5 MiB of memory overhead and can create up to 150 microVMs per second on a host. It leaves out every device a serverless guest doesn't need (it emulates only a handful, such as virtio net, block and vsock) to shrink its attack surface, and each Firecracker process is configured through a REST API on a Unix socket, runs with per-thread seccomp filters and is started in production by a jailer that adds cgroup and namespace isolation and drops privileges. Amazon Web Services built it for AWS Lambda and AWS Fargate, and it can also run a guest as an AWS Nitro Sandbox on EC2. Kata Containers, Fly.io, E2B and others use it; Apache-2.0, written in Rust.
Problems it solves
- run each customer's code in its own VM but with container-like startup times
- boot thousands of lightweight virtual machines per host for a serverless platform
- a minimal hypervisor with a small attack surface for multi-tenant workloads
- sandbox untrusted code from AI agents in a VM that starts in milliseconds
- build our own functions-as-a-service platform with VM isolation per function
- start a Linux VM from a kernel image and root filesystem through an HTTP API
- pack many small VMs onto a bare-metal host with CPU and memory oversubscription
- rate limit disk and network bandwidth for each guest VM
- an alternative to QEMU purpose-built for short-lived serverless workloads
- give each container in Kubernetes its own microVM through the container runtime
- isolate guest VMs with the AWS Nitro System on EC2 instead of KVM
- run guest VMs with a few MiB of memory overhead each
Features
- boots a guest in under 125 ms with under 5 MiB memory overhead per microVM
- creates up to 150 microVMs per second per host
- REST API on a Unix socket, specified in OpenAPI, to configure and start each microVM
- vCPU count, memory size and CPU templates
- virtio network and block devices, with rate limiters for bandwidth and operations per second
- vsock, entropy and pmem devices; memory hotplugging
- guest-facing metadata service (beta)
- jailer process that applies cgroup and namespace isolation and drops privileges
- thread-specific seccomp filters
- demand fault paging and CPU oversubscription on by default
View 2 more
- Nitro Sandbox mode on EC2, isolated by the AWS Nitro System, with optional attestation
- tested on Intel, AMD and Graviton bare-metal EC2 instances
Limitations
- Doesn't run Windows guests: Firecracker supports Linux host and guest operating systems, and OSv guests1
- Doesn't support rebooting a guest microVM1
- Can't run a guest built for a different CPU architecture: guests must match the host's architecture1
Capabilities
| Has an API | plan not known |
|---|
Alternatives
The same job
These do what Firecracker does.
- Kata Containers The speed of containers, the security of VMs
- gVisor Application Kernel for Containers
