USB Passthrough not working.


Recommended Posts

i have a KMV ( a hddmi one with 4 ports that can i can use to use 4 computers/outputs over hdmi i can also connect my kb and mouse to it.

 

it works when i use my normal computer but when i want to passthrough it to the VM it doesnt work.

 

i checked the iommu

00:14.08086:8cb1USB controller: Intel Corporation 9 Series Chipset Family USB xHCI Controller

USB devices attached to this controller:

Bus 003 Device 007: ID 09eb:0131 IM Networks, Inc.

Bus 003 Device 006: ID 047d:1020 Kensington Expert Mouse Trackball

Bus 003 Device 005: ID 09ea:0130

Bus 003 Device 003: ID 05e3:0610 Genesys Logic, Inc. 4-port hub

Bus 003 Device 011: ID 24ae:1006 RAPOO Rapoo 2.4G Wireless Touchpad Keyboard

Bus 003 Device 002: ID 1b1c:0c03 Corsair H100iGTX Cooler

Bus 003 Device 004: ID 058f:6387 Alcor Micro Corp. Flash Drive

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

Bus 004 Device 002: ID 05e3:0612 Genesys Logic, Inc. Hub

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

 

this is from the vfio plugin but i cant pass this one as it also holds my Unraid flash drive.

 

if i put the USB Controller on the vm settings to usb 2.0  keyboard and mouse not working

if i put it on usb 3.0 only mouse is working and no keyboard

 

i have a seperate KB/mouse combo connected directly on the unraid server which is the rapoo one. and that works fine but i want to passthrough my normal kb and mouse. ANy idea how i can fix this ?

 

i got my GPU etc working after some tricks from spaceinvaderone. 

 

the log from the VM

 

boot strict=on \
-device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x7.0x7 \
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x7 \
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x7.0x1 \
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x7.0x2 \
-device ahci,id=sata0,bus=pci.0,addr=0x3 \
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4 \
-blockdev '{"driver":"file","filename":"/mnt/user/isos/virtio-win-0.1.173-2.iso","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-2-format","read-only":true,"driver":"raw","file":"libvirt-2-storage"}' \
-device ide-cd,bus=sata0.1,drive=libvirt-2-format,id=sata0-0-1 \
-blockdev '{"driver":"host_device","filename":"/dev/disk/by-id/ata-Samsung_SSD_860_EVO_250GB_S3YJNF0K211353T","node-name":"libvirt-1-storage","cache":{"direct":false,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' \
-device ide-hd,bus=sata0.2,drive=libvirt-1-format,id=sata0-0-2,bootindex=1,write-cache=on \
-netdev tap,fd=35,id=hostnet0,vhost=on,vhostfd=36 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:80:bb:95,bus=pci.0,addr=0x2 \
-chardev pty,id=charserial0 \
-device isa-serial,chardev=charserial0,id=serial0 \
-chardev socket,id=charchannel0,fd=38,server,nowait \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \
-device usb-tablet,id=input0,bus=usb.0,port=4 \
-device vfio-pci,host=0000:01:00.0,id=hostdev0,x-vga=on,bus=pci.0,addr=0x5,romfile=/mnt/user/system/vbios/Palit.GTX980.4096.rom \
-device vfio-pci,host=0000:00:1b.0,id=hostdev1,bus=pci.0,addr=0x6 \
-device vfio-pci,host=0000:01:00.1,id=hostdev2,bus=pci.0,addr=0x8 \
-device usb-host,hostbus=3,hostaddr=6,id=hostdev3,bus=usb.0,port=1 \
-device usb-host,hostbus=3,hostaddr=7,id=hostdev4,bus=usb.0,port=2 \
-device usb-host,hostbus=3,hostaddr=2,id=hostdev5,bus=usb.0,port=3 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
2020-05-18 16:29:23.178+0000: Domain id=1 is tainted: high-privileges
2020-05-18 16:29:23.178+0000: Domain id=1 is tainted: host-cpu
char device redirected to /dev/pts/0 (label charserial0)
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind
2020-05-18T16:34:56.144198Z qemu-system-x86_64: warning: guest updated active QH
libusb: error [udev_hotplug_event] ignoring udev action bind
2020-05-18T16:39:31.283736Z qemu-system-x86_64: warning: guest updated active QH
2020-05-18T16:39:31.934778Z qemu-system-x86_64: terminating on signal 15 from pid 12644 (/usr/sbin/libvirtd)
2020-05-18 16:39:34.141+0000: shutting down, reason=shutdown

Edited by KoNeko
added log VM
Link to comment
9 minutes ago, juan11perez said:

this was posted yesterday i think. 

have a look 

 

Yes i saw that one. but im not trying to passthrough any pcie device.

 

my boot USB seems to be on the same group as teh rest of my USB. i tried all ports on my computer  and always gets into the same group.

Link to comment

So you have a mouse and keyboard attached to a KVM, which in turn is attached via a single USB cable to your unRaid server (with a similar single USB attached to your standalone PC). Is that topology correct?

 

In the listing above, can you please point out which lines relate to they keyboard and mouse attached to the KVM? Can you point out if ione of the hubs listed is the KVM itself?

 

That information would be useful.

 

Do you have the KVM switched to your VM when you are booting unRAID? When you are booting the VM? What exactly are you attempting to pass through to the VM? (a screengrab of your VM config would be useful, particularly the bottom section that shows USB and PCI device passthrough).

 

I use KVMs with VMs myself and they work fine, but I always have a dedicated USB adapter passed through to the VM and have the KVM attached to that. This facilitates native device hot swapping inside the VM and works much much better than trying to get an unRAID device working.

 

 

 

Link to comment
2 hours ago, meep said:

So you have a mouse and keyboard attached to a KVM, which in turn is attached via a single USB cable to your unRaid server (with a similar single USB attached to your standalone PC). Is that topology correct?

 

In the listing above, can you please point out which lines relate to they keyboard and mouse attached to the KVM? Can you point out if ione of the hubs listed is the KVM itself?

 

That information would be useful.

 

Do you have the KVM switched to your VM when you are booting unRAID? When you are booting the VM? What exactly are you attempting to pass through to the VM? (a screengrab of your VM config would be useful, particularly the bottom section that shows USB and PCI device passthrough).

 

I use KVMs with VMs myself and they work fine, but I always have a dedicated USB adapter passed through to the VM and have the KVM attached to that. This facilitates native device hot swapping inside the VM and works much much better than trying to get an unRAID device working.

 

 

 

I have a  4 port HDMI/keybord/mouse switch. keyboard en mouse and a hdmi cable connected to the switch and than KB/mouse are connect via 1 cable to the PC and 1 to the unraid server and both have a own HDMI cable.

 

Group 3 00:14.08086:8cb1USB controller: Intel Corporation 9 Series Chipset Family USB xHCI Controller

USB devices attached to this controller:

Bus 003 Device 008: ID 09eb:0131 IM Networks, Inc.

Bus 003 Device 007: ID 047d:1020 Kensington Expert Mouse Trackball

Bus 003 Device 006: ID 09ea:0130

Bus 003 Device 004: ID 05e3:0610 Genesys Logic, Inc. 4-port hub

Bus 003 Device 002: ID 1b1c:0c03 Corsair H100iGTX Cooler

Bus 003 Device 005: ID 058f:6387 Alcor Micro Corp. Flash Drive

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

Bus 004 Device 002: ID 05e3:0612 Genesys Logic, Inc. Hub

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

 

691116214_Screenshotfrom2020-05-1921-43-27.png.51d2ff23855883c0721ffed01e418901.png

 

the mouse is the kensington

the keyboard it self i dont see. but the switch seems to be the IM nbetworks. because that is the one i see on teh VM's also

it works fine on my standalone PC.

 

yes the switch is always connected also when im booting the Unraid server. When i go to the bios of the server it all works fine.

 

but once i start a VM i tried windows and LInux both only the mouse works but only when set to USB 3.0 if i use usb 2.0  on the settings page both arnt working.

 

i do have more usb controllers it seems but cant figure out which is that.

 

USB controller: Intel Corporation 9 Series Chipset Family USB EHCI Controller #2

USB devices attached to this controller:

Bus 001 Device 002: ID 8087:8009 Intel Corp.

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

 

when i start the VM and check the log it seems to say this

 

2020-05-19T19:56:53.194611Z qemu-system-x86_64: libusb_release_interface: -4 [NO_DEVICE]
2020-05-19T19:56:53.194620Z qemu-system-x86_64: libusb_release_interface: -4 [NO_DEVICE]
libusb: error [_open_sysfs_attr] open /sys/bus/usb/devices/3-9.1.6/bConfigurationValue failed ret=-1 errno=2
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind

 

Link to comment
11 hours ago, KoNeko said:

I have a  4 port HDMI/keybord/mouse switch. keyboard en mouse and a hdmi cable connected to the switch and than KB/mouse are connect via 1 cable to the PC and 1 to the unraid server and both have a own HDMI cable.

 

Group 3 00:14.08086:8cb1USB controller: Intel Corporation 9 Series Chipset Family USB xHCI Controller

USB devices attached to this controller:

Bus 003 Device 008: ID 09eb:0131 IM Networks, Inc.

Bus 003 Device 007: ID 047d:1020 Kensington Expert Mouse Trackball

Bus 003 Device 006: ID 09ea:0130

Bus 003 Device 004: ID 05e3:0610 Genesys Logic, Inc. 4-port hub

Bus 003 Device 002: ID 1b1c:0c03 Corsair H100iGTX Cooler

Bus 003 Device 005: ID 058f:6387 Alcor Micro Corp. Flash Drive

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

Bus 004 Device 002: ID 05e3:0612 Genesys Logic, Inc. Hub

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

 

691116214_Screenshotfrom2020-05-1921-43-27.png.51d2ff23855883c0721ffed01e418901.png

 

the mouse is the kensington

the keyboard it self i dont see. but the switch seems to be the IM nbetworks. because that is the one i see on teh VM's also

it works fine on my standalone PC.

 

yes the switch is always connected also when im booting the Unraid server. When i go to the bios of the server it all works fine.

 

but once i start a VM i tried windows and LInux both only the mouse works but only when set to USB 3.0 if i use usb 2.0  on the settings page both arnt working.

 

i do have more usb controllers it seems but cant figure out which is that.

 

USB controller: Intel Corporation 9 Series Chipset Family USB EHCI Controller #2

USB devices attached to this controller:

Bus 001 Device 002: ID 8087:8009 Intel Corp.

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

 

when i start the VM and check the log it seems to say this

 

2020-05-19T19:56:53.194611Z qemu-system-x86_64: libusb_release_interface: -4 [NO_DEVICE]
2020-05-19T19:56:53.194620Z qemu-system-x86_64: libusb_release_interface: -4 [NO_DEVICE]
libusb: error [_open_sysfs_attr] open /sys/bus/usb/devices/3-9.1.6/bConfigurationValue failed ret=-1 errno=2
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind
libusb: error [udev_hotplug_event] ignoring udev action bind

 

It's odd that the mouse shows up like that, but the keyboard does not.

 

I would strongly advise that you figure out which physical ports are attached to the other controller and pass that controller through. First, you'd need to plug a uniquely named device (say, a usb thumb drive) into each port in turn and observe in your devices list what controller its appearing under. Then, assuming there's nothing else on this controller, and its in its own IOMMU group, use the VFIO-Config plugin to select it for passthrough and reboot. You will then be able to pass the entire controller through to the VM, and plug your KVM into one of those ports. You'll likely find this a much more reliable set up.

 

Bear in mind that some of the ports attached to the controller may be your internal motherboard USB headers.

 

Link to comment
On 5/20/2020 at 7:53 AM, meep said:

It's odd that the mouse shows up like that, but the keyboard does not.

 

I would strongly advise that you figure out which physical ports are attached to the other controller and pass that controller through. First, you'd need to plug a uniquely named device (say, a usb thumb drive) into each port in turn and observe in your devices list what controller its appearing under. Then, assuming there's nothing else on this controller, and its in its own IOMMU group, use the VFIO-Config plugin to select it for passthrough and reboot. You will then be able to pass the entire controller through to the VM, and plug your KVM into one of those ports. You'll likely find this a much more reliable set up.

 

Bear in mind that some of the ports attached to the controller may be your internal motherboard USB headers.

 

all ports i checked seems to be the same controller.

 

So best case might be a extra USB card in there. But also need to check on that. Because i have a GPU in there and a SAS card for 8 extra sata.

not sure if i add an extra card will impact the performance negatively.

 

While the server is a i7 4790k. Might upgrade maybe this year to a new system. A ryzen one.

Link to comment
  • 1 year later...
6 minutes ago, curtis-r said:

My Intel i3-4170 does not support VT-d (but does VT-x, as VM works fine).  Does this mean I cannot passthrough a USB-serial device to my Home Assistant VM?

You should be able to passthru a usb dev just not passthru a pcie usb card.

Link to comment
On 5/20/2020 at 8:53 AM, meep said:

It's odd that the mouse shows up like that, but the keyboard does not.

 

I would strongly advise that you figure out which physical ports are attached to the other controller and pass that controller through. First, you'd need to plug a uniquely named device (say, a usb thumb drive) into each port in turn and observe in your devices list what controller its appearing under. Then, assuming there's nothing else on this controller, and its in its own IOMMU group, use the VFIO-Config plugin to select it for passthrough and reboot. You will then be able to pass the entire controller through to the VM, and plug your KVM into one of those ports. You'll likely find this a much more reliable set up.

 

Bear in mind that some of the ports attached to the controller may be your internal motherboard USB headers.

 

It may be when you switch a disconnect happens and the bus and dev are updated.

 

Mapped usb devices only get mapped at vm start.

 

Have a look at my usbip gui plug as can auto connect usb devices.

Link to comment
26 minutes ago, SimonF said:

You should be able to passthru a usb dev just not passthru a pcie usb card.

Good news, but though longtime unraid user, this is my first attempt at pass-through.   Should it just show up after a reboot, because it doesn't.   Thanks

Link to comment
7 minutes ago, curtis-r said:

Good news, but though longtime unraid user, this is my first attempt at pass-through.   Should it just show up after a reboot, because it doesn't.   Thanks

Where doesn't it show in the VM template? Does the USB device show in lsusb?

Link to comment
7 minutes ago, curtis-r said:

Does this help? It doesn't appear to show in the devices because if I unplug it & re-run the command, it's the same.  The 2nd photo is my Home Assistant VM settings.

 

chrome_dQjtVvdzo9.png

chrome_WKvQxddatC.png

For some reason the host is not seeing the usb device any syslog or dmesg when you plug it in?

Link to comment

Ok, so sorry for wasting everyone's time.  It must be something with my USB-serial device, because I just tried a USB mouse and it shows.  Win10 also has some issue with my USB-serial device.  Will get another one.  Thanks for the effort.

 

EDIT: found a different USB-serial laying around and it shows up! 

chrome_DMpIkvvOoB.png

Edited by curtis-r
  • Like 1
Link to comment
  • 2 weeks later...

Ended up having another (working) USB-serial device laying around, but now have a new issue:

 

Device shows up in unraid terminal.  It's the PL2303

1368801577_unraidterminal.jpg.203ad96ce6450cb1ec1a5824b52f3eea.jpg

 

It shows up in my Home Assistant VM settings:

1588496737_vmusb.jpg.f50ab56dfd4bd083f485804aa5ebe713.jpg

 

But it doesn't show up within my Home Assistant VM terminal:

2043793938_home_assistantterminal.jpg.48357e4b0ee4756a164c164dbb234909.jpg

 

Any ideas?

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.