# KVM (qemu) passthrough USB3 device not working



## tbyte (Apr 14, 2016)

I have a KVM (qemu) host passing through an USB3 device like this `usb0: host=04e8:6124,usb3=yes`.
And when the guest FreeBSD try to attach the device this happens:

```
Apr 14 00:09:41 FSSC kernel: usbus1: 5.0Gbps Super Speed USB v3.0
Apr 14 00:09:41 FSSC kernel: ugen1.1: <0x1033> at usbus1
Apr 14 00:09:41 FSSC kernel: uhub1: <0x1033 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
```
...

```
Apr 14 00:25:33 FSSC kernel: usbd_setup_device_desc: getting device descriptor at addr 1 failed, USB_ERR_TIMEOUT
 Apr 14 00:26:00 FSSC last message repeated 4 times
 Apr 14 00:26:00 FSSC kernel: ugen1.2: <Unknown> at usbus1 (disconnected)
 Apr 14 00:26:00 FSSC kernel: uhub_reattach_port: could not allocate new device
```

and the USB hub is supposed to be "nec-usb-xhci" but I'm not really sure if qemu emulates NEC's USB hub good enough or if it's supported under FreeBSD.
Any idea if it is possible to get it working or it's not possible currently ?

Regards.


----------



## Mactive (Apr 25, 2016)

Hello,

I'm having a problem with passthrough of USB storage devices to a clean install of FreeBSD10.3. This is running as a VM in the latest proxmox virtual environment (QEMU emulator version 2.5.1 pve-qemu-kvm_2.5-13).

I had passthrough of storage devices working a few months ago on a previous version of qemu-kvm. Didn't record exactly which version since I haven't used this VM in a while.

USB Passthrough works without issues to my other Windows and Debian VMs.

USB Passthrough of keyboard/mouse works to the FreeBSD10.3 VM using the same ports that show problems when trying storage devices.

Logs below when connecting a USB storage device. I have tried a few different brand USB drives and a usb to CF reader as well.
While the USB storage device is connected commands like 'gpart show' hang until the device is disconnected.
I have also tested a different USB hub and connecting direct to host usb port.

```
Apr 22 17:42:47 FreeBSD103 kernel: ugen1.2: <Sunplus Innovation Technology.> at usbus1
Apr 22 17:42:47 FreeBSD103 kernel: umass0: <Bulk Only Interface> on usbus1
Apr 22 17:42:47 FreeBSD103 kernel: umass0: SCSI over Bulk-Only; quirks = 0xc101
Apr 22 17:42:47 FreeBSD103 kernel: umass0:2:0:-1: Attached to scbus2
Apr 22 17:42:50 FreeBSD103 kernel: da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
Apr 22 17:42:50 FreeBSD103 kernel: da0: <TS4GCF13 3 > Fixed Direct Access SPC-2 SCSI device
Apr 22 17:42:50 FreeBSD103 kernel: da0: 1.000MB/s transfers
Apr 22 17:42:50 FreeBSD103 kernel: da0: 3823MB (7831152 512 byte sectors)
Apr 22 17:42:50 FreeBSD103 kernel: da0: quirks=0x2<NO_6_BYTE>
Apr 22 17:42:50 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 77 7e 6f 00 00 01 00
Apr 22 17:42:50 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
Apr 22 17:42:50 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): Retrying command
Apr 22 17:42:51 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 77 7e 6f 00 00 01 00
Apr 22 17:42:51 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
Apr 22 17:42:51 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): Retrying command
Apr 22 17:42:51 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 77 7e 6f 00 00 01 00
Apr 22 17:42:51 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
Apr 22 17:42:51 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): Retrying command
Apr 22 17:42:52 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 77 7e 6f 00 00 01 00
Apr 22 17:42:52 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
Apr 22 17:42:52 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): Retrying command
Apr 22 17:42:53 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 77 7e 6f 00 00 01 00
Apr 22 17:42:53 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
Apr 22 17:42:53 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): Error 5, Retries exhausted
Apr 22 17:42:53 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 77 7e 6f 00 00 01 00
Apr 22 17:42:53 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
Apr 22 17:42:53 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): Retrying command

-snip-
(manually disconnected USB)

Apr 22 17:43:08 FreeBSD103 kernel: ugen1.2: <Sunplus Innovation Technology.> at usbus1 (disconnected)
Apr 22 17:43:08 FreeBSD103 kernel: umass0: at uhub1, port 1, addr 2 (disconnected)
Apr 22 17:43:08 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 00 77 7e 6e 00 00 01 00
Apr 22 17:43:08 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): CAM status: CCB request completed with an error
Apr 22 17:43:08 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): Retrying command
Apr 22 17:43:08 FreeBSD103 kernel: da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
Apr 22 17:43:08 FreeBSD103 kernel: da0: <TS4GCF13 3 > detached
Apr 22 17:43:08 FreeBSD103 kernel: (da0:umass-sim0:0:0:0): Periph destroyed
```
Any help is much appreciated.

Edit: I see my thread was merged in. I should note my problem is not with USB 3.0 (which can be another beast completely to get working). I am using USB 2.0 passthrough.


----------



## Mactive (Apr 26, 2016)

tbyte said:


> I have a KVM (qemu) host passing through an USB3 device like this `usb0: host=04e8:6124,usb3=yes`.
> And when the guest FreeBSD try to attach the device this happens:
> 
> ```
> ...



Are you able to get USB2.0 passthrough working?


----------



## Mactive (May 3, 2016)

tbyte Any luck with usb 2.0?


----------

