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
Thank you. One note
loaddrv
has to bedrvload