Not able to reboot Linux guest on Windows host

Host environment

  • Operating system: Windows 10 Enterprise

  • OS/kernel version: 22H2

  • Architecture: x86_64

  • QEMU flavor: qemu-system-x86_64

  • QEMU version: 8.1

  • QEMU command line:

    qemu-system-x86_64.exe -m 4G -drive file=Disk.img,format=raw -accel whpx -smp 4

Emulated/Virtualized environment

  • Operating system: Linux Mint
  • OS/kernel version: 5.15.0-76-generic
  • Architecture: x86_64

Description of problem

I am running Linux Mint on Windows, but when I try to reboot the machine, I get the following error:

qemu: WHPX: Unexpected VP exit code 4

I did some experiments changing the flags I use when I launch Qemu and I realized that if I set -smp 1 it does not fail. Furthermore, if I set the irqchip to off (kernel-irqchip=off) it does not fail either, but both options do not have good performance at all. I realized too that if I set 4 cores (-smp 4), the error might appear up to 4 times.

What seems to be failing then is the APIC emulation that Hyper-V provides. Does anyone know if:

  1. Am I missing a flag when launching Qemu?
  2. Is it there a patch to solve this?

Any leads for solving this problem would be highly appreciated.

Steps to reproduce

  1. Install MSYS
  2. Open MSYS and run pacman -S mingw-w64-x86_64-qemu
  3. Launch Qemu and reboot machine

Additional information

Edited by Karla Vargas