What do we need to do for successful passthru now on beta8?


Recommended Posts

I was reviewing peter_sm's post on passthru for a Windows 8 machine, and I'm not sure how much of that still needs done, and what's been 'fixed' with the latest beta.

 

I know jonp has spent LOTS of time on virtual machines, and getting passthru to work in various guises, but I'm not sure what steps are still required for us to do.

 

Can we get a step-by-step for getting a windows (7 or 8) VM running with passthru?

 

I need to passthru a TV tuner card, keyboard, mouse and GPU so I can run my media player on the server.

 

I currently have a windows 7 VM running under KVM, without any passthru, from the beta6, but I either need to get passthru working, or re-arrange hardware again to re-build my old HTPC, which I'd prefer not to have to do.

 

Thanks in advance for any help with this.

Link to comment
  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I am hoping to test pass thru on a Windows 8 KVM in the next couple of days. I have been connecting via VNC to my ubuntu kvm and using virt-manager to setup a windows 8 kvm. It is sort of a round about way to get this going but I really like how easy virt-manager makes it to pass thru anything. I currently have the windows 8 vm running but I haven't had a chance to play with passing thru the graphics yet.

Link to comment

Working on making this a lot easier.

 

Good to hear, thanks!

 

I am hoping to test pass thru on a Windows 8 KVM in the next couple of days... I currently have the windows 8 vm running but I haven't had a chance to play with passing thru the graphics yet.

 

Also good to know.  I have a windows7 VM running also, and had messed with passthru, until my video card died and jonp said nVidia wouldn't work with beta6, and now I've forgotten most of what I'd done, so I look forward to your feedback on your efforts.  Maybe we can get it working in win7 and 8 :)

Link to comment

A quick test with virt-manager.

I created a W8 VM and passing trough a USB hub (for mouse & Keyboard) and a GPU

 

It don't use VFIO! instead this defines all passtrough with hostdev

 

 

After machine have been defined ,the PCI devices belong to vfio-pci

below are the 3 devices that I am set to passtrough.

00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
04:00.0 VGA compatible controller: AMD/ATI [Advanced Micro Devices, Inc.] Cedar [Radeon HD 5000/6000/7350 Series]
04:00.1 Audio device: AMD/ATI [Advanced Micro Devices, Inc.] Cedar HDMI Audio [Radeon HD 5400/6300 Series]

 

I'm not using vfio-bind or pci-stup for these PCI devices.

 

 

Below is the code for the machine using hostdev (passtrough)

 

is not using g35 as machine, don't know if this is an issue for performance??


 

I needed to add this to the xml file to get everything to work

 

 <graphics type='vnc' port='5900' autoport='yes' listen='192.168.0.190' keymap='sv'>
      <listen type='address' address='192.168.0.190'/>
    </graphics>

 

I also changed settings for CPU

Link to comment

Ok so I was successfully able to get my ATI card passed through with virt-manager. (Note: I didn't have to do any thing with vfio-bind or pci-stup or mess with the boot options in the syslinux.cfg either) I just selected the graphics card with virt-manager and it worked! I then installed a Nvidia card and followed the same steps but the driver wouldn't install. I believe @jonp stated that this is because we are using an updated libvirt file that doesn't have the latest nvidia patches. Hopefully the next unRAID beta comes with the added flags to make virt-manager work. I could try and mess around some more with Nvidia but my ATI card is working now and I really don't feel like messing with it when I know the next beta should resolve the issues  8)

Link to comment

A quick test with virt-manager.

I created a W8 VM and passing trough a USB hub (for mouse & Keyboard) and a GPU

 

@peter_sm, when you pass through the usb hub and boot into Windows 8, can you then stick in a usb drive and windows 8 load it? or do you have to shutdown the windows 8 vm and turn it back on to get the usb drive to show up?

Link to comment

can you post your xml?

 

//Peter

 

Here is what virt-manager created for my windows 8 VM (Note: I am passing through ATI card and USB mouse)

 

<domain type='kvm' id='4'>
  <name>windows8</name>
  <uuid>47244075-c4f4-dfde-0d31-6e712b024dea</uuid>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.1'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>SandyBridge</model>
    <vendor>Intel</vendor>
    <feature policy='require' name='vme'/>
    <feature policy='require' name='dtes64'/>
    <feature policy='require' name='vmx'/>
    <feature policy='require' name='erms'/>
    <feature policy='require' name='xtpr'/>
    <feature policy='require' name='smep'/>
    <feature policy='require' name='pcid'/>
    <feature policy='require' name='est'/>
    <feature policy='require' name='monitor'/>
    <feature policy='require' name='smx'/>
    <feature policy='require' name='tm'/>
    <feature policy='require' name='acpi'/>
    <feature policy='require' name='osxsave'/>
    <feature policy='require' name='ht'/>
    <feature policy='require' name='pdcm'/>
    <feature policy='require' name='fsgsbase'/>
    <feature policy='require' name='f16c'/>
    <feature policy='require' name='ds'/>
    <feature policy='require' name='invtsc'/>
    <feature policy='require' name='tm2'/>
    <feature policy='require' name='ss'/>
    <feature policy='require' name='pbe'/>
    <feature policy='require' name='ds_cpl'/>
    <feature policy='require' name='rdrand'/>
  </cpu>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/vmdisk/vm_images/default/windows8.img'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/vmdisk/vm_images/windows7/virtio-win-0.1-81.iso'/>
      <backingStore/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='fdc' index='0'>
      <alias name='fdc0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:00:00:04'/>
      <source bridge='br0'/>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5904' autoport='no' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='vga' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x046d'/>
        <product id='0xc51b'/>
        <address bus='3' device='3'/>
      </source>
      <alias name='hostdev0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Link to comment

 

 

@peter_sm, when you pass through the usb hub and boot into Windows 8, can you then stick in a usb drive and windows 8 load it? or do you have to shutdown the windows 8 vm and turn it back on to get the usb drive to show up?

 

I have not tested that, can do it later ( tomorrow), now it's evening and time fore some beers .......

 

//Peter

Link to comment

 

 

@peter_sm, when you pass through the usb hub and boot into Windows 8, can you then stick in a usb drive and windows 8 load it? or do you have to shutdown the windows 8 vm and turn it back on to get the usb drive to show up?

 

I have not tested that, can do it later ( tomorrow), now it's evening and time fore some beers .......

 

//Peter

 

Agreed! I am actually headed off to do the same.

Link to comment

Ok so I was successfully able to get my ATI card passed through with virt-manager. (Note: I didn't have to do any thing with vfio-bind or pci-stup or mess with the boot options in the syslinux.cfg either) I just selected the graphics card with virt-manager and it worked! I then installed a Nvidia card and followed the same steps but the driver wouldn't install. I believe @jonp stated that this is because we are using an updated libvirt file that doesn't have the latest nvidia patches. Hopefully the next unRAID beta comes with the added flags to make virt-manager work. I could try and mess around some more with Nvidia but my ATI card is working now and I really don't feel like messing with it when I know the next beta should resolve the issues  8)

 

beta8 has all the patches you need.  what is not working?

Link to comment

Ok so I was successfully able to get my ATI card passed through with virt-manager. (Note: I didn't have to do any thing with vfio-bind or pci-stup or mess with the boot options in the syslinux.cfg either) I just selected the graphics card with virt-manager and it worked! I then installed a Nvidia card and followed the same steps but the driver wouldn't install. I believe @jonp stated that this is because we are using an updated libvirt file that doesn't have the latest nvidia patches. Hopefully the next unRAID beta comes with the added flags to make virt-manager work. I could try and mess around some more with Nvidia but my ATI card is working now and I really don't feel like messing with it when I know the next beta should resolve the issues  8)

 

beta8 has all the patches you need.  what is not working?

 

Nvidia passthrough is not working. I thought you had mentioned that because we are using a different libvirt than stock unRAID the Nvidia patches might not be included anymore?

Link to comment

I think archedraft is using the plugin you mentioned, WebVirtMgr, by dmacias, and from what I read, it works by changing/replacing the libvirt file, which is why (I suspect) nVidia isn't working with his Windows setup, as the file they are using is not the one you patched to get nVidia working.

 

That's just a guess, as I don't fully understand it all myself yet, as I've not installed that plugin.

 

With all that said, archedraft, my understanding is that the WebVirtMgr basically just 'helps' you get the VM setup and running.  If so, can you use the xml and settings it created someplace, remove the plugin, then just install/start the VM without the plugin, to use the default patched vibvirt file and see if that works?

 

Maybe that makes no sense or won't work, but it seems like it might/should.

Link to comment

I think archedraft is using the plugin you mentioned, WebVirtMgr, by dmacias, and from what I read, it works by changing/replacing the libvirt file, which is why (I suspect) nVidia isn't working with his Windows setup, as the file they are using is not the one you patched to get nVidia working.

Yes exactly what I was trying to say.

 

With all that said, archedraft, my understanding is that the WebVirtMgr basically just 'helps' you get the VM setup and running.  If so, can you use the xml and settings it created someplace, remove the plugin, then just install/start the VM without the plugin, to use the default patched vibvirt file and see if that works?

That was my thought as well, which I briefly tried yesterday. I used virt-manager to create the XML file and included the nvidia gpu to passthrough. Then I removed the plugin and rebooted. I attempted to start the kvm but it gave an error. I decided not to mess around with it anymore though and just put the ati card back in. I bet you could probably get it working though if you had the time to mess around with the XML file.

Link to comment

That was my thought as well, which I briefly tried yesterday. I used virt-manager to create the XML file and included the nvidia gpu to passthrough. Then I removed the plugin and rebooted. I attempted to start the kvm but it gave an error. I decided not to mess around with it anymore though and just put the ati card back in. I bet you could probably get it working though if you had the time to mess around with the XML file.

 

I'm not sure I'll have time to try this today, but if you could share your XML file, it might be a good start for me when I do find the time to work on this.

 

Hopefully, when I do find the time, I'll remember well enough what I did a couple months ago, that I can get my current, working, windows7 VM to work, since it's all patched, and has some important programs already configured.  (I don't want to have to start from scratch again).

 

I also have a windows8 VM setup, but I think it got 'broke' with beta6, and I've not touched it again since then.

Link to comment

I'd just like to report that I have a Windows 8.1 VM up and running under KVM with USB and my Radeon R9 GPU passed through. I also passed through a SATA controller as well so I could install directly to an SSD for better performance. Lot of bumps along the way but thanks to everyone here for the hand holding. Quick question can we autostart our docker images now in beta8 without interfering with vfio-bind or do we still have to start them manually?

 

Had to add this line to my Syslinux File

 

  append intel_iommu=on vfio_iommu_type1.allow_unsafe_interrupts=1 pcie_acs_override=downstream initrd=/bzroot

 

XML Config file below if anyone is interested.

 

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>windows8</name>
  <uuid>cc411d70-4463-4db7-bf36-d364c0cdaa9d</uuid>
  <memory unit='GB'>8</memory>
  <currentMemory unit='GB'>8</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='q35'>hvm</type>
    <boot dev='cdrom'/>
  </os>
<features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough'>
  </cpu>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    
     
 <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/cache/en_windows_8.1_with_update_x64_dvd_4065090.iso'/>
      <target dev='sdc' bus='sata'/>
      <readonly/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/cache/virtio-win-0.1-81.iso'/>
      <target dev='sdd' bus='sata'/>
      <readonly/>
    </disk>
    
    <controller type='sata' index='0'>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
    </controller>
    <controller type='usb' index='0' model='none'>
    </controller>
    <interface type='bridge'>
      <source bridge='br0'/>
      <mac address='02:16:3e:1a:b3:4a'/>
      <model type='virtio'/>
    </interface>
    
    
    <input type='mouse' bus='ps2'/>
    <memballoon model='virtio'/>
    
  </devices>
  
  <qemu:commandline>
  
<qemu:env name='QEMU_AUDIO_DRV' value='alsa'/>

    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>

<!--AMD Radeon R270X GPU-->   
    <qemu:arg value='-device'/>
  <qemu:arg value='vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>

<!--Radeon HDMI AUDIO-->  
    <qemu:arg value='-device'/>
      <qemu:arg value='vfio-pci,host=02:00.1,bus=pcie.0'/>

     
<!--ASROCK SATA Controller-->     
   <qemu:arg value='-device'/>
     <qemu:arg value='vfio-pci,host=0a:00.0,bus=pcie.0'/>
     
<!--USB Controller-->    
        <qemu:arg value='-device'/>
     <qemu:arg value='vfio-pci,host=00:14.0,bus=pcie.0'/>
          
     
  </qemu:commandline>

</domain>

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.