Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Help] Issue after using PCI pass trough with USB

Featured Replies

Hi,

 

I have found a strange thing after passing trough  00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) I want to hot plug some USB devices in my Windows10 VM

 

After fresh boot I see all of my USB:s

lsusb
Bus 002 Device 006: ID 045e:00b4 Microsoft Corp. Digital Media Keyboard 1.0A
Bus 002 Device 005: ID 045e:0047 Microsoft Corp. IntelliMouse Explorer 3.0
Bus 002 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 002 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 001 Device 003: ID 0bda:0306 Realtek Semiconductor Corp.
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

And this is my PCI devices

lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09)
00:02.0 Display controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)
00:1c.5 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 6 (rev c4)
00:1c.7 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 8 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation Z77 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series/C210 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)
01:00.0 SCSI storage controller: LSI Logic / Symbios Logic SAS1068E PCI-Express Fusion-MPT SAS (rev 08)
02:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Caicos [Radeon HD 6450/7450/8450 / R5 230 OEM]
02:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Caicos HDMI Audio [Radeon HD 6400 Series]
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
04:00.0 SATA controller: ASMedia Technology Inc. ASM1062 Serial ATA Controller (rev 01)

 

 

In my VM a have this settings to pass trough the USB controller

    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=00:1d.0,bus=root.1,addr=00.2'/>

   

   

Then I start the VM

 

And ........ devices on BUS 002 is gone !!! ??? I only see Bus 001

But the devices that was on Bus 002 are working in my VM, the only thing is that these are hidden in unraid, and cant be used in other VM ??!! need to reboot to get then back

lsusb
Bus 001 Device 004: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 001 Device 003: ID 0bda:0306 Realtek Semiconductor Corp.
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 

 

Is there any solution to get back all devices ?

 

My VM

<domain type='kvm' id='3' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  <name>W10-Pro</name>
  <uuid>952d51b2-e8d9-269e-0473-72951270bc2e</uuid>
  <metadata>
    <vmtemplate name="Custom" icon="windows.png" os="windows"/>
  </metadata>
  <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-i440fx-2.3'>hvm</type>
    <boot dev='hd'/>
  </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='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/vg_virtual_machines/lv_Windows'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb'/>
      <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='ide' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:0b:09:da'/>
      <source bridge='br0'/>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/2'>
      <source path='/dev/pts/2'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/W10-Pro.org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
  <qemu:commandline>
    <qemu:arg value='-device'/>
    <qemu:arg value='ioh3420,bus=pci.0,addr=1c.0,multifunction=on,port=2,chassis=1,id=root.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=02:00.1,bus=root.1,addr=00.1'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=00:1d.0,bus=root.1,addr=00.2'/>
  </qemu:commandline>
</domain>

So once you shutdown the first VM with the USB devices passed through, what happens if you start the second VM with the same devices passed through?

Do I understand you correctly that the devices on Bus 2 should not be passed to the VM and is on another controller?

What does the readlink command below say?

 

readlink /sys/bus/usb/devices/usb2

  • Author

The devices on Bus 2 are the devices I pass trough to my vm ( all of them are on same controller)

 

And I can pass trough that controller to another VM after shut doen 1:st VM and it works great, BUT I cant not longer use a single device on that controller to pass trough, since I cant see them longer using"lsusb"

//Petre

 

  • Author

Do I understand you correctly that the devices on Bus 2 should not be passed to the VM and is on another controller?

What does the readlink command below say?

 

readlink /sys/bus/usb/devices/usb2

 

readlink /sys/bus/usb/devices/usb1
../../../devices/pci0000:00/0000:00:1a.0/usb1
root@Tower:~# readlink /sys/bus/usb/devices/usb2
root@Tower:~#

Once you pass through the USB card to the VM, it is invisible to anything other than the VM until the VM has been stopped.

The devices on Bus 2 are the devices I pass trough to my vm ( all of them are on same controller)

 

And I can pass trough that controller to another VM after shut doen 1:st VM and it works great, BUT I cant not longer use a single device on that controller to pass trough, since I cant see them longer using"lsusb"

//Petre

 

So I have a Win 10 and Win 7 VM. I pass through the same graphics card and USB controller to both VMs. I just shutdown one and start the second and the second one has access to all the USB devices attached to the controller. Could you just pass through the controller to both VM's in the config?

  • Author

Once you pass through the USB card to the VM, it is invisible to anything other than the VM until the VM has been stopped.

After shut down VM , I can't see Bus 2

 

lsusb
Bus 001 Device 004: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 001 Device 003: ID 0bda:0306 Realtek Semiconductor Corp.
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

  • Author

The devices on Bus 2 are the devices I pass trough to my vm ( all of them are on same controller)

 

And I can pass trough that controller to another VM after shut doen 1:st VM and it works great, BUT I cant not longer use a single device on that controller to pass trough, since I cant see them longer using"lsusb"

//Petre

 

So I have a Win 10 and Win 7 VM. I pass through the same graphics card and USB controller to both VMs. I just shutdown one and start the second and the second one has access to all the USB devices attached to the controller. Could you just pass through the controller to both VM's in the config?

I can pass trough same controller to several VM ,but on a specific VM I like only pass trough 2 devices on that controller using this code instead

 

<hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x045e'/>
        <product id='0x0047'/>
      </source>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x045e'/>
        <product id='0x00b4'/>
      </source>
    </hostdev>

 

 

BUT since I passed trough the PCI-USB controller all these devices are gone using"lsusb"

 

PCI USB passtrough controller code

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

The devices on Bus 2 are the devices I pass trough to my vm ( all of them are on same controller)

 

And I can pass trough that controller to another VM after shut doen 1:st VM and it works great, BUT I cant not longer use a single device on that controller to pass trough, since I cant see them longer using"lsusb"

//Petre

So the problem is that after shutting down the VM you can't pass through the devices to another VM?

 

I just checked here, and the devices pops back to unraid after the VM is shut down.

I can pass trough same controller to several VM ,but on a specific VM I like only pass trough 2 devices on that controller using this code instead

 

<hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x045e'/>
        <product id='0x0047'/>
      </source>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x045e'/>
        <product id='0x00b4'/>
      </source>
    </hostdev>

 

 

BUT since I passed trough the PCI-USB controller all these devices are gone using"lsusb"

 

PCI USB passtrough controller code

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

 

Hmmm, you're being all fancy with your pass through. What if you moved the two devices to the same controller as your unRAID boot USB, then one the one VM that you just want the 2 USB devices you can pass them through like you have above and on the other VM you can pass through the controller AND both usb devices?

  • Author

I need to look into this tomorrow .....

 

But see firts post, after fresh boot I see Bus 1 & Bus2 using

lsusb

, then passing trough one USB controller to a VM , then Bus 2 are gone  when using

lsusb

 

 

Can someone more verify this ?

//Peter

I am new to VM's so take this comment with a grain of salt....isn't each PCI device that is passed through supposed to have its own address, i.e. for the usb pci shouldn't it be addr=00.2

 

See step 11 in this guide:  https://lime-technology.com/forum/index.php?topic=36768.0

 

Dan

I need to look into this tomorrow .....

 

But see firts post, after fresh boot I see Bus 1 & Bus2 using

lsusb

, then passing trough one USB controller to a VM , then Bus 2 are gone  when using

lsusb

 

 

Can someone more verify this ?

//Peter

 

Mine do not show up after I shutdown the first VM, but I just start up the second VM with the same controller and all is well in the world. If you really don't want to pass through the same controller I would move the 2 usb devices to a different bus.

I need to look into this tomorrow .....

 

But see firts post, after fresh boot I see Bus 1 & Bus2 using

lsusb

, then passing trough one USB controller to a VM , then Bus 2 are gone  when using

lsusb

 

 

Can someone more verify this ?

//Peter

I'm confused about what the problem is here.

From what I understand from above the bus on the USB controller you passed through to the VM is gone from lsusb? That is how it's supposed to be. After passing through a whole USB controller you will not see it in unraid anymore.

I'll check later but I'm also pretty sure once I passthrough a PCI controller and use it in a VM it disappears from the host after shutdown of the VM.  Whether it works with another VM afterwards without a reboot I haven't tried.  I will try and do some testing later or tomorrow though.

 

I'll check later but I'm also pretty sure once I passthrough a PCI controller and use it in a VM it disappears from the host after shutdown of the VM.  Whether it works with another VM afterwards without a reboot I haven't tried.  I will try and do some testing later or tomorrow though.

 

Seeing as we share the same motherboard, I would be willing to bet it works just fine with another VM [emoji6]

 

I'll check later but I'm also pretty sure once I passthrough a PCI controller and use it in a VM it disappears from the host after shutdown of the VM.  Whether it works with another VM afterwards without a reboot I haven't tried.  I will try and do some testing later or tomorrow though.

 

Seeing as we share the same motherboard, I would be willing to bet it works just fine with another VM [emoji6]

Actually, that reminds me of something I wanted to talk to you about....

 

When following your USB passthrough tutorial, I noticed looking at the picture you posted that my USB bus setup is slightly different....

 

Off the top of my head

 

BUS1 = USB3

BUS2 = Unused (but I suspect it's actually linked to BUS1)

BUS3 & BUS 4 = USB2

 

It's easier to explain with a picture, and I'll do that this morning as well as test this for Peter, you know, for science...

peter,

 

I've checked this and I do indeed see the same behaviour..

 

I'll do some more testing and post back.

  • Author

Hi,

 

Great, The best way must be if you can pass through a controller to one VM  then shut down this. Then the bus should be available for the system ( verify by using lsusb)  :D

 

I tested to  pass through the same controller to my OSX VM, but that result to a heavy lagging USB  keyboard and mouse  :-[

 

I would like to see that my Windows VM I pass through the controller and for my OSX VM only mouse and keyboard devices.  ;D8)

 

 

 

Hi,

 

Great, The best way must be if you can pass through a controller to one VM  then shut down this. Then the bus should be available for the system ( verify by using lsusb)  :D

 

I tested to  pass through the same controller to my OSX VM, but that result to a heavy lagging USB  keyboard and mouse  :-[

 

I would like to see that my Windows VM I pass through the controller and for my OSX VM only mouse and keyboard devices.  ;D8)

 

OK, well I'm passing through a controller for an Unraid VM License USB Key, I'll plugin my USB KB/Mouse receiver to it and then allocate it to my OSX VM and see if I see the same behaviour...

 

Does that sound like a reasonable way to test the theory?

  • Author

 

Do

lsusb

 

Add 2 devices to OSX (keyboard/mouse) should be attached on the controller for the Windows VM

 

Then pass trough the controller in one VM(Windows) start and shut down the VM, then pass trough only keybord/mouse devices (Connected to the same controller for Windows) in second VM (OSX)

 

I think you get an eror when starting OSX after shut down windows :-)

 

//Peter

 

 

 

 

C-Media Electronics is the device I'm using for this experiment.

 

Fresh boot of Unraid:

lsusb:

root@Server:~# lsusb
Bus 003 Device 003: ID 0d8c:0014 C-Media Electronics, Inc.
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 0bc2:a0a5 Seagate RSS LLC
Bus 002 Device 002: ID 26bd:9917
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

lspci | grep USB

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

readlink /sys/bus/usb/devices/usb3

../../../devices/pci0000:00/0000:00:1a.0/usb3

 

lspci -n

00:1a.0 0c03: 8086:1e2d (rev 04)

 

OK, here's my Win10VM  prior to boot, the C-NAME is a USB Sound dongle...

It's passed through to the Win10VM as a solo device NOT the whole controller, this is what I see on a fresh boot of Unraid...

TpJ8WIw.jpg

    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x0d8c'/>
        <product id='0x0014'/>
      </source>
    </hostdev>

 

The OSX VM has the USB Sound dongle passed through on the whole controller..

    <qemu:arg value='-device'/>
    <qemu:arg value='vfio-pci,host=00:1a.0,bus=root.1,addr=00.2'/>

 

 

So starting from a fresh boot of Unraid.  I can boot the Win10VM and the USB Sound dongle is visible.

 

Shutdown the Win10 VM and start the OSX VM, starts up no problem.

 

Shutdown the OSX VM and attempt to restart the Win10 VM and I get an error.

 

internal error: Did not find USB device d8c:14

lsusb

root@Server:~# lsusb
Bus 002 Device 003: ID 0bc2:a0a5 Seagate RSS LLC
Bus 002 Device 002: ID 26bd:9917
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

So I think this is what Peter is getting at...

 

From a fresh boot, before the USB controller is passed through to a VM it is possible to assign devices from it and use them in other VMs without issue, however, once the USB controller is passed through to a VM and that VM is subsequently shutdown, it is no longer possible to passthrough individual devices from it through to another VM...

 

I think....  :-\

  • Author

We have exactly the same situation :-) or :-(

 

 

What we need is that when a VM have passtrough a controller, its need to give back the USB bus when shuting down.

 

Wounder if it's about the "kernel in use" for the devices , can you check that after a boot and what is change after shuting down VM?

 

 

try

lsusb -t

and

lspci -k

maybe you need another switch ?? I'm at work right now

//Peter

  • Author

@CHBMB can you check to passtrough the controller in your OSX ? just to verify if mouse and keyboard as lagging?

 

//Peter

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.