Windows 10 VM Video Card Passthrough Questions


Endy

Recommended Posts

Thanks to some help from the people here, I was able to get a fresh Windows 10 VM install working great. Video card passthrough is working just fine.

 

What I was trying to do was to take the Windows 10 install from my main pc (the components of which are now being used for Unraid) and convert that to a VM.

 

I have it converted to a VM and it works with VNC, but when I add in the video card to the mix nothing is getting sent to the monitor.

 

Initially I had created the VM using Seabios, but that got stuck at "Booting from hard disk" so I recreated the VM using OVMF. That got the VM working, but like I said, not when trying to use a video card. I tried enabling the pcie ACS override, but that didn't work either. (Apparently I still don't understand the IOMMU groups that well, because it seems to be unnecessary anyways.)

 

That's when I created the fresh Windows 10 VM install. I used Seabios to see if that made a difference and sure enough, it worked.

 

Does this mean that I am out of luck trying to get my old Windows 10 install working or is there something else I can do?

 

I just upgraded to Unraid 6.3.0 and I noticed that it now gives the option to use the onboard Intel video. I'm currently using the onboard video for the Unraid GUI and the GTX 660 for VM's. If I can't get the GTX 660 working, can I swap and get Unraid to use the GTX 660 and the VM's to use the Intel onboard video and would that make a difference?

 

I'll include the VM XML and if there's anything else that's needed just let me know. (And yes, I know I am running the VM on the array... I don't have the space on the cache drive for the image. I have another SSD that is the disk that the original Windows 10 install is on that I will use to store the VM later.)

 

<domain type='kvm'>
  <name>Windows 10</name>
  <uuid>ea4e5277-c3eb-6c0f-e95c-60c5e2e86838</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
  <vcpu placement='static'>2</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='2'/>
    <vcpupin vcpu='1' cpuset='3'/>
  </cputune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/ea4e5277-c3eb-6c0f-e95c-60c5e2e86838_VARS-pure-efi.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='2' threads='1'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/Data/ISO/virtio-win-0.1.130.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/mnt/disk1/Data/Windows 10/vdisk1.img'/>
      <target dev='hdc' bus='ide'/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='nec-xhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:6a:ab:e7'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='4'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x046d'/>
        <product id='0xc313'/>
      </source>
      <address type='usb' bus='0' port='1'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x04d9'/>
        <product id='0xfa50'/>
      </source>
      <address type='usb' bus='0' port='2'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x1130'/>
        <product id='0x1620'/>
      </source>
      <address type='usb' bus='0' port='3'/>
    </hostdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

Note: I am doing a lot of this as a test and provided this all goes well, I will be updating some of the hardware, but I just can't do that for another month or two at least.

Link to comment

hi Endy

 

i'm trying to follow through your email (several times, since i saw it's without response), but either i'm tired or i cannot understand properly what are you trying to do... :)

 

To summarize my understanding, you are trying to avoid fresh installation of the Windows 10 in a VM, so that you can use your previous physical installation by converting it. And you reached a dead end since your converted [vdisk] does not work with seabios, only with ovmf. But still, only with VNC, and no GPU passthrough. But then you say it works with seabios as fresh install in VM - so passthrough of GPU works without any issue?

 

 

When you say "convert to a VM" - you mean... the disk that was used by the physical installation you are trying to convert it to a vdisk?

How are you doing that?

Are you preparing the physical windows installation in some way, for this conversion to happen?

I'm asking because as per my understanding, there is a special process to follow when converting it. Not sure if it's still relevant, i assume it is:

http://lime-technology.com/wiki/index.php/UnRAID_6/VM_Management#Physical_to_Virtual_Machine_Conversion

 

 

I just upgraded to Unraid 6.3.0 and I noticed that it now gives the option to use the onboard Intel video. I'm currently using the onboard video for the Unraid GUI and the GTX 660 for VM's. If I can't get the GTX 660 working, can I swap and get Unraid to use the GTX 660 and the VM's to use the Intel onboard video and would that make a difference?

 

some motherboards allow selection of primary GPU from BIOS. Some added this feature in newer bios firmware updates. YMMV

 

not sure if it helps, but your GTX 660 might require to specify the rom in the VM xml (that was the case with my 550ti).

For this, you need to have this rom as a file in the array so that unraid can read it and use it during boot of VM (so you need to dump it yourself, using the guides in this forum, or to obrain it from some place - techpowerup - again, ymmv in terms of compatibility).

Also try to put the 660 in second slot. Mine didn't work at all to do passthrough in first slot (closest to the GPU) even after rom was used.

 

-d

Link to comment

hi Endy

 

i'm trying to follow through your email (several times, since i saw it's without response), but either i'm tired or i cannot understand properly what are you trying to do... :)

 

To summarize my understanding, you are trying to avoid fresh installation of the Windows 10 in a VM, so that you can use your previous physical installation by converting it. And you reached a dead end since your converted [vdisk] does not work with seabios, only with ovmf. But still, only with VNC, and no GPU passthrough. But then you say it works with seabios as fresh install in VM - so passthrough of GPU works without any issue?

 

Thanks for replying. I was saying that it does NOT work with OVMF. My converted vdisk (yes, I had followed the guide you linked to and created the vdisk image from a physical disk) would only work as OVMF, but passthrough only works with Seabios. So I could have a fresh install with Seabios and passthrough works, or I could have my old install with OVMF and passthrough doesn't work.

 

I just upgraded to Unraid 6.3.0 and I noticed that it now gives the option to use the onboard Intel video. I'm currently using the onboard video for the Unraid GUI and the GTX 660 for VM's. If I can't get the GTX 660 working, can I swap and get Unraid to use the GTX 660 and the VM's to use the Intel onboard video and would that make a difference?

 

some motherboards allow selection of primary GPU from BIOS. Some added this feature in newer bios firmware updates. YMMV

 

not sure if it helps, but your GTX 660 might require to specify the rom in the VM xml (that was the case with my 550ti).

For this, you need to have this rom as a file in the array so that unraid can read it and use it during boot of VM (so you need to dump it yourself, using the guides in this forum, or to obrain it from some place - techpowerup - again, ymmv in terms of compatibility).

Also try to put the 660 in second slot. Mine didn't work at all to do passthrough in first slot (closest to the GPU) even after rom was used.

 

-d

 

In the bios I can select to use the onboard video for primary or not.

 

I thought the rom was only needed if there was just 1 video source in the system and you were trying to pass it through?

 

There is no room to move the video card to the second slot. (Or the 3rd, for that matter.) There was a bit of a struggle to get enough room to put it in the first slot.

 

At this point, it's mostly academic. I needed to get something up and running, so I went ahead and created a new VM and did a fresh install and am in the process of getting it all set up. I do still have the other VM and I wouldn't mind trying to get it working just for the sake of figuring it out.

Link to comment

ok, now i got you... but not sure i can help further

 

regarding the rom, it's required if you want to pass through the primary nvidia gpu. it could be the only GPU in the system, or maybe you have additional GPU's...

but without the rom, you cannot make it passthrou. my understanding is that AMD gpu's work to passthrough in first slot without rom.

but never tried.

Link to comment

Gotcha. So right now, the onboard video is the primary and that's why I didn't need to get the rom to get it working so far. If I were to switch the Nvidia to be the primary, then I would need to get the rom.

 

I've read something about if a video card doesn't have uefi support that it wouldn't work with ovmf, and my card is an older one so that could be it. I didn't find a lot of information about that, so I'm not confidant in that info at the moment.

 

I may be able to pick up a new video card sooner than I thought and at that time I'll probably do some more playing around.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.