USB block device not detected

Hi all, I’m having issues getting USB block devices to appear in the qubes devices widget.

Versions of Qubes tried 4.0.4 and 4.1.0-rc3 ( problem’s with usb controllers and usb block devices are the same )

My computer ( HP elitebook 9470m 16GB Ram)
HP Specs
Linked specs page above states that all 3 usb ports are ver 3.0

This error appears just before initial login.

【Dom0】error ‘systemctl’,’start’,’qubes-vm@sys-usb.service’ failed:stdout 

Same error as on this qubes forum thread
Link
… And yes I did have a good look at that page and found no solution.

Ok…
So having a look at the USB Troubleshooting page, seems that USB 3.0 ports can cause problems.

Most relevent problem in USB Troubleshooting is:
USB VM does not boot after creating and assigning USB controllers to it

I had a look in my bios but failed to find anything more promising than USB Legacy Support, which was already ticked.

sys-usb will start if I remove the three usb controller devices added during installation.

From the USB Troubleshootin page.
If the BIOS does not have the option to disable USB 3.0, try running the following command in dom0 to force USB 2.0 modes for the USB ports:

lspci -nn | grep USB | cut -d '[' -f3 | cut -d ']' -f1 | xargs -I@ setpci -H1 -d @ d0.l=0
setpci: No permission to access I/O ports (you probably have to be root).
setpci: No permission to access I/O ports (you probably have to be root).
setpci: No permission to access I/O ports (you probably have to be root).

so run as root, sudo produced the same hint to be root

sudo su
lspci -nn | grep USB | cut -d '[' -f3 | cut -d ']' -f1 | xargs -I@ setpci -H1 @ d0.1=0
setpci: Filter specification expected.
Try `setpci --help' for more information.
setpci: Filter specification expected.
Try `setpci --help' for more information.
setpci: Filter specification expected.
Try `setpci --help' for more information.

hmmm looks like there’s an issue here, possibly with device names…

Discovering my USB controllers

lspci -nn | grep USB
00:14.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller [8086:1e31] (rev 04)
00:1a.0 USB controller [0c03]: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #2 [8086:1e2d] (rev 04)
00:1d.0 USB controller [0c03]: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #1 [8086:1e26] (rev 04)

thanks to google it seems like USB 3.0 controllers can be identified with the above command by the xHCI designation ( Please correct me if I’m wrong )

As root…

setpci -v -H1 -d 8086:1e31 d0.l=0
0000:00:14.0 @d0 00000000

setpci -v -H1 -d 8086:1e31 d8.l=0
0000:00:14.0 @d8 00000000

Trying to add device to sys-usb vm and start…

qvm-pci attach -v --persistent sys-usb dom0:00_14.0

qvm-start -v sys-usb
Start failed: internal error: Unable to reset PCI device 0000:00:14.0: no FLR, PM reset or bus reset available, see /var/log/libvirt/libxl/libxl-driver.log for details

qvm-pci detach -v sys-usb dom0:00_14.0

qvm-pci attach -v --persistent --option no-strict-reset=true sys-usb dom0:00_14.0

qvm-start -v sys-usb
Start failed: internal error: Unable to reset PCI device 0000:00:14.0: internal error: libxenlight failed to create new domain 'sys-usb', see /var/log/libvirt/libxl/libxl-driver.log for details

/var/log/libvirt/libxl/libxl-driver.log

2021-12-31 08:11:29.640+0000: libxl: libxl_pci.c:1202:libxl__device_pci_reset: The kernel doesn't support reset from sysfs for PCI device 0000:00:14.0
2021-12-31 08:12:30.044+0000: libxl: libxl_exec.c:226:libxl__xenstore_child_wait_deprecated: Device Model not ready
2021-12-31 08:12:30.047+0000: libxl: libxl_pci.c:1016:qemu_pci_add_xenstore: qemu refused to add device: 0000:00:14.0,msitranslate=0,power_mgmt=0
2021-12-31 08:12:30.048+0000: libxl: libxl_pci.c:1364:libxl__add_pcidevs: libxl_device_pci_add failed: -3
2021-12-31 08:12:30.049+0000: libxl: libxl_create.c:1517:domcreate_attach_devices: unable to add pci devices
2021-12-31 08:12:30.061+0000: libxl: libxl_pci.c:1202:libxl__device_pci_reset: The kernel doesn't support reset from sysfs for PCI device 0000:00:14.0

That will do for now, I have another 2 usb controllers to test, one of which enables the laptop camera.
Comments and suggestions welcome.

1 Like

Does creating separate sys-usb for xHCI controller in PV mode helps?

Hi enmus, and thanks for your input.

I created a new qube sys-usb3 and set to PV mode.

Assigned usb 3.0 controller to it

qvm-pci attach -v --persistent --option no-strict-reset=true sys-usb3 dom0:00_14.0

sys-usb3 qube starts without issue.

Inserting a USB Block device to any of the three USB 3.0 ports makes it available to the Qubes Devices widge.

Assigning a usb block device to my untrusted domain makes the device available but READ ONLY to the untrusted Files app.

dom0:00_14.0 is USB 3.0, assigned to sys-usb3 qube with PV mode.
dom0:00_1a.0 is the laptops webcam, assigned to sys-usb standard qube.
dom0:00_1d.0 function is as yet unidentified. If I attach it to sys-usb the webcam becomes unavailable. So I attached it to sys-usb3 and it appears in the Qubes Devices widget as sys-usb3:1-1.6 - 8087_07da I think it might be for the SD card port. I’ll test that as soon as I get my hands on an SD card.

Bluetooth (Broadcom Corp)?