I have Windows 11 VM running inside Qemu. Been trying to update it a few times, and everytime the VM could not boot. Perhaps some virtio driver might have prevented it from booting. After some googling, I was able to fix it.
The Windows VM does not have any special application. I have iTunes and Futu and nothing else on the VM. On the hypervisor, the VM is using these settings with tpm passthru.
I tried to install the 22H2 update 5-6 times over a course of 5-6 months. I was hoping a newer update can solve the problem but it never worked. Then I came across a suggestion from reddit.
Run virsh edit win11
to edit the VM’s setting. Look for
<type arch='x86_64' machine='pc-q35-6.0'>hvm</type>
and change it to <type arch='x86_64' machine='pc-q35-7.2'>hvm</type>
VernoxVernax suggested pc-q35-8.0
in that reddit post but it was not supported by my machine.
❯ qemu-system-x86_64 -machine ? | egrep 'q35-[678]'
q35 Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-7.2)
pc-q35-7.2 Standard PC (Q35 + ICH9, 2009)
pc-q35-7.1 Standard PC (Q35 + ICH9, 2009)
pc-q35-7.0 Standard PC (Q35 + ICH9, 2009)
pc-q35-6.2 Standard PC (Q35 + ICH9, 2009)
pc-q35-6.1 Standard PC (Q35 + ICH9, 2009)
pc-q35-6.0 Standard PC (Q35 + ICH9, 2009)
So I tried 7.
2 and it works.
When finished, start the VM and run Windows update. Magically, after some 30 minutes of waiting and a few reboots, the update is successfully installed!
If you have a similar problem, I hope this post helps.