Jump to content
archedraft

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

507 posts in this topic Last Reply

Recommended Posts

I've tried both methods of USB hub pass-through and neither will work with my keyboard and mouse but weirdly it will with a portable hard drive.

 

Do you happen to have a different USB keyboard and mouse you could try? If the portable hard drive works then technically it is working, so the issue is most likely that keyboard and mouse. Does your keyboard/mouse manufacture have any additional software you can install? For example Logitech has their Setpoint software which I have found to be helpful with my devices.

 

 

Turns out I was mis interpretating the problem, I managed to pass through 2 other hubs fine it seems just one hub powers down when passed through and I cant under stand way.

Share this post


Link to post

Man I thought I was set to finally go ahead and do this and stop messing with hostdev bus/id which I have to use since I have 3 flircs.

 

I have 8 USB ports on 8 separate controllers:

 

00:1a.0 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4
00:1a.1 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5
00:1a.2 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6
00:1a.7 USB controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2
00:1d.0 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1
00:1d.1 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2
00:1d.2 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3
00:1d.7 USB controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1

 

../../../devices/pci0000:00/0000:00:1a.7/usb1
../../../devices/pci0000:00/0000:00:1d.7/usb2
../../../devices/pci0000:00/0000:00:1a.0/usb3
../../../devices/pci0000:00/0000:00:1a.1/usb4
../../../devices/pci0000:00/0000:00:1a.2/usb5
../../../devices/pci0000:00/0000:00:1d.0/usb6
../../../devices/pci0000:00/0000:00:1d.1/usb7
../../../devices/pci0000:00/0000:00:1d.2/usb8

 

Looks awesome until I looked at my iommu groups:

 

/sys/kernel/iommu_groups/9/devices/0000:00:1a.0

/sys/kernel/iommu_groups/9/devices/0000:00:1a.1

/sys/kernel/iommu_groups/9/devices/0000:00:1a.2

/sys/kernel/iommu_groups/9/devices/0000:00:1a.7

/sys/kernel/iommu_groups/10/devices/0000:00:1d.0

/sys/kernel/iommu_groups/10/devices/0000:00:1d.1

/sys/kernel/iommu_groups/10/devices/0000:00:1d.2

/sys/kernel/iommu_groups/10/devices/0000:00:1d.7

 

Sigh...

 

John

Share this post


Link to post

Man I thought I was set to finally go ahead and do this and stop messing with hostdev bus/id which I have to use since I have 3 flircs.

 

I have 8 USB ports on 8 separate controllers:

 

00:1a.0 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4
00:1a.1 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5
00:1a.2 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6
00:1a.7 USB controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2
00:1d.0 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1
00:1d.1 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2
00:1d.2 USB controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3
00:1d.7 USB controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1

 

../../../devices/pci0000:00/0000:00:1a.7/usb1
../../../devices/pci0000:00/0000:00:1d.7/usb2
../../../devices/pci0000:00/0000:00:1a.0/usb3
../../../devices/pci0000:00/0000:00:1a.1/usb4
../../../devices/pci0000:00/0000:00:1a.2/usb5
../../../devices/pci0000:00/0000:00:1d.0/usb6
../../../devices/pci0000:00/0000:00:1d.1/usb7
../../../devices/pci0000:00/0000:00:1d.2/usb8

 

Looks awesome until I looked at my iommu groups:

 

/sys/kernel/iommu_groups/9/devices/0000:00:1a.0

/sys/kernel/iommu_groups/9/devices/0000:00:1a.1

/sys/kernel/iommu_groups/9/devices/0000:00:1a.2

/sys/kernel/iommu_groups/9/devices/0000:00:1a.7

/sys/kernel/iommu_groups/10/devices/0000:00:1d.0

/sys/kernel/iommu_groups/10/devices/0000:00:1d.1

/sys/kernel/iommu_groups/10/devices/0000:00:1d.2

/sys/kernel/iommu_groups/10/devices/0000:00:1d.7

 

Sigh...

 

John

And you enabled the ACS override?

Share this post


Link to post

And you enabled the ACS override?

 

I have not.

 

I was under the impression that was a bad thing to enable unless you absolutely have to.  Please tell me that enabling that would put each of these controllers into their own iommu group.

 

John

Share this post


Link to post

And you enabled the ACS override?

 

I have not.

 

I was under the impression that was a bad thing to enable unless you absolutely have to.  Please tell me that enabling that would put each of these controllers into their own iommu group.

 

John

I haven't heard anyone having any problems related to the ACS override. It can happen in some cases, but it's very rare. In your case it's only the usb controllers and not a graphics card and disk controller in the same group, so I think you are safe to go  :D

If they will end up in the same group or not you just have to enable it and see  ;)

Share this post


Link to post

Tried PCIe ACS Override but it did not change the groups for those devices.  Oh well.

 

/sys/kernel/iommu_groups/9/devices/0000:00:1a.0
/sys/kernel/iommu_groups/9/devices/0000:00:1a.1
/sys/kernel/iommu_groups/9/devices/0000:00:1a.2
/sys/kernel/iommu_groups/9/devices/0000:00:1a.7
/sys/kernel/iommu_groups/10/devices/0000:00:1d.0
/sys/kernel/iommu_groups/10/devices/0000:00:1d.1
/sys/kernel/iommu_groups/10/devices/0000:00:1d.2
/sys/kernel/iommu_groups/10/devices/0000:00:1d.7

Share this post


Link to post

Hmm, I guess your options are mess around with the bios settings or get an add on card.

 

Everything works right now so not a big deal.  But I think I will take a peak in the BIOS and see what I can do.

Share this post


Link to post

Hmm, I guess your options are mess around with the bios settings or get an add on card.

 

Everything works right now so not a big deal.  But I think I will take a peak in the BIOS and see what I can do.

I'm not sure if that will help. My guess is that you need an add on card, unfortunately  :(

Share this post


Link to post

Hmm, I guess your options are mess around with the bios settings or get an add on card.

 

Everything works right now so not a big deal.  But I think I will take a peak in the BIOS and see what I can do.

I'm not sure if that will help. My guess is that you need an add on card, unfortunately  :(

 

I have a silly question...

 

Do they make USB addon cards that have multiple controllers on it?  Or is the controller always going to be on the PCI bus?

 

John

Share this post


Link to post

Hmm, I guess your options are mess around with the bios settings or get an add on card.

 

Everything works right now so not a big deal.  But I think I will take a peak in the BIOS and see what I can do.

I'm not sure if that will help. My guess is that you need an add on card, unfortunately  :(

 

I have a silly question...

 

Do they make USB addon cards that have multiple controllers on it?  Or is the controller always going to be on the PCI bus?

 

John

 

May have answered my own question:  http://www.newegg.com/Product/Product.aspx?Item=N82E16816115104

 

 

Share this post


Link to post

Hmm, I guess your options are mess around with the bios settings or get an add on card.

 

Everything works right now so not a big deal.  But I think I will take a peak in the BIOS and see what I can do.

I'm not sure if that will help. My guess is that you need an add on card, unfortunately  :(

 

I have a silly question...

 

Do they make USB addon cards that have multiple controllers on it?  Or is the controller always going to be on the PCI bus?

 

John

 

Not 100% sure but I would highly suspect that it will would be limited to the PCIe slot. Even if the card had multiple controllers you probably wouldn't be able to pass through them to different VM's. I could be completely wrong though...

Share this post


Link to post

So I am just starting this and this is the USB output from Putty for my system.

 

Linux 4.1.13-unRAID.

root@Backup:~# lspci | grep USB

00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family US                              B xHCI Host Controller (rev 04)

00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family US                              B Enhanced Host Controller #2 (rev 04)

00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family US                              B Enhanced Host Controller #1 (rev 04)

 

root@Backup:~# lsusb

Bus 004 Device 003: ID 413c:2105 Dell Computer Corp. Model L100 Keyboard

Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 003 Device 005: ID 2109:0810

Bus 003 Device 004: ID 05dc:a205 Lexar Media, Inc.

Bus 003 Device 003: ID 051d:0002 American Power Conversion Uninterruptible Power Supply

Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 003: ID 2109:0810

Bus 002 Device 002: ID 2109:0810

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

The Lexar on Bus 03 is the USB flash drive I use to boot UnRaid, so I am assuming I don't want to pass trhough Bus 003 at all, correct? Or do I to plug a flash drive into to different ports still and run this command to see what ports are on Bus 003?

Share this post


Link to post

So I am just starting this and this is the USB output from Putty for my system.

 

Linux 4.1.13-unRAID.

root@Backup:~# lspci | grep USB

00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family US                              B xHCI Host Controller (rev 04)

00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family US                              B Enhanced Host Controller #2 (rev 04)

00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family US                              B Enhanced Host Controller #1 (rev 04)

 

root@Backup:~# lsusb

Bus 004 Device 003: ID 413c:2105 Dell Computer Corp. Model L100 Keyboard

Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 003 Device 005: ID 2109:0810

Bus 003 Device 004: ID 05dc:a205 Lexar Media, Inc.

Bus 003 Device 003: ID 051d:0002 American Power Conversion Uninterruptible Power Supply

Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 003: ID 2109:0810

Bus 002 Device 002: ID 2109:0810

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

The Lexar on Bus 03 is the USB flash drive I use to boot UnRaid, so I am assuming I don't want to pass trhough Bus 003 at all, correct? Or do I to plug a flash drive into to different ports still and run this command to see what ports are on Bus 003?

 

Correct, you will never pass through Bus 003 but it would still be good to figure out which USB slots belong to Bus 003 for future reference.

Share this post


Link to post

So I am just starting this and this is the USB output from Putty for my system.

 

Linux 4.1.13-unRAID.
root@Backup:~# lspci | grep USB
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family US                              B xHCI Host Controller (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family US                              B Enhanced Host Controller #2 (rev 04)
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family US                              B Enhanced Host Controller #1 (rev 04)

root@Backup:~# lsusb
Bus 004 Device 003: ID 413c:2105 Dell Computer Corp. Model L100 Keyboard
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 005: ID 2109:0810
Bus 003 Device 004: ID 05dc:a205 Lexar Media, Inc.
Bus 003 Device 003: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 2109:0810
Bus 002 Device 002: ID 2109:0810
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

The Lexar on Bus 03 is the USB flash drive I use to boot UnRaid, so I am assuming I don't want to pass trhough Bus 003 at all, correct? Or do I to plug a flash drive into to different ports still and run this command to see what ports are on Bus 003?

 

I mapped all my USB ports and drew a diagram so I know exactly what is what.  I think it's worth doing just to stop confusion down the line.....

 

And Ash, please wrap the code in code tags....  ;D

 

Now no more help until you learn how to wrap the code on the forum....  ;D

 

Here's how....

 

DytTCuf.jpg

 

 

Share this post


Link to post

Correct, you will never pass through Bus 003 but it would still be good to figure out which USB slots belong to Bus 003 for future reference.

 

Its all the ports on the rear of my motherboard, I know because I plugged a USB flash drive into the empty slots and ran the command, as well I can see whats plugged into those slots corresponds with bus 003. So I am just going to pass through bus 004 then.

 

Share this post


Link to post

Hey all, I am trying to follow this, but I am getting an unusual result. When I do the readlink thing on usb1 (the usb bus I want to pass to the vm), I get this:

 

root@Bernard:~# readlink /sys/bus/usb/devices/usb1
../../../devices/pci0000:00/0000:00:03.0/0000:04:00.0/usb1

 

if I do the same on usb2 (which is another port on the same card) I get the same result

 

root@Bernard:~# readlink /sys/bus/usb/devices/usb2
../../../devices/pci0000:00/0000:00:03.0/0000:04:00.0/usb2

 

It looks like the PCI card has two bus addresses. Is that correct? This is a rosewill USB 3 card with 4 ports on it.

 

Ideally, I want to pass all of the ports on this card to the VM using the hostdev mode. What PCI addresses should I be using?

 

Thanks,

 

Richard

 

 

 

 

 

Share this post


Link to post

Hey all, I am trying to follow this, but I am getting an unusual result. When I do the readlink thing on usb1 (the usb bus I want to pass to the vm), I get this:

 

root@Bernard:~# readlink /sys/bus/usb/devices/usb1
../../../devices/pci0000:00/0000:00:03.0/0000:04:00.0/usb1

 

if I do the same on usb2 (which is another port on the same card) I get the same result

 

root@Bernard:~# readlink /sys/bus/usb/devices/usb2
../../../devices/pci0000:00/0000:00:03.0/0000:04:00.0/usb2

 

It looks like the PCI card has two bus addresses. Is that correct? This is a rosewill USB 3 card with 4 ports on it.

 

Ideally, I want to pass all of the ports on this card to the VM using the hostdev mode. What PCI addresses should I be using?

 

Thanks,

 

Richard

The first bus address is the PCI bridge, so you should use the second one.

This you will also find if you check your device list in the webgui under Tools --> System Devices.

 

Post it here if you are unsure.

Share this post


Link to post

Okay, so in tools/system devices, I see...

 

04:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)
05:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)

 

So that means that my new entry in the XML for this VM should be this, yes:

 

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

Share this post


Link to post

Okay, so in tools/system devices, I see...

 

04:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)
05:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)

 

So that means that my new entry in the XML for this VM should be this, yes:

 

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

 

That is wrong. This is how it's supposed to look if you want to pass through only one of the controllers:

 

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

 

You will find a guide how to interpret the bus address and add it to the correct places in the tag in the first post of this thread.

 

Share this post


Link to post

Ah, got my buses and slots confused. That seems to work: the devices connected to that controller are now being passed through. Yay.  ;D

Share this post


Link to post

I am trying to figure out how to pass a USB keyboard and mouse through to a VM I have setup. In the log I just noticed this:

 

Jan 17 19:23:32 Tower kernel: input: Dell Dell USB Keyboard as /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.6/4-1.6:1.0/0003:413C:2105.0007/input/input11

 

Jan 17 19:23:34 Tower kernel: input: Logitech Lenovo USB Optical Mouse as /devices/pci0000:00/0000:00:1d.0/usb4/4-1/4-1.7/4-1.7:1.0/0003:17EF:6019.0008/input/input12

 

If I want to pass the entire controller through would that translate into:

 

hostdev mode='subsystem' type='pci' managed='yes'>

      <driver name='vfio'/>

      <source>

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

      </source>

    </hostdev>

Share this post


Link to post

Yes, as it's exactly what I said hours ago

Share this post


Link to post

I also said I couldn't get hostdev tp work with OSX ;)

Share this post


Link to post

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.