Passthrough Config Successes (& Failures)


CHBMB

Recommended Posts

Passthrough seems to be the hot topic on the board at the moment, I for one, am grateful for the help.

 

Does anyone else think it's worth posting success +/- failures in this thread as a reference for others.  Personally I find it much easier to persevere with something once I know it is possible, I know hardware configs will vary a lot, but at least it forms a basis.  If anyone else can think of any relevant info to include then feel free.

 

At the moment it seems Graphics adapters and TV-Tuners are the two main groups and there isn't a great deal of information out there.

 

I'll start:

  • Motherboard: Asrock H77 Pro4-M
  • CPU: Core i5-3470S
  • Device: TBS 6285 DVB-T2 Quad Tuner
  • OS: WHS2011 & Windows 7
  • Machine: Q35 (Both OS')
  • Notes: Succesfully passing through Live TV using Argus TV

 

 

Link to comment
  • 3 weeks later...

I have been working at this every chance I can and I finally have passthrough working(ish) and can replicate it but windows is still very slow for me  ,

here is my system and steps that I took to get it going:

 

my setup :

 

unraid versions 6b12-14b

  • motherboard : ASRock Fatal1ty 990FX Killer, with IOMMU enabled
  • cpu: fx8350
  • ram:16GB trident x ddr3 2400
  • passthrough gpu:msi 660 twin frozr for passthrough
  • unraid gpu: geforce 210
  • windows 8.1 and windows 10 both with msi 660 twin frozr for passthrough
  • q35
  • 4 vCPU and 8192 (8gb) RAM for both

 

my device list from tools>system devices in unraid webgui :

color coding doesnt work in code I guess so I spaced the relevant video card that im passing through

 

00:00.0 Host bridge: AMD/ATI [Advanced Micro Devices, Inc.] RD890 PCI to PCI bridge (external gfx0 port B) (rev 02)
00:00.2 IOMMU: AMD/ATI [Advanced Micro Devices, Inc.] RD990 I/O Memory Management Unit (IOMMU)
00:02.0 PCI bridge: AMD/ATI [Advanced Micro Devices, Inc.] RD890 PCI to PCI bridge (PCI express gpp port B)
00:09.0 PCI bridge: AMD/ATI [Advanced Micro Devices, Inc.] RD890 PCI to PCI bridge (PCI express gpp port H)
00:0a.0 PCI bridge: AMD/ATI [Advanced Micro Devices, Inc.] RD890 PCI to PCI bridge (external gfx1 port A)
00:0b.0 PCI bridge: AMD/ATI [Advanced Micro Devices, Inc.] RD890 PCI to PCI bridge (NB-SB link)
00:0d.0 PCI bridge: AMD/ATI [Advanced Micro Devices, Inc.] RD890 PCI to PCI bridge (external gfx1 port B)
00:11.0 SATA controller: AMD/ATI [Advanced Micro Devices, Inc.] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (rev 40)
00:12.0 USB controller: AMD/ATI [Advanced Micro Devices, Inc.] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.2 USB controller: AMD/ATI [Advanced Micro Devices, Inc.] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: AMD/ATI [Advanced Micro Devices, Inc.] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.2 USB controller: AMD/ATI [Advanced Micro Devices, Inc.] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:14.0 SMBus: AMD/ATI [Advanced Micro Devices, Inc.] SBx00 SMBus Controller (rev 42)
00:14.2 Audio device: AMD/ATI [Advanced Micro Devices, Inc.] SBx00 Azalia (Intel HDA) (rev 40)
00:14.3 ISA bridge: AMD/ATI [Advanced Micro Devices, Inc.] SB7x0/SB8x0/SB9x0 LPC host controller (rev 40)
00:14.4 PCI bridge: AMD/ATI [Advanced Micro Devices, Inc.] SBx00 PCI to PCI Bridge (rev 40)
00:14.5 USB controller: AMD/ATI [Advanced Micro Devices, Inc.] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
00:16.0 USB controller: AMD/ATI [Advanced Micro Devices, Inc.] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:16.2 USB controller: AMD/ATI [Advanced Micro Devices, Inc.] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:18.0 Host bridge: AMD [Advanced Micro Devices, Inc.] Family 15h Processor Function 0
00:18.1 Host bridge: AMD [Advanced Micro Devices, Inc.] Family 15h Processor Function 1
00:18.2 Host bridge: AMD [Advanced Micro Devices, Inc.] Family 15h Processor Function 2
00:18.3 Host bridge: AMD [Advanced Micro Devices, Inc.] Family 15h Processor Function 3
00:18.4 Host bridge: AMD [Advanced Micro Devices, Inc.] Family 15h Processor Function 4
00:18.5 Host bridge: AMD [Advanced Micro Devices, Inc.] Family 15h Processor Function 5
01:00.0 VGA compatible controller: NVIDIA Corporation GT218 [GeForce 210] (rev a2)
01:00.1 Audio device: NVIDIA Corporation High Definition Audio Controller (rev a1)
02:00.0 USB controller: Etron Technology, Inc. EJ188/EJ198 USB 3.0 Host Controller
03:00.0 Ethernet controller: Qualcomm Atheros Killer E2200 Gigabit Ethernet Controller (rev 10)


04:00.0 VGA compatible controller: NVIDIA Corporation GK106 [GeForce GTX 660] (rev a1)
04:00.1 Audio device: NVIDIA Corporation Device 0e0b (rev a1)


05:00.0 PCI bridge: Integrated Device Technology, Inc. [iDT] PES12N3A PCI Express Switch (rev 04)
06:00.0 PCI bridge: Integrated Device Technology, Inc. [iDT] PES12N3A PCI Express Switch (rev 04)
06:01.0 PCI bridge: Integrated Device Technology, Inc. [iDT] PES12N3A PCI Express Switch (rev 04)
07:00.0 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (Copper) (rev 06)
07:00.1 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (Copper) (rev 06)
08:00.0 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (Copper) (rev 06)
08:00.1 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (Copper) (rev 06)

 

#1.  add:   

pcie_acs_override=downstream

      to syslinux.cfg 

 

#2.  replace:

 

<vcpu placement='static'>4</vcpu>
  <os>
    <type arch='x86_64' machine='pc-q35-2.1'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>

 

 

with:

 

 

 

<memoryBacking>
      <nosharepages/>
      <locked/>
   </memoryBacking>
   <vcpu placement='static'>4</vcpu>
      <cputune>
         <vcpupin vcpu='0' cpuset='0'/>
         <vcpupin vcpu='1' cpuset='1'/>
         <vcpupin vcpu='2' cpuset='2'/>
         <vcpupin vcpu='3' cpuset='3'/>
      </cputune>
    <os>
      <type arch='x86_64' machine='pc-q35-2.1'>hvm</type>
      <boot dev='cdrom'/>
      <bootmenu enable='no'/>
    </os>
   <features>
      <acpi/>
      <apic/>
   </features>
   <cpu mode='host-passthrough'>
      <topology sockets='2' cores='2' threads='1'/>
   </cpu>

 

still boots fine in vnc

 

 

 

#3.  add:

 

<driver name='qemu' type='qcow2' cache='none' io='native'/>

 

between :

 

<disk type='file' device='disk'>
      
      <source file='/mnt/cache/kvm/vms/windows 10/windows 10.qcow2'/>

still boots in vnc and performance seems improved.

 

 

#4.  add:

 

<qemu:commandline>
      <qemu:arg value='-device'/>
      <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
      <qemu:arg value='-device'/>
      <qemu:arg value='vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
      <qemu:arg value='-device'/>
      <qemu:arg value='vfio-pci,host=04:00.1,bus=pcie.0'/>/>
   </qemu:commandline> 

 

between </devices> and </domain>

 

 

 

get this error:

 

Warning: libvirt_domain_create(): internal error: early end of file from monitor: possible problem: 2015-02-28T00:29:13.839414Z qemu-system-x86_64: -device vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio: error opening /dev/vfio/18: No such file or directory 2015-02-28T00:29:13.839447Z qemu-system-x86_64: -device vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio: failed to get group 18 2015-02-28T00:29:13.839459Z qemu-system-x86_64: -device vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: Device initialization failed. 2015-02-28T00:29:13.839475Z qemu-system-x86_64: -device vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: Device 'vfio-pci' could not be initialized in /usr/local/emhttp/plugins/dynamix.kvm.manager/classes/libvirt.php on line 838

 

 

 

#5. run:

 

 vfio-bind 0000:04:00.0 0000:04:00.1

    via command line

 

 

black screen in vnc and  mouse not in sync (passthrough may have been working at this point)

 

had to force shutdown

 

#6.  reboot server

 

#7. run

vfio-bind 0000:04:00.0 0000:04:00.1

via command line

 

 

start windows 10 kvm and wants new windows install :( (good thing i backed it up to another folder)

 

paste backup into vms folder.

 

 

 

#8. remove :

 

<graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='vmvga' vram='16384' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>

 

#10.  success working passthrough  :D

 

 

 

#11.  add:

/usr/local/sbin/vfio-bind 0000:04:00.0 0000:04:00.1 

 

to go file

 

 

#12. add mouse :

 

<hostdev mode='subsystem' type='usb'>
      <source>
         <vendor id='0x046d'/>
         <product id='0xc018'/>
      </source>
   </hostdev>

 

#13.  reboot server

 

 

#14. success !!!!  passthrough working with mouse but wants to reinstall windows again windows repair says disk is locked

 

 

#15.  copy fully updated vm from back ups and start vm and it worked: passthrough with fully updated windows 10 and mouse working but...  very sluggish.

 

#16. to be continued ...

 

 

my current xml after all tweaks:

 

 

<domain type='kvm' id='4' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>windows 10</name>
  <uuid>f564e480-bfca-7981-ec4c-8f74268ec9cf</uuid>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <memoryBacking>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='1'/>
    <vcpupin vcpu='2' cpuset='2'/>
    <vcpupin vcpu='3' cpuset='3'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-2.1'>hvm</type>
    <boot dev='cdrom'/>
    <bootmenu enable='no'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='2' cores='2' threads='1'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <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='qcow2' cache='none' io='native'/>
      <source file='/mnt/cache/kvm/vms/windows 10/windows 10.qcow2'/>
      <backingStore/>
      <target dev='hda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/cache/kvm/isos/Windows10_TechnicalPreview_x64_EN-US_9926.iso'/>
      <backingStore/>
      <target dev='hdc' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <alias name='usb0'/>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='sata0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:26:b0:57'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
    </input>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x046d'/>
        <product id='0xc018'/>
        <address bus='6' device='2'/>
      </source>
      <alias name='hostdev0'/>
    </hostdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
    </memballoon>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=04:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=04:00.1,bus=pcie.0'/>
  </qemu:commandline>
</domain>

Link to comment

I've got 2 hp 54's and i was looking to repurpose one of them as a secondary smaller unraid.

 

one is running as a tv server and the other as a pfsense firewall.

 

I'm a bit leery about vm'ing the pfsense though.

 

And passthrough on the microservers doesn't seem to be an option, so it's back to the thinking stage.

 

 

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.