Home / Guides

Build log

Running Firecracker inside a rented VDS

Firecracker needs /dev/kvm. Most cheap cloud servers don't have it. Here's how we found one that does, and the 90-second boot that came with it.

Updated 2026-11-29 · 7 min read

Yurt gives every agent its own Firecracker microVM. Firecracker is a tiny hypervisor, but it isn't a full emulator: it relies on the Linux kernel's KVM, which relies on the CPU's virtualization extensions (Intel VT-x or AMD-V). On bare metal, that's a given. On a server that is itself a VM, it's only there if the provider passes those extensions through. That's called nested virtualization.

Check before you rent

Two commands tell you whether a box can run Firecracker:

ls /dev/kvm                       # must exist
grep -cE 'vmx|svm' /proc/cpuinfo  # must be > 0 (vmx = Intel, svm = AMD)

We started on Contabo. Their FAQ says the Cloud VDS line supports nested virtualization and the regular VPS line does not. We rented the smallest VDS (AMD, around $59/month), ran both checks, and got a /dev/kvm. Bare metal will come later for cost and speed. A VDS let us start the same day with no hardware.

The first boot: 7 seconds

The setup is small: a kernel, an ext4 root filesystem built with debootstrap, one tap device per VM, and NAT out through the host. Each VM is one Firecracker process under systemd:

systemd-run --unit="yurtvm-$NAME" --collect \
  firecracker --api-sock "/run/yurt/$NAME.sock" --config-file "$D/config.json"

The very first VM booted in about 7 seconds. SSH, ping, DNS and HTTPS all worked from inside. Good start.

Then: 77 to 104 seconds

Later cold boots took between 77 and 104 seconds. While booting, the Firecracker process sat at around 90% CPU in early kernel and systemd startup. Our first guess was the clock source, a classic cause of slow guests. It was already kvm-clock, so that wasn't it.

Our working theory is VM exits. Whenever a guest does something the hardware can't handle by itself, like writing to a serial port, the CPU leaves the guest and asks the hypervisor. Under nested virtualization there are two hypervisors. The exit lands at the outer one first and is passed to the inner one, which makes each exit much more expensive. A chatty boot (kernel log to the serial console, systemd status lines) turns into thousands of slow round trips.

Cheap things we're testing:

The real fix: never cold-boot a customer VM

Waking a sleeping VM from a snapshot takes about 0.04 seconds (how that works). So the plan is to boot one "golden" VM once, put it to sleep, and create every new VM by copying its disk, memory and state files and restoring them. A cloned VM can't be identical to the golden one, so a few things have to change on the way:

ProblemFix
Same tap device namenetwork_overrides on snapshot load
Same disk pathA per-VM mount namespace (or Firecracker's jailer), so each VM sees its own disk at the same path
Same guest IPA network namespace per VM, or set the IP after restore
Same SSH host keys and hostnameInject new ones right after restore

The last row isn't optional. Two machines with the same SSH host key would let one pretend to be the other.

We'll write up the clone path, with numbers, once it's in production.

Questions

How do I check whether a server can run Firecracker?

Check that /dev/kvm exists and that grep -cE 'vmx|svm' /proc/cpuinfo returns more than zero.

Does a normal VPS support nested virtualization?

Usually not. Some providers offer it on specific lines. Contabo says its Cloud VDS supports nested virtualization and its VPS line does not.

Why is a cold boot slow under nested virtualization?

Every VM exit goes through two hypervisors. A boot that writes a lot to the serial console causes many exits, and each one costs more than on bare metal.

Sources

  1. Firecracker getting started, read 2026-11-29

Give your agent its own computer. Full root, its own IPv6, and it sleeps with its memory when idle. Plans from $20/month, paid back as VM time.

curl -fsSL https://getyurt.dev/install | sh

Keep reading