PCI Passthrough QEMU/KVM Virtual Machine Help

I am trying to get my new Skylake system (running Fedora 23) to pass a GTX970 through to a Windows 7 VM. I have been following the guide @wendell made as well as the one here: http://vfio.blogspot.com/2015/05/vfio-gpu-how-to-series-part-4-our-first.html

I got all the way to the end, where it's actually time to boot the VM. Except I am stuck at the EFI Shell. I can't figure out how to get it to boot. All I get is the Shell> prompt, and I can't figure out how to get to the bootx64.efi. I have a list of BLK devices (BLK1 through BLK5), but I am not sure what to do with them.

Anyone have any suggestions?

1 Like

Did you make sure to add the Windows disk image as an IDE device? If I remember correctly Windows 7 either does not work or is very difficult to get working with OVMF EFI involving building your own ISO image. Do you have Windows 8 or 10 you can try? Even if you don't want to go ahead with the install, it may help you narrow down the issue.

Another option is to not use UEFI.

If you mean making sure the Windows install disk is IDE, then yes. The Windows install ISO is an IDE CDROM. The VirtIO drivers ISO is also an IDE CDROM.

The main 'disk' that I am going to install Windows to is a VirtIO disk, but I just tried changing it to both SATA and IDE, and neither helped.

I think my problem is not knowing how to use the EFI Shell. No matter how much I read about it, nothing seems to work. Which makes me think something is messed up in my config, but I don't know what.

This is all I get after starting the VM, which doesn't match what the guy in the tutorial had:

I'm pretty sure there should be a fs0, fs1, etc in the list as in the VFIO blog example, if setup correctly. The EFI bootable files either do not exist on the the install media or is not accessible for one reason or another.

FYI if you haven't already seen it, part 5 of the guide is an example using Windows 7:

1 Like

I just tried using Windows 8.1, and was able to boot directly to the install disk. So it is something with Windows 7. I really need to use 7, as I have (a few) keys for it and none for Windows 8/8.1.

It could very well be something wrong with my Windows 7 install disk, I made it from my original media in 2009. I made it so it gave you the option to install whichever version you wanted. I have no idea why I don't get the fs0, fs1 options.

Disappointingly I do not have the option to add my video card to the VM anyway, so I didn't get the passthrough right.

Still, I'd like to figure out how to get Windows 7 installed before going through the entire passthrough setup process again.

Unless UEFI is a requirement for you, I suggest trying part 5 of guide I linked above. It specifically addresses issues with Windows 7 and OVMF.

I will check out the next part of the guide and see if I can get Windows 7 working. If not I'll use Windows 8 and get a key.

Thank you very much for your help.

When I set up my system I tried all the tricks to get UEFI to work but failed, I've never figured out what it was but something just wasn't UEFI compatible, although I did get the pass through to work using the simplest method of just isolating the card using pci-stub, I've since added several other devices to my KVM passed through using the same method and it has worked out fine....BTW I'm using Fedora and running Win 7 in the KVM.

I actually just figured out that the passthrough did work, and I added the card to the windows 8.1 VM. Now I have to figure out how to get the card working inside Windows 8.1.

I am installing drivers and setting things up right now. Hopefully this works, but so far I don't get any video output from the card.

Do you get video from the default video driver in windows, should get a desktop in your vert-manager/QEMU console.

I get the desktop in the console:

But when I switch the monitor to displayport (which is what the passedthrough video card is connected to) I get nothing.

You won't until you install drivers and enable the card, you've crossed a big hurdle getting this far, after installing the drivers either through device manager or just Dling them with your browser you will have to reboot windows , on my system sometimes I have to force it off to get a clean reboot but anyway once you do that and the card is enabled you will get video output on your screen.....

Just installed the nvidia drivers, shut down the VM, shut down virt-manager, then started everything back up. Still not getting video on the monitor connected to the video card.

Do I have to remove the display and video hardware in the virtual machine setup?

No you did not need to shut down virt-manager only stop the KVM, you need to look and see if Windows has the card enabled....

You did do this.....correct? VVVVVV

"If you're using Nvidia also add the KVM hidden section to features, removing the
Hyper-V section and disable the Hyper-V clock source"

Both display adapters are enabled:

Do I need to disable the Microsoft Basic Display Adapter?

According to your pic the Nvidia has the yellow caution sign...it isn't enabled. right click on it and read what it sez.

Code 43. This is where the driver won't load because it sees it's in a VM. Damn. Now I have to edit the xml file.

1 Like

LOL.....Nvidia strikes again, you'll have to fool the drivers into thinking it's a bare metal install, this is the reason that a AMD GPU is preferred to pass through....

Yeah, I probably should have got an AMD card. But I got a real good deal on this 970, so that's what I got.

Further down in part 4 of the guide he explains how to get around this problem, so I am going to try that.

Good, don't give up you'll get it..... I got to this point when I started and just bought a 270x since the Nvidia card I was testing with was a old GTX550 and I wanted something a little better to game on.