QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
541 stars 48 forks source link

USB device attach fails with attach timeout #7745

Open marcoboehrs opened 2 years ago

marcoboehrs commented 2 years ago

Qubes OS release

4.1.1 (R4.1)

Brief summary

When i try to attach my HackRF to any vm, i get an timeout-error. In GUI and CLI:

[user@dom0 ~] qvm-usb
sys-usb:2-10  8087_0026                                                        
sys-usb:2-2   Chicony_Electronics_Co._Ltd._HP_HD_Camera_200901010001           
sys-usb:2-4   Great_Scott_Gadgets_HackRF_One_000000000000000075b068dc3253b707  
sys-usb:2-7   06cb_00df_a49f84fb3646                                           
[user@dom0 ~]$ qvm-usb attach personal sys-usb:2-4 
Device attach failed: Attach timeout, check kernel log for details. VM: "personal" File: "/usr/lib/qubes/usb-import" Version Control: https://github.com/QubesOS/qubes-app-linux-usb-proxy/blob/master/src/usb-import

The device works on other Linux PCs without problems. Other devices are working.

I found and old issue regarding this behavior (5997) which was solved by using an old kernel 4.19.147 which is not an option for me. My sys-usb cube uses kernel 5.15.63-1.fc32

Steps to reproduce

  1. Attach the USB device
  2. Wait for it to be recognized by sys-usb
  3. Attach it to an AppVM via GUI or CLI

Expected behavior

A connected USB Device / HackRF in my AppVM

Actual behavior

Timeout Error

exotime commented 1 year ago

Same occurs for me. Tried two different cables, and two different USB buses (USB 2.0 and USB 3.0 - same result). Also tried connecting to a Fedora 37 DVM and a Debian 11.7 DVM, same result as OP.

dmesg from sys-usb:

[  782.802759] usb 1-2.4: new high-speed USB device number 4 using xhci_hcd
[  782.899245] usb 1-2.4: New USB device found, idVendor=1d50, idProduct=6089, bcdDevice= 1.04
[  782.899272] usb 1-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=4
[  782.899291] usb 1-2.4: Product: HackRF One
[  782.899302] usb 1-2.4: Manufacturer: Great Scott Gadgets
[  782.899315] usb 1-2.4: SerialNumber: (redacted)
[  801.513756] usbip-host 1-2.4: usbip-host: register new device (bus 1 dev 4)
[  801.518348] usbip-host 1-2.4: stub up
[  801.739125] usbip-host 1-2.4: urb completion with non-zero status -71
[  801.739548] usbip-host 1-2.4: urb completion with non-zero status -71
[  801.740424] usbip-host 1-2.4: urb completion with non-zero status -71
[  801.961048] usbip-host 1-2.4: urb completion with non-zero status -71
[  801.961672] usbip-host 1-2.4: urb completion with non-zero status -71
[  801.962170] usbip-host 1-2.4: urb completion with non-zero status -71
[  802.299044] usbip-host 1-2.4: urb completion with non-zero status -71
[  802.299666] usbip-host 1-2.4: urb completion with non-zero status -71
[  802.300165] usbip-host 1-2.4: urb completion with non-zero status -71
[  802.521042] usbip-host 1-2.4: urb completion with non-zero status -71
[  802.521539] usbip-host 1-2.4: urb completion with non-zero status -71
[  802.522037] usbip-host 1-2.4: urb completion with non-zero status -71
[  802.875104] usbip-host 1-2.4: urb completion with non-zero status -71
[  802.875657] usbip-host 1-2.4: urb completion with non-zero status -71
[  802.876157] usbip-host 1-2.4: urb completion with non-zero status -71
[  802.997033] usbip-host 1-2.4: urb completion with non-zero status -71
[  802.997657] usbip-host 1-2.4: urb completion with non-zero status -71
[  802.998156] usbip-host 1-2.4: urb completion with non-zero status -71
[  803.231031] usbip-host 1-2.4: urb completion with non-zero status -71
[  803.231652] usbip-host 1-2.4: urb completion with non-zero status -71
[  803.232248] usbip-host 1-2.4: urb completion with non-zero status -71
[  803.350029] usbip-host 1-2.4: urb completion with non-zero status -71
[  803.350526] usbip-host 1-2.4: urb completion with non-zero status -71
[  803.351026] usbip-host 1-2.4: urb completion with non-zero status -71
[  806.552742] usbip-host 1-2.4: recv a header, 0
[  806.634767] usbip-host 1-2.4: reset high-speed USB device number 4 using xhci_hcd
[  811.747798] usbip-host 1-2.4: device firmware changed
[  811.748080] usbip-host 1-2.4: device reset
[  811.749077] usbip-host 1-2.4: USB disconnect, device number 4
[  811.830722] usb 1-2.4: new high-speed USB device number 5 using xhci_hcd
[  816.949762] usb 1-2.4: device descriptor read/64, error -110
[  822.581734] usb 1-2.4: device descriptor read/64, error -71
[  822.765710] usb 1-2.4: new high-speed USB device number 6 using xhci_hcd
[  828.213740] usb 1-2.4: device descriptor read/64, error -110
[  833.845742] usb 1-2.4: device descriptor read/64, error -71
[  833.947929] usb 1-2-port4: attempt power cycle
[  834.551724] usb 1-2.4: new high-speed USB device number 7 using xhci_hcd
[  839.907758] xhci_hcd 0000:00:06.0: Timeout while waiting for setup device command
[  845.539742] xhci_hcd 0000:00:06.0: Timeout while waiting for setup device command
[  845.747726] usb 1-2.4: device not accepting address 7, error -62
[  845.829724] usb 1-2.4: new high-speed USB device number 8 using xhci_hcd
[  851.171745] xhci_hcd 0000:00:06.0: Timeout while waiting for setup device command
[  856.803755] xhci_hcd 0000:00:06.0: Timeout while waiting for setup device command
[  857.011713] usb 1-2.4: device not accepting address 8, error -62
[  857.012082] usb 1-2-port4: unable to enumerate USB device

dmesg from Fedora 37 DVM showing reset:

[   13.073168] vhci_hcd vhci_hcd.0: USB/IP Virtual Host Controller
[   13.073222] vhci_hcd vhci_hcd.0: new USB bus registered, assigned bus number 1
[   13.073251] vhci_hcd: created sysfs vhci_hcd.0
[   13.073291] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.15
[   13.073316] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   13.073337] usb usb1: Product: USB/IP Virtual Host Controller
[   13.073356] usb usb1: Manufacturer: Linux 5.15.103-1.qubes.fc32.x86_64 vhci_hcd
[   13.073379] usb usb1: SerialNumber: vhci_hcd.0
[   13.074115] hub 1-0:1.0: USB hub found
[   13.074134] hub 1-0:1.0: 8 ports detected
[   13.074357] vhci_hcd vhci_hcd.0: USB/IP Virtual Host Controller
[   13.074429] vhci_hcd vhci_hcd.0: new USB bus registered, assigned bus number 2
[   13.074462] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[   13.074499] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.15
[   13.074518] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   13.074536] usb usb2: Product: USB/IP Virtual Host Controller
[   13.074550] usb usb2: Manufacturer: Linux 5.15.103-1.qubes.fc32.x86_64 vhci_hcd
[   13.074573] usb usb2: SerialNumber: vhci_hcd.0
[   13.075947] hub 2-0:1.0: USB hub found
[   13.076004] hub 2-0:1.0: 8 ports detected
[   13.389632] vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(0)
[   13.389658] vhci_hcd vhci_hcd.0: devid(65545) speed(3) speed_str(high-speed)
[   13.389684] vhci_hcd vhci_hcd.0: Device attached
[   13.610836] usb 1-1: new high-speed USB device number 2 using vhci_hcd
[   13.726830] usb 1-1: device descriptor read/64, error -71
[   13.947881] usb 1-1: device descriptor read/64, error -71
[   14.170869] usb 1-1: new high-speed USB device number 3 using vhci_hcd
[   14.285829] usb 1-1: device descriptor read/64, error -71
[   14.507834] usb 1-1: device descriptor read/64, error -71
[   14.616840] usb usb1-port1: attempt power cycle
[   14.734827] usb 1-1: new high-speed USB device number 4 using vhci_hcd
[   14.734850] usb 1-1: SetAddress Request (4) to port 0
[   14.748700] usb 1-1: device descriptor read/8, error -71
[   14.870570] usb 1-1: device descriptor read/8, error -71
[   15.090829] usb 1-1: new high-speed USB device number 5 using vhci_hcd
[   15.090852] usb 1-1: SetAddress Request (5) to port 0
[   15.104581] usb 1-1: device descriptor read/8, error -71
[   15.222431] usb 1-1: device descriptor read/8, error -71
[   15.328840] usb usb1-port1: unable to enumerate USB device
[   18.429918] vhci_hcd: connection closed
[   18.429945] vhci_hcd: stop threads
[   18.429968] vhci_hcd: release socket
[   18.429978] vhci_hcd: disconnect device

Qubes versions:

xen_version            : 4.14.5
Linux 6.2.10-1.qubes.fc32.x86_64

Installed Packages:  

grub2-qubes-theme.x86_64                            5.14.4-2.fc32 
kernel-qubes-vm.x86_64                              1000:5.15.94-1.qubes.fc32 
kernel-qubes-vm.x86_64                              1000:5.15.103-1.qubes.fc32 
python3-qubesadmin.noarch                           4.1.27-1.fc32 
python3-qubesdb.x86_64                              4.1.16-1.fc32 
python3-qubesimgconverter.x86_64                    4.1.19-1.fc32 
qubes-anaconda-addon.noarch                         4.1.11-1.fc32 
qubes-artwork.noarch                                4.1.15-1.fc32 
qubes-artwork-anaconda.noarch                       4.1.15-1.fc32 
qubes-artwork-plymouth.noarch                       4.1.15-1.fc32 
qubes-audio-daemon.x86_64                           4.1.26-1.fc32 
qubes-audio-dom0.x86_64                             4.1.26-1.fc32 
qubes-core-admin-addon-whonix.noarch                4.1.1-1.fc32 
qubes-core-admin-client.noarch                      4.1.27-1.fc32 
qubes-core-dom0.noarch                              4.1.30-1.fc32 
qubes-core-dom0-linux.x86_64                        4.1.23-1.fc32 
qubes-core-dom0-linux-kernel-install.x86_64         4.1.23-1.fc32 
qubes-core-qrexec.x86_64                            4.1.20-1.fc32 
qubes-core-qrexec-dom0.x86_64                       4.1.20-1.fc32 
qubes-core-qrexec-libs.x86_64                       4.1.20-1.fc32 
qubes-db.x86_64                                     4.1.16-1.fc32 
qubes-db-dom0.x86_64                                4.1.16-1.fc32 
qubes-db-libs.x86_64                                4.1.16-1.fc32 
qubes-desktop-linux-common.noarch                   4.1.14-1.fc32 
qubes-desktop-linux-manager.noarch                  4.1.15-1.fc32 
qubes-dom0-meta-packages.noarch                     4.1.21-1.fc32 
qubes-gpg-split-dom0.x86_64                         2.0.66-1.fc32 
qubes-gui-daemon.x86_64                             4.1.26-1.fc32 
qubes-gui-dom0.x86_64                               4.1.26-1.fc32 
qubes-img-converter-dom0.x86_64                     1.2.15-1.fc32 
qubes-input-proxy.x86_64                            1.0.31-1.fc32 
qubes-input-proxy-receiver.x86_64                   1.0.31-1.fc32 
qubes-input-proxy-sender.x86_64                     1.0.31-1.fc32 
qubes-kernel-vm-support.x86_64                      4.1.19-1.fc32 
qubes-libvchan-xen.x86_64                           4.1.13-1.fc32 
qubes-manager.noarch                                4.1.28-1.fc32 
qubes-menus.noarch                                  4.1.14-1.fc32 
qubes-mgmt-salt.noarch                              4.1.16-1.fc32 
qubes-mgmt-salt-admin-tools.noarch                  4.1.16-1.fc32 
qubes-mgmt-salt-base.noarch                         4.1.5-1.fc32 
qubes-mgmt-salt-base-config.noarch                  4.1.1-1.fc32 
qubes-mgmt-salt-base-topd.noarch                    4.1.3-1.fc32 
qubes-mgmt-salt-config.noarch                       4.1.16-1.fc32 
qubes-mgmt-salt-dom0.noarch                         4.1.16-1.fc32 
qubes-mgmt-salt-dom0-qvm.noarch                     4.1.4-1.fc32 
qubes-mgmt-salt-dom0-update.noarch                  4.1.10-1.fc32 
qubes-mgmt-salt-dom0-virtual-machines.noarch        4.1.19-1.fc32 
qubes-pdf-converter-dom0.x86_64                     2.1.16-1.fc32 
qubes-release.noarch                                4.1-3.fc32 
qubes-release-notes.noarch                          4.1-3.fc32 
qubes-repo-templates.noarch                         4.1.2-1.fc32 
qubes-rpm-oxide.x86_64                              0.2.6-1.fc32 
qubes-usb-proxy-dom0.noarch                         1.1.4-1.fc32 
qubes-utils.x86_64                                  4.1.19-1.fc32 
qubes-utils-libs.x86_64                             4.1.19-1.fc32 
qubes-windows-tools.noarch                          4.1.68-1 
xfce4-settings-qubes.x86_64                         4.0.5-2.fc32

Hope this information helps.

rysiekpl commented 1 year ago

I am having a similar issue with Fairphone 4. Tried two different cables. Used one of these cables successfully on a different machine with a regular GNU/Linux system to reimage the phone, so the cable seems fine.

Cable 1

dmesg in sys-usb:

[  114.867812] usb 2-2: new high-speed USB device number 6 using xhci_hcd
[  114.997939] usb 2-2: New USB device found, idVendor=18d1, idProduct=4ee7, bcdDevice= 4.19
[  114.997965] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  114.997985] usb 2-2: Product: Fairphone 4 5G
[  114.997998] usb 2-2: Manufacturer: Fairphone
[  114.998011] usb 2-2: SerialNumber: a7096c5d

after qvm-usb attach...

[  133.403069] usbip-host 2-2: usbip-host: register new device (bus 2 dev 6)
[  133.409203] usbip-host 2-2: stub up
[  133.523221] usbip-host 2-2: USB disconnect, device number 6
[  133.523369] usbip-host 2-2: recv a header, 0
[  133.959203] usb 2-2: new high-speed USB device number 7 using xhci_hcd
[  134.096227] usb 2-2: New USB device found, idVendor=18d1, idProduct=4ee7, bcdDevice= 4.19
[  134.096251] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  134.096268] usb 2-2: Product: Fairphone 4 5G
[  134.096279] usb 2-2: Manufacturer: Fairphone
[  134.096296] usb 2-2: SerialNumber: a7096c5d

dmesg in the target fp4 cube:

[ 4217.771671] vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(0)
[ 4217.771690] vhci_hcd vhci_hcd.0: devid(131078) speed(3) speed_str(high-speed)
[ 4217.771708] vhci_hcd vhci_hcd.0: Device attached
[ 4217.885362] vhci_hcd: connection closed
[ 4217.885605] vhci_hcd: stop threads
[ 4217.885625] vhci_hcd: release socket
[ 4217.885638] vhci_hcd: disconnect device
[ 4217.936017] vhci_hcd: vhci_device speed not set
[ 4222.900656] vhci_hcd: not connected 4

Cable 2

dmesg in the target fp4 cube:

[   65.660034] vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(0)
[   65.660050] vhci_hcd vhci_hcd.0: devid(196611) speed(5) speed_str(super-speed)
[   65.660069] vhci_hcd vhci_hcd.0: Device attached
[   65.900288] usb 2-1: SetAddress Request (6) to port 0
[   65.900306] usb 2-1: new SuperSpeed USB device number 6 using vhci_hcd
[   65.912585] vhci_hcd: connection closed
[   65.912650] vhci_hcd: stop threads
[   65.912666] vhci_hcd: release socket
[   65.912674] vhci_hcd: disconnect device
[   70.750077] vhci_hcd: not connected 4
[   71.202479] usb 2-1: device descriptor read/8, error -110
[   71.306416] usb 2-1: new SuperSpeed USB device number 6 using vhci_hcd
[   71.318372] usb 2-1: enqueue for inactive port 0
[   71.318453] usb 2-1: enqueue for inactive port 0
[   71.318494] usb 2-1: enqueue for inactive port 0
[   72.314379] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[   72.314404] usb usb2-port1: attempt power cycle
bakeromso commented 7 months ago

Affects 4.2 as well. I have another Great Scott Gadgets device, the GreatFET one, which has the same problem.

In sys-usb, uname -r gives 6.7.7-1.qubes.fc37.x86_64