***GUIDE*** Passthrough Entire PCI USB Controller


archedraft

Recommended Posts

Hello. As a new user without previous Linux experience this problem comes little hard. Could it be possible to do this in (web)GUI in xml-editor?

 

I have Rampage IV BE as mobo and in addition seperate usb3 pcie card. Id like to dedicate pcie-card (2 ports+ 2ports in front) to one VM and few ports to second VM.

 

Could it be possible to find number of usb controllers in GUI and then proceed editing XML for each VM?

Link to comment

Hello. As a new user without previous Linux experience this problem comes little hard. Could it be possible to do this in (web)GUI in xml-editor?

 

I have Rampage IV BE as mobo and in addition seperate usb3 pcie card. Id like to dedicate pcie-card (2 ports+ 2ports in front) to one VM and few ports to second VM.

 

Could it be possible to find number of usb controllers in GUI and then proceed editing XML for each VM?

The guide on the first page is pretty straight forward and it's mostly cut and paste the commands, so it shouldn't be that hard to follow. If there is something you're unsure about, the answer is usually a few posts away.

Link to comment

 

The guide on the first page is pretty straight forward and it's mostly cut and paste the commands, so it shouldn't be that hard to follow. If there is something you're unsure about, the answer is usually a few posts away.

 

Okay. I'll try out it then. Seperate pcie usb card should go with same method as mobo controllers?

Link to comment

 

The guide on the first page is pretty straight forward and it's mostly cut and paste the commands, so it shouldn't be that hard to follow. If there is something you're unsure about, the answer is usually a few posts away.

 

Okay. I'll try out it then. Seperate pcie usb card should go with same method as mobo controllers?

Pcie cards is very easy. You just need to find the address of the card in the device list (tools --> system devices )and alter the code for passing through the card. I suggest you use the hostdev method. I think its point 11 or something like that.

Link to comment

    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x00' function='0x0'/>
      </source>
    </hostdev>

 

Okay so, here is the problem. How do I figure a) adress domain b) slot c) function? At least I figured out which usb port goes by which bus and where unRAID is so I got that going for me, which is nice.

Link to comment

    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x00' function='0x0'/>
      </source>
    </hostdev>

 

Okay so, here is the problem. How do I figure a) adress domain b) slot c) function? At least I figured out which usb port goes by which bus and where unRAID is so I got that going for me, which is nice.

Go back to the first post and re-read point 11b and you have all the info you need.

Basically you find the PCI address of the card and change bus, slot and function according to the colored info in point 11b.

Link to comment

Section 6. on first page. I know I want to passtrough all usb slots in bus 7 and 9.

 

readlink /sys/bus/usb/devices/usb7

 

./../../devices/pci0000:00/0000:00:1c.2/0000:08:00.0/0000:09:05.0/0000:0c:00.0/usb7

 

and

 

readlink /sys/bus/usb/devices/usb9

 

../../../devices/pci0000:00/0000:00:1c.4/0000:0f:00.0/usb9

 

Now. There are multiple 0000:00:00.0 format sequences. From first page I made out that only last part, in latter case 0000:0f:00.0 counts here. So, if I wish to passtrough all usb ports in bus9 I just copy this in my xml:

 

    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x0f' slot='0x00' function='0x0'/>
      </source>
    </hostdev>

 

and it should do the trick?

 

E: worked, did it with here not mentioned controller as these were ment to "VM1" but VM2 did work, even after removing and replugging usb device. Great! I try same tomorrow with ports mentioned here for VM1.

 

unraid just crashed upon exiting VM... Well, one step at the time. Thanks.

Link to comment

I thought you just wanted to pass through a pcie USB card.

 

Originally yeah. But since I "found the secret" I put usb controller directly as I have enough controllers to passtrough for two VM and keep one for host where unraid usb is

If you have enough available I agree it's better to use the onboard controllers if you manage to pass it through.

Link to comment

I thought you just wanted to pass through a pcie USB card.

 

Originally yeah. But since I "found the secret" I put usb controller directly as I have enough controllers to passtrough for two VM and keep one for host where unraid usb is

If you have enough available I agree it's better to use the onboard controllers if you manage to pass it through.

 

If I am correct, there were five onboard controllers, 2 different for usb3 in I/O, one for usb2 on I/O, one for front usb3 connector and one for two usb2 mobo connectors as it showed total of six when pcie usb card was mounted. Anyway, thanks for tips and guide. About VM crashing, I might just remove it and make a new, there isn't really anything yet. Or just remove vm and use the disks when creating new. There where few posts to look similiar cases too.

 

I'll report here if I encounter more problems passing trough rest of the controllers I intented : )

Link to comment

Here's mine. I am getting iommu_group are bound to their vfio bus driver. Also note that I have ACS override set to ON. Is there a way I can use 04:00.0 without affecting 03:00.0? Thanks

 

 

lspci

03:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
04:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)

 

IOOMU Groups

/sys/kernel/iommu_groups/6/devices/0000:03:00.0
/sys/kernel/iommu_groups/6/devices/0000:04:00.0

 

XML Dump

<device>
  <name>pci_0000_04_00_0</name>
  <path>/sys/devices/pci0000:00/0000:00:1b.3/0000:04:00.0</path>
  <parent>pci_0000_00_1b_3</parent>
  <driver>
    <name>xhci_hcd</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>4</bus>
    <slot>0</slot>
    <function>0</function>
    <product id='0x0014'>uPD720201 USB 3.0 Host Controller</product>
    <vendor id='0x1912'>Renesas Technology Corp.</vendor>
    <iommuGroup number='6'>
      <address domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
      <address domain='0x0000' bus='0x00' slot='0x1b' function='0x2'/>
      <address domain='0x0000' bus='0x00' slot='0x1b' function='0x3'/>
      <address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
      <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </iommuGroup>
    <pci-express>
      <link validity='cap' port='0' speed='5' width='1'/>
      <link validity='sta' speed='5' width='1'/>
    </pci-express>
  </capability>
</device>

 

XML Code

<hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
      </source>
</hostdev>

Link to comment

I ran lspci | grep USB and it mentions I have three controllers, yet when I try to plug in my printer usb to all of my 8 ports, it always shows up as bus003, the same bus as one used for unraid USB stick.

Is this possible? What's interesting is that when i plug in usb 3.0 stick, I get BUS 004 one additional, it's weird because the terminal mentioned I only have 3 controllers.

 

Anyone know what could be the issue?

Link to comment

I ran lspci | grep USB and it mentions I have three controllers, yet when I try to plug in my printer usb to all of my 8 ports, it always shows up as bus003, the same bus as one used for unraid USB stick.

Is this possible? What's interesting is that when i plug in usb 3.0 stick, I get BUS 004 one additional, it's weird because the terminal mentioned I only have 3 controllers.

 

Anyone know what could be the issue?

 

Do you have front-panel usb connectors?  Are all of them live (connected to the motherboard)? 

Its possible (and even likely) that you have USB headers on your motherboard which arent connected to anything.

 

Link to comment

I ran lspci | grep USB and it mentions I have three controllers, yet when I try to plug in my printer usb to all of my 8 ports, it always shows up as bus003, the same bus as one used for unraid USB stick.

Is this possible? What's interesting is that when i plug in usb 3.0 stick, I get BUS 004 one additional, it's weird because the terminal mentioned I only have 3 controllers.

 

Anyone know what could be the issue?

You have to go into the bios and play with the ehci/xhci handoffs settings. If you are lucky, you might be able to separate the controllers.

Link to comment

I ran lspci | grep USB and it mentions I have three controllers, yet when I try to plug in my printer usb to all of my 8 ports, it always shows up as bus003, the same bus as one used for unraid USB stick.

Is this possible? What's interesting is that when i plug in usb 3.0 stick, I get BUS 004 one additional, it's weird because the terminal mentioned I only have 3 controllers.

 

Anyone know what could be the issue?

You have to go into the bios and play with the ehci/xhci handoffs settings. If you are lucky, you might be able to separate the controllers.

 

I thought that was when you have only one BUS, I ran  lspci | grep USB and it said I have three controllers. when I run lsusb it says I have 4 buses (I don't know if that's possible considering I only have three controllers). Whenever I have usb 2.0 devices connected, I can only use BUS 3(even when I connect usb2.0 devices to usb 3.0 ports).  when I connect usb 3.0 devices to usb 3.0 ports, I'm using BUS 4. I cannot seem to be able to get to BUS 2 or BUS1, or even 4 with usb 2.0 devices.

Link to comment

I ran lspci | grep USB and it mentions I have three controllers, yet when I try to plug in my printer usb to all of my 8 ports, it always shows up as bus003, the same bus as one used for unraid USB stick.

Is this possible? What's interesting is that when i plug in usb 3.0 stick, I get BUS 004 one additional, it's weird because the terminal mentioned I only have 3 controllers.

 

Anyone know what could be the issue?

 

Do you have front-panel usb connectors?  Are all of them live (connected to the motherboard)? 

Its possible (and even likely) that you have USB headers on your motherboard which arent connected to anything.

Yes I have 2of usb 2.0 headers unused (using 1/3) and I have 1 usb 3.0 header unused. I tried all three usb 2.0 headers, I can only connect to one of the same bus.

Link to comment

I ran lspci | grep USB and it mentions I have three controllers, yet when I try to plug in my printer usb to all of my 8 ports, it always shows up as bus003, the same bus as one used for unraid USB stick.

Is this possible? What's interesting is that when i plug in usb 3.0 stick, I get BUS 004 one additional, it's weird because the terminal mentioned I only have 3 controllers.

 

Anyone know what could be the issue?

 

I had the same issue until I upgraded my bios.  See my comment one page back.

Link to comment

Unfortunately my X99 Sabertooth has the same issue (all the buses on the same controller) even after BIOS update  :'(

 

lsusb	Bus	Device ID	Device Name
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub	003	00:14.0	USB controller: Intel Corporation C610/X99 series chipset USB xHCI Host Controller (rev 05)
Bus 003 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)	003	00:14.0	USB controller: Intel Corporation C610/X99 series chipset USB xHCI Host Controller (rev 05)
Bus 003 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub	003	00:14.0	USB controller: Intel Corporation C610/X99 series chipset USB xHCI Host Controller (rev 05)
Bus 003 Device 004: ID 8644:800b Intenso GmbG Micro Line (4GB)	003	00:14.0	USB controller: Intel Corporation C610/X99 series chipset USB xHCI Host Controller (rev 05)
Bus 003 Device 005: ID 0c45:62e0 Microdia MSI Starcam Racer	003	00:14.0	USB controller: Intel Corporation C610/X99 series chipset USB xHCI Host Controller (rev 05)
Bus 003 Device 006: ID 174c:2074 ASMedia Technology Inc. ASM1074 High-Speed hub	003	00:14.0	USB controller: Intel Corporation C610/X99 series chipset USB xHCI Host Controller (rev 05)
Bus 003 Device 007: ID 056a:00d1 Wacom Co., Ltd Bamboo Pen & Touch (CTH-460-DE)	003	00:14.0	USB controller: Intel Corporation C610/X99 series chipset USB xHCI Host Controller (rev 05)
Bus 003 Device 008: ID 046d:c517 Logitech, Inc. LX710 Cordless Desktop Laser	003	00:14.0	USB controller: Intel Corporation C610/X99 series chipset USB xHCI Host Controller (rev 05)
Bus 003 Device 009: ID 10f5:0650 Turtle Beach	003	00:14.0	USB controller: Intel Corporation C610/X99 series chipset USB xHCI Host Controller (rev 05)
Bus 003 Device 011: ID 1e3d:2092 Chipsbank Microelectronics Co., Ltd	003	00:14.0	USB controller: Intel Corporation C610/X99 series chipset USB xHCI Host Controller (rev 05)
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub	004	00:14.0	USB controller: Intel Corporation C610/X99 series chipset USB xHCI Host Controller (rev 05)
Bus 004 Device 002: ID 05e3:0732 Genesys Logic, Inc. All-in-One Cardreader	004	00:14.0	USB controller: Intel Corporation C610/X99 series chipset USB xHCI Host Controller (rev 05)
Bus 004 Device 003: ID 174c:3074 ASMedia Technology Inc. ASM1074 SuperSpeed hub	004	00:14.0	USB controller: Intel Corporation C610/X99 series chipset USB xHCI Host Controller (rev 05)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub	001	00:1a.0	USB controller: Intel Corporation C610/X99 series chipset USB Enhanced Host Controller #2 (rev 05)
Bus 001 Device 002: ID 8087:800a Intel Corp.	001	00:1a.0	USB controller: Intel Corporation C610/X99 series chipset USB Enhanced Host Controller #2 (rev 05)
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub	002	00:1d.0	USB controller: Intel Corporation C610/X99 series chipset USB Enhanced Host Controller #1 (rev 05)
Bus 002 Device 002: ID 8087:8002 Intel Corp.	002	00:1d.0	USB controller: Intel Corporation C610/X99 series chipset USB Enhanced Host Controller #1 (rev 05)
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub	005	08:00.0	USB controller: ASMedia Technology Inc. ASM1142 USB 3.1 Host Controller
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub	006	08:00.0	USB controller: ASMedia Technology Inc. ASM1142 USB 3.1 Host Controller

Link to comment

Looking for a little help with my setup.  I am trying to run 3vm's (windows 10).  Each with their own USB controller. 

I currently have 2 working vm's with pass through using the hostdev way. 

vm#1 uses 1a.0

vm#2 uses 1d.0

UnRaid USB is on 1c.6 aka Etron Tech.

 

I thought adding 14.0 to the third vm would be straight forward... but it doesn't work... I guess because it is xHCI?  (I've checked my BIOS and don't see anywhere to change it to EHCI)

 

I have added 2 pci add-in cards.  (Tried booting the UnRaid USB on both...no luck)

 

So I need help writing the hostdev code needed to pass through either add-in card... if it's even possible?

 

Any assistance would be extremely appreciated.

 

 

PCI Devices:

00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller [8086:0150] (rev 09)

00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port [8086:0151] (rev 09)

00:01.1 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port [8086:0155] (rev 09)

00:02.0 VGA compatible controller [0300]: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller [8086:0162] (rev 09)

00:14.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller [8086:1e31] (rev 04)

00:16.0 Communication controller [0780]: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 [8086:1e3a] (rev 04)

00:1a.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 [8086:1e2d] (rev 04)

00:1b.0 Audio device [0403]: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller [8086:1e20] (rev 04)

00:1c.0 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 [8086:1e10] (rev c4)

00:1c.4 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 5 [8086:1e18] (rev c4)

00:1c.5 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 6 [8086:1e1a] (rev c4)

00:1c.6 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 7 [8086:1e1c] (rev c4)

00:1c.7 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 8 [8086:1e1e] (rev c4)

00:1d.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 [8086:1e26] (rev 04)

00:1f.0 ISA bridge [0601]: Intel Corporation Z77 Express Chipset LPC Controller [8086:1e44] (rev 04)

00:1f.2 SATA controller [0106]: Intel Corporation 7 Series/C210 Series Chipset Family 6-port SATA Controller [AHCI mode] [8086:1e02] (rev 04)

00:1f.3 SMBus [0c05]: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller [8086:1e22] (rev 04)

01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM206 [GeForce GTX 960] [10de:1401] (rev a1)

01:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:0fba] (rev a1)

02:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM206 [GeForce GTX 960] [10de:1401] (rev a1)

02:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:0fba] (rev a1)

03:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107 [GeForce GTX 750 Ti] [10de:1380] (rev a2)

03:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:0fbc] (rev a1)

04:00.0 SATA controller [0106]: ASMedia Technology Inc. ASM1062 Serial ATA Controller [1b21:0612] (rev 01)

05:00.0 Ethernet controller [0200]: Broadcom Corporation NetLink BCM57781 Gigabit Ethernet PCIe [14e4:16b1] (rev 10)

06:00.0 USB controller [0c03]: Etron Technology, Inc. EJ168 USB 3.0 Host Controller [1b6f:7023] (rev 01)

07:00.0 PCI bridge [0604]: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch [10b5:8605] (rev aa)

08:01.0 PCI bridge [0604]: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch [10b5:8605] (rev aa)

08:02.0 PCI bridge [0604]: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch [10b5:8605] (rev aa)

08:03.0 PCI bridge [0604]: PLX Technology, Inc. PEX 8605 PCI Express 4-port Gen2 Switch [10b5:8605] (rev aa)

0a:00.0 USB controller [0c03]: VIA Technologies, Inc. VL805 USB 3.0 Host Controller [1106:3483] (rev 01)

0b:00.0 PCI bridge [0604]: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge [1b21:1080] (rev 01)

0c:00.0 USB controller [0c03]: VIA Technologies, Inc. VT82xx/62xx UHCI USB 1.1 Controller [1106:3038] (rev 62)

0c:00.1 USB controller [0c03]: VIA Technologies, Inc. VT82xx/62xx UHCI USB 1.1 Controller [1106:3038] (rev 62)

0c:00.2 USB controller [0c03]: VIA Technologies, Inc. USB 2.0 [1106:3104] (rev 65)

0c:02.0 FireWire (IEEE 1394) [0c00]: VIA Technologies, Inc. VT6306/7/8 [Fire II(M)] IEEE 1394 OHCI Controller [1106:3044] (rev c0)

 

UNRAID.png.808dde422801cc1652b4eda3347292db.png

iommu.png.d9cdc2f0c13f54c7a652e2f706f9f936.png

Link to comment

First of all OP big thanks for this guide. And also thanks to saarg for his "easy mode" with <hostdev> :)

 

Now I have my usb hub (http://www.tp-link.com/en/products/details/cat-4761_UH700.html) inside my Win10 VM and everything I plug in it gets detected right away. Webcam, dvd drive, pendrives, my Windows Phone. Life is good right now :)

 

Of course there was a bit of WTF when I did all the steps to get correct bus slot and function and VM screamed at me with big error that there is no such device :) Fortunately for everybody I stopped myself from throwing my laptop out of window and kept browsing rest of the thread. After few minutes I had a hint of solution and it worked so here it is:

 

By using lsusb command I established that I want to pass bus 003 through (that is the only bus that has no other usb stuff connected like unRaid pendrive or my logitech receivers for mouse & keyboard).

 

So next I did readlink command

 

readlink /sys/bus/usb/devices/usb3

 

And got this in response:

 

../../../devices/pci0000:00/0000:00:1c.0/0000:03:00.0/usb3

 

And here is where my confusion came from. After reading OP's guide I thought that hostdev should have address defined like this

 

<address domain='0x0000' bus='0x03' slot='0x1c' function='0x0'/>

 

using this part of readlink info

 

../../../devices/pci0000:00/0000:00:1c.0/0000:03:00.0/usb3

 

But this caused big scary error to appear when I started VM.

 

Correct way is to use numbers from last but one part of usb3 "path" returned by readlink:

 

../../../devices/pci0000:00/0000:00:1c.0/0000:03:00.0/usb3

 

<address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>

 

 

After this was done VM started up normally, Win10 detected my webcam and all other connected devices and hot plugging works perfectly.

Link to comment
  • 2 weeks later...

Hi guys,

Thanks for very helpful guide.

 

So I was trying to do this on my VM as well and the USB controller just refuse to appear in my VM Windows 10.

 

Here's my system.

 

lspci

00:1a.0 USB controller: Intel Corporation C600/X79 series chipset USB2 Enhanced Host Controller #2 (rev 06)
00:1d.0 USB controller: Intel Corporation C600/X79 series chipset USB2 Enhanced Host Controller #1 (rev 06)
06:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 03)
09:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller

 

No conflict in my IOOMU Groups.

 

Here's my XML

<domain type='kvm'>
  <name>Windows 10</name>
  <uuid>dbcbe865-ad10-f22f-6d41-57f060b018e0</uuid>
  <metadata>
    <vmtemplate name="Custom" icon="windows.png" os="windows"/>
  </metadata>
  <memory unit='KiB'>16777216</memory>
  <currentMemory unit='KiB'>16777216</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>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.3'>hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='4' 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='raw' cache='writeback'/>
      <source file='/mnt/cache/vm/vdisk1.img'/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/iso/Win10_1511_1_English_x64.iso'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/iso/virtio-win-0.1.117.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </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:f4:50:10'/>
      <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'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/Windows 10.org.qemu.guest_agent.0'/>
      <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'/>
    <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='vmvga' vram='16384' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
  <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
      </source>
</hostdev>
</domain>

 

This is with the NEC controller with is a PCIE card. I have also tried with the bus='0x09' for the ASmedia on board.

 

Fresh install Windows 10 with Virto drivers installed. Motherboard is an Asus Z9PA-D8 if that helps.

 

Am I missing something?

 

Thanks

 

Link to comment

Hi guys,

Thanks for very helpful guide.

 

So I was trying to do this on my VM as well and the USB controller just refuse to appear in my VM Windows 10.

 

Here's my system.

 

lspci

00:1a.0 USB controller: Intel Corporation C600/X79 series chipset USB2 Enhanced Host Controller #2 (rev 06)
00:1d.0 USB controller: Intel Corporation C600/X79 series chipset USB2 Enhanced Host Controller #1 (rev 06)
06:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 03)
09:00.0 USB controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller

 

No conflict in my IOOMU Groups.

 

Here's my XML

<domain type='kvm'>
  <name>Windows 10</name>
  <uuid>dbcbe865-ad10-f22f-6d41-57f060b018e0</uuid>
  <metadata>
    <vmtemplate name="Custom" icon="windows.png" os="windows"/>
  </metadata>
  <memory unit='KiB'>16777216</memory>
  <currentMemory unit='KiB'>16777216</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>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.3'>hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='4' 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='raw' cache='writeback'/>
      <source file='/mnt/cache/vm/vdisk1.img'/>
      <target dev='hdc' bus='virtio'/>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/iso/Win10_1511_1_English_x64.iso'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/iso/virtio-win-0.1.117.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </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:f4:50:10'/>
      <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'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/Windows 10.org.qemu.guest_agent.0'/>
      <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'/>
    <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='vmvga' vram='16384' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
  <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
      </source>
</hostdev>
</domain>

 

This is with the NEC controller with is a PCIE card. I have also tried with the bus='0x09' for the ASmedia on board.

 

Fresh install Windows 10 with Virto drivers installed. Motherboard is an Asus Z9PA-D8 if that helps.

 

Am I missing something?

 

Thanks

 

 

The problem is with your XML. You need to have <hostdev> within the <devices> tag.  ;D

Link to comment

Thanks for this guide. Just knowing this was possible was awesome. I was able to use an Anker USB 3.0  pci-e card. http://www.amazon.com/Anker%C2%AE-Express-Connector-Desktops-Chipset/dp/B005ARQV6U

 

One thing I ran in to with this on windows 10 is using any sort of USB audio device in this card causes the mouse to freeze. I tried USB speakers, and a USB headset. I tried 2 different logitech mice... 1 wired, 1 wireless and see the same results.

 

I decided to not have the mouse on the Anker USB card and that fixed it. Was pretty disappointed to see that weird behavior.

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.