aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-23 19:44:15 +0000
committertv <tv@krebsco.de>2026-11-25 12:22:23 +0000
commit312605171f6e3ef59a0f7c0cffc69e98c346a60c (patch)
tree0128bddfcd0500f9a553fa68452415df75203ba9 /README.md
parent18b1f50456a1105c6eecb8bf3c7a42ebbe9dd4cd (diff)
run-firecracker-vm: --vmm cloud-hypervisor
Firecracker was the only hypervisor, with its limit of about 19 devices (virtio-mmio, an interrupt each), no hot-plugging, and no virtio-fs. Now the run script can also start the same build in Cloud Hypervisor (--vmm cloud-hypervisor; Firecracker stays the default), translating the Firecracker configuration it makes anyway into Cloud Hypervisor's options: kernel (the same vmlinux, which it boots via PVH), initrd and command line, CPUs and memory, the drives (read-only for the images), the tap and MAC, vsock. The drives are image_type=raw: without it, Cloud Hypervisor guesses, and then refuses writes to sector 0, which wrecks ext4 (the rw-store, home). Its vsock works like Firecracker's (a guest's connection to port PORT goes to the socket SOCKET_PORT), so the 9P servers stay as they are, and the guest finds its drives by label, so their order on PCI doesn't matter. Unlike Firecracker, it restarts the guest on reboot (a reset), so the way out there is poweroff. Its options are KEY=VALUE,... lists, so it takes no commas in --store and --home.
Diffstat (limited to 'README.md')
-rw-r--r--README.md11
1 files changed, 9 insertions, 2 deletions
diff --git a/README.md b/README.md
index 10fceb1..8556192 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
# firecracker
-NixOS guests in [Firecracker](https://firecracker-microvm.github.io/),
+NixOS guests in [Firecracker](https://firecracker-microvm.github.io/)
+(or Cloud Hypervisor, see below),
started from a NixOS host, reached by ssh, or with `layers/console.nix`,
dropping into a root shell on the serial console. Boots in about a
second and a quarter. Stable Nix, no flakes.
@@ -97,7 +98,8 @@ the shell there asks the terminal before each prompt (`resize`, which
works in tmux, too). A tmux attached on the console keeps the size it
started with: detach and attach again after resizing.
-Leave the guest with `reboot` (there, or via ssh, see below).
+Leave the guest with `reboot` (there, or via ssh, see below; in Cloud
+Hypervisor, `poweroff`).
The guest's store is read-only, and there's no nix, unless it has the
nix layer, preferably first, so its image is the same for all guests
@@ -168,6 +170,11 @@ faster, but changes may not show up while the guest runs). Other modes:
The guest gets 2 CPUs and 1024 MiB unless told otherwise (`--vcpus N`,
1 to 32; `--mem-size MIB`).
+The same build also runs in [Cloud
+Hypervisor](https://www.cloudhypervisor.org/) instead of Firecracker,
+with `--vmm cloud-hypervisor`. It restarts the guest on `reboot`, so
+leave it with `poweroff` there.
+
The guests run sshd. Its host key is a secret (see below), so it's not
in the store, and the run script requires it: `--secret
ssh_host_ed25519_key=FILE` (an ed25519 private key without passphrase).