qemu FreeBSD 13.0 guest in Linux with qemu/KVM hangs on poweroff

I used virt-manager to make a FreeBSD VM inside Arch Linux. It used the i440FX chipset and BIOS (not UEFI). I gave it one processor and 2GB of RAM which is above the minimum requirements. Other than that, I used the default settings that virt-manager uses for FreeBSD machines. Booting worked fine, I ran bsdinstall and then dropped down to a shell. After I ran
Code:
poweroff
CPU usage shot up to 100% and it hung at the following screen:

Screenshot_20211116_191707.png


I waited for about 30 minutes before I gave up. Where do you think I went wrong?
 
I haven't used qemu / kvm for a while but verify that the following options are enabled for your VM:
Code:
<features>
  <acpi/>
  ...
</features>
<on_poweroff>destroy</on_poweroff>
You can dump the VM configuration with this command:

Code:
virsh dumpxml my_vm
 
The kvm defaults are:
Code:
[orac.5067] $ sudo virsh dumpxml strand | egrep "poweroff|reboot|crash"
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
The polite way to shutdown any FreeBSD system quickly is:
Code:
shutdown -p now # poweroff
shutdown -r now # reboot
 
Back
Top