From 2ca2286661d64b4f93bba4c6a998e271be65d5f4 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 25 Nov 2026 13:00:36 +0000 Subject: run-firecracker-vm: reboot and poweroff both end the VM, in either VMM Firecracker ends on a reset (reboot, with reboot=k), but stays on poweroff, with the guest halted; Cloud Hypervisor ends on poweroff, but restarts the guest on a reset. So which one left the VM depended on the VMM. Now the run script tells the guest (fc.vmm on the kernel command line), and a generator, fc-vmm-exit, changes the shutdown's last step, the SuccessAction of systemd-poweroff and -halt to reboot-force in Firecracker, and of systemd-reboot and -halt to poweroff-force in Cloud Hypervisor, after the same clean shutdown. Not a hook of systemd-shutdown, which runs those after unmounting, i.e. without /etc, an overlay here (found out the hard way: the first version, with such a hook, did nothing). --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index aed5d95..83e9a42 100644 --- a/README.md +++ b/README.md @@ -98,8 +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; in Cloud -Hypervisor, `poweroff`). +Leave the guest with `reboot` or `poweroff` (there, or via ssh, see +below): either ends the VM. 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 @@ -176,8 +176,7 @@ The guest gets 2 CPUs and 1024 MiB unless told otherwise (`--vcpus N`, 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. +with `--vmm cloud-hypervisor`. 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 -- cgit v1.3.1