Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Francesco149/dc156cfd9ecfc3659469315c45fa0f96 to your computer and use it in GitHub Desktop.
Save Francesco149/dc156cfd9ecfc3659469315c45fa0f96 to your computer and use it in GitHub Desktop.

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

@Djrfatjf
Copy link

I’m so freaking dumb, how am I add the iso to my qemu/virt manager config as a cd/dvd drive?

@PlayF0R3v3R
Copy link

I’m so freaking dumb, how am I add the iso to my qemu/virt manager config as a cd/dvd drive?

Add hardware - Storage - Device type: CDROM - Select or create custom storage: find your .iso by "browse local"

@Fuckingnameless
Copy link

i cant even use diskpart or chkdsk there are no disks listed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment