scenario: you have a windows vm failing to boot with INACCESSIBLE_BOOT_DEVICE
and changing the
disk type to ide or something else causes another bsod. how to you get it to boot up again without
a physical machine?
download the stable virtio drivers from here, in iso form: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
add the iso to your qemu/virt manager config as a cd/dvd drive
windows should send you to the recovery mode screen, but if it doesn't you might have to run a windows install iso to get to it.
now open a command prompt from the recovery mode and do
loaddrv D:\viostor\w10\amd64\viostor.inf
dism /image:c:\ /add-driver /driver:d:\viostor\w10\amd64\viostor.inf
close the prompt and try to boot. if that still fails, you might need to rebuild the BCD (this happened in my case). so go back to recovery mode, open a cmd prompt and do:
loaddrv D:\viostor\w10\amd64\viostor.inf
bcdboot C:\Windows
you should be able to boot the vm now
in my case, I was converting a raw disk image from a physical install to a virtual machine, and this is what I had to do to get it to boot on qemu + ovmf
Thanks! Helped me a lot.
If you get an error while trying to execute above commands, check your disk letter assignments. You can use diskpart for this to check it and correct it. Just ensure your main partition is on C or adjust the commands with the right letters.
Also be careful with that
bcdboot
command and don't run it if not needed and uncertain of how it works. The boot files could be elsewhere and if they are not on C this creates additional boot files and that might mess up your overall installation but that really depends on what your doing. Just a warning as I spend quite some hours messing with boot files in the past, can't say it was a joyful time. (Win10+Win11 dual boot related)p.s. I use shortcuts in the above command line example, you can execute both
lis dis
andlist disk
or for example executesel vol
instead ofselect volume
.