I finally got it to work but wanted to hear if this seems to be a normal method.
Xubuntu 22.04 KVM Host
Ubuntu MATE 22.04 VM
From the Host, both virsh shutdown, and virt-manager shutdown commands did not shut down the VM. Only destroy would work.
Upon closer inspection, what is happening is if the VM is running in the background, and I am not logged into the VM, and then when I initiate the shutdown command from the host, I can see the VM is prompting for a 2nd interaction, waiting for a shutdown button or some other similarly named button to be clicked to complete the task.
After reading the virsh manpage for the shutdown command, I learned there are various modes that can be used to do a shutdown. Most of the Googl'in I did suggested checking that ACPI is enabled on the guest and to adjust the powerbutton event script, which seems all too much. I was hoping for a "just work" solution. The simplest I came up with was to just install qemu-guest-agent on the VM, which also adds a unix channel to the VM configuration, enabling this control.
This enables my virsh shutdown or virt-manager shutdown to do a graceful shutdown, vs using destroy.
On the VM:
Restart the VM, then from the Host try to shutdown:
Or, use virt-manager gui to shutdown the VM. Both now work.
I suppose this will be needed in future cases where the shutdown control doesn't work, depending on the host OS and/or VM distros running. This is the first time I have had this problem.
Am I missing a simpler method here.
Xubuntu 22.04 KVM Host
Ubuntu MATE 22.04 VM
From the Host, both virsh shutdown, and virt-manager shutdown commands did not shut down the VM. Only destroy would work.
Upon closer inspection, what is happening is if the VM is running in the background, and I am not logged into the VM, and then when I initiate the shutdown command from the host, I can see the VM is prompting for a 2nd interaction, waiting for a shutdown button or some other similarly named button to be clicked to complete the task.
After reading the virsh manpage for the shutdown command, I learned there are various modes that can be used to do a shutdown. Most of the Googl'in I did suggested checking that ACPI is enabled on the guest and to adjust the powerbutton event script, which seems all too much. I was hoping for a "just work" solution. The simplest I came up with was to just install qemu-guest-agent on the VM, which also adds a unix channel to the VM configuration, enabling this control.
This enables my virsh shutdown or virt-manager shutdown to do a graceful shutdown, vs using destroy.
On the VM:
Code:
sudo apt update
sudo apt install qemu-guest-agent
Code:
virsh shutdown --mode agent UbuntuMATE22.04
I suppose this will be needed in future cases where the shutdown control doesn't work, depending on the host OS and/or VM distros running. This is the first time I have had this problem.
Am I missing a simpler method here.