Closed popey closed 4 months ago
Non-brutes might connect to the monitor with something like socat -,echo=0,icanon=0 unix-connect:alpine-latest/alpine-latest-monitor.socket
and type system_powerdown
(or if feeling suddenly brutal then quit
)
It should be easy enough to wrap that behaviour into a quickemu option. I'd go for something where you could chose 3 options:
system_reset
system_powerdown
or quit
(and if that fails kill the pid)Would that seem OK to you ?
hang on - quickemu --vm alpine-latest.conf --monitor-cmd system-powerdown
used to be a way to do that I think. It's an option example in the man
page, but now tries to run the vm again using the same disk and fails (if the vm is up). Maybe this missing feature is a bug...
Already tried this.
I spun up a VM and then just manually connected to the VM using the monitor with netcat and qemu recognises but simply ignores the system_powerdown command. I think it's broken in Qemu https://gitlab.com/qemu-project/qemu/-/issues/1410
So, quickemu knows the pid, and could implement a --kill which just kill -9's the vm
curious: system_powerdown works fine here (I tried all three options before suggesting with expected results - on 22.04 not 24.04 though ...)
looking at Martin's PR I see what's changed and broken --monitor-cmd : the disk image check always happens so it tries to check an in-use image and fails.
FWIW, I also tested with Alpine Linux, thinking this was simpler. I can't get any distro to power off using the qemu monitor command system_powerdown
Expected behavior
Sometimes I would like to kill the VM I started without using extreme prejudice (
killall
). This is especially useful when running quickemu with a headless guest.Actual behavior
I brutally kill things for fun using
sudo killall
which my mum says is a bad thing to do.Thanks