What a Firecracker guest needs: kernel image, root filesystem, boot arguments and devices
A container starts from an image and shares the host's kernel. A Firecracker microVM starts from two files you provide, a kernel and a root filesystem, plus a short list of devices you attach through its API.
Knowing what goes into each is useful whether you are building your own microVM platform or just want to understand what "its own kernel" means for a sandbox. This post follows Firecracker's rootfs and kernel setup guide, kernel support policy, getting started guide and device docs, as of November 2026.
The kernel image
Firecracker loads the guest kernel image you point it at. On x86_64 it accepts an uncompressed ELF vmlinux or a bzImage and detects which one it was given. On aarch64 it takes a PE-format Image. The guide recommends vmlinux on x86_64.
A bzImage is compressed and the guest decompresses it at boot, which costs extra work and extra guest memory, and so host memory. The exception is Firecracker's Nitro Sandbox mode, which boots through UEFI and needs an EFI-stub bzImage.
To build one: take the Linux source, check out a version, start from Firecracker's recommended guest config in resources/guest_configs/ as .config, and run make vmlinux (x86_64) or make Image (aarch64). Firecracker's repo also has a recipe that builds the kernels its CI uses.
Which kernel versions
The kernel support policy lists validated host and guest kernels. As of November 2026 its guest table lists v5.10, v6.1 and v6.18 for 4K pages, each with a minimum end-of-support date, and the policy is that a kernel version is supported for at least two years after it is added. Other versions may work but are not tested.
The microVM kernels Amazon Linux builds from these configs are published in the Amazon Linux kernel repository under microvm-kernel-* tags.
Kernel options that matter for devices
Each optional device needs its driver in the guest kernel:
- vsock:
CONFIG_VIRTIO_VSOCKETSin the guest (andCONFIG_VHOST_VSOCKon the host). - Entropy:
CONFIG_HW_RANDOM_VIRTIO, which depends onCONFIG_HW_RANDOMandCONFIG_VIRTIO. - Root filesystem: whatever filesystem the rootfs uses must be built in, so the kernel can mount it at boot.
A missing option shows up as a device that is simply absent in the guest, not as an error from Firecracker.
The root filesystem
The guide's definition is short: a rootfs image is a filesystem image that hosts at least an init system. The final step of Linux boot runs /sbin/init and expects it never to exit.
The manual recipe in the guide:
- Create a file of the size you need and format it:
ddthenmkfs.ext4. - Mount it.
- Populate it. The guide uses an Alpine container with the image bind-mounted, installs
OpenRCandutil-linux, sets up a login on the serial console (ttyS0), enables thedevfs,procfsandsysfsservices at boot, and copies/bin,/etc,/lib,/root,/sbinand/usracross, then creates empty/dev,/proc,/run,/sysand/var. - Unmount.
The repo also has a recipe for the minimized Ubuntu 22.04 image its CI uses, and the guide covers building a FreeBSD kernel and rootfs.
For a sandbox, two choices follow from this:
- The init is yours. A full init system is convenient, but a sandbox guest often runs a single small agent as init that waits for commands. The less that starts, the less there is to attack.
- Read-only root, writable scratch. Firecracker drives have an
is_read_onlyflag. A read-only root drive shared by many VMs plus a writable drive per VM keeps the base image clean and makes "throw it away" mean exactly that.
Boot arguments
The getting started guide configures the boot source with a kernel path and boot arguments; its example is:
console=ttyS0 reboot=k panic=1
That sends the console to the serial port, sets how the kernel reboots, and has it reboot shortly after a panic instead of hanging. Firecracker's design doc says the partial keyboard controller exists so the guest can signal that it wants a reset, which the host side then handles.
For production, the host setup guide recommends not enabling the serial console and suggests 8250.nr_uarts=0 to disable it in the guest, while warning that a guest can turn it back on, so the host must bound that output regardless. See the host checklist.
Devices
Firecracker's machine model is small on purpose. Guests see VirtIO network and block devices, a serial console, and part of a keyboard controller used only so the guest can ask for a reset, plus the interrupt controllers and timer KVM provides.
You attach, through the API before boot:
- Drives (
PUT /drives/{id}), backed by files on the host and pre-formatted with a filesystem the guest kernel supports. One is markedis_root_device. - Network interfaces (
PUT /network-interfaces/{id}), each backed by a host TAP device. Leave them out and the guest has no network device at all. - vsock (
PUT /vsock), a host-guest channel over Unix sockets; see Firecracker vsock. - Entropy (
PUT /entropy), avirtio-rngdevice that gives the guest random bytes from the host throughaws-lc-rs, with an optional rate limiter. - Balloon (
PUT /balloon), for reclaiming memory from a cooperative guest; see the balloon device. - MMDS (
PUT /mmds/config), a metadata store reached over a network interface; see MMDS.
Rate limiters can be attached to drives, interfaces and the entropy device; see rate limiters. Then InstanceStart boots the VM.
Why "its own kernel" matters
Every one of these pieces is per VM. The guest's kernel handles its own system calls, so a kernel bug the guest triggers is a bug in the guest's kernel, not the host's. The host's exposure is the small device model above, Firecracker's process, which runs under seccomp filters and usually the jailer, and KVM. KVM basics for application engineers goes through that boundary.
Where Sandscale fits
On Sandscale, each sandbox is its own Firecracker microVM with its own kernel, and you do not build kernels or root filesystems. You pick a template, such as the built-in builtin:node, builtin:python or builtin:go, or start from a snapshot of a sandbox's /workspace. The templates page and the snapshots guide cover both.
Originally published on the Sandscale blog.
Comments
No comments yet. Start the discussion.