qubes-doc/user/troubleshooting/usb-troubleshooting.md

107 lines
6.2 KiB
Markdown
Raw Normal View History

2020-10-18 06:44:45 -04:00
---
lang: en
2020-10-18 06:44:45 -04:00
layout: doc
permalink: /doc/usb-troubleshooting/
ref: 234
title: USB troubleshooting
2020-10-18 06:44:45 -04:00
---
## disp-sys-usb does not start
If the disp-sys-usb does not start, it could be due to a PCI passthrough problem.
2020-10-18 06:44:45 -04:00
For more details on this issue along with possible solutions, look at [PCI passthrough issues](/doc/pci-troubleshooting/#pci-passthrough-issues).
## Can't attach a USB device / USB device not showing in qvm-usb
2020-10-18 06:44:45 -04:00
To successfully attach a USB device, you require a VM dedicated to handling the USB input and output.
2021-06-17 10:01:53 -04:00
For guidance setting up a USB qube, see the [USB documentation](/doc/how-to-use-usb-devices/#creating-and-using-a-usb-qube).
2020-10-18 06:44:45 -04:00
Currently (until issue [1082](https://github.com/QubesOS/qubes-issues/issues/1082) gets implemented), if you remove the device before detaching it from the qube, Qubes OS (more precisely, `libvirtd`) will think that the device is still attached to the qube and will not allow attaching further devices under the same name.
2020-10-18 07:24:24 -04:00
This may be characterized by VM manager crashes and the error message: `Houston, we have a problem`.
2020-10-18 06:44:45 -04:00
The easiest way to recover from such a situation is to reboot the qube to which the device was attached.
2021-06-17 10:01:53 -04:00
If this isn't an option, you can manually recover from the situation by following the instructions at the [Block Devices documentation](/doc/how-to-use-block-storage-devices/#what-if-i-removed-the-device-before-detaching-it-from-the-vm)
2020-10-19 09:54:56 -04:00
## "Device attach failed" error
Upon trying to attach a USB device using the `qvm-usb -a vm-name device-vm-name:device` command, you may face the error `Device attach failed: no device info received, connection failed, check backend side for details`.
2020-10-19 09:56:52 -04:00
This error mainly arises due to problems specific to the particular device, such as the device being incompatible with qvm-usb or a broken cable.
2020-10-18 06:44:45 -04:00
2021-01-02 19:09:26 -05:00
## Attaching device to a qube works, but the device disconnects or disappears upon usage
After attaching a device to a qube, upon attempting to use the device results in the device disappearing or disconnecting. This may be observed by the device no longer existing in the Devices widget or the application within the attached qube indicating the device is no longer found.
As a first line of defense, increase the amount of memory given to the USB VM (sys-usb). High-bandwidth devices such as webcams have been [observed](https://github.com/QubesOS/qubes-issues/issues/6200) to need more memory in sys-usb. If increasing the amount of memory does not resolve the issue, check kernel logs within sys-usb as well as the attached qube for errors before filing a bug report.
## USB VM does not boot after creating and assigning USB controllers to it
2020-10-18 06:44:45 -04:00
This is probably because one of the controllers does not support reset.
2020-10-18 06:44:45 -04:00
In Qubes R2 any such errors were ignored. In Qubes R3.x they are not.
In R4.x, devices that are automatically added to sys-net and sys-usb on install but do not support FLR will be attached with the no-strict-reset option, but see the related warning in the last sentence in this answer.
A device that does not support reset is not ideal and generally should not be assigned to a VM.
Most likely the offending controller is a USB 3.0 device.
You can remove this controller from the USB VM, and see if this allows the VM to boot.
2020-10-18 06:44:45 -04:00
Alternatively you may be able to disable USB 3.0 in the BIOS.
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:
2020-10-18 06:44:45 -04:00
```
lspci -nn | grep USB | cut -d '[' -f3 | cut -d ']' -f1 | xargs -I@ setpci -H1 -d @ d0.l=0
```
2020-10-18 06:44:45 -04:00
Errors suggesting this issue:
- in `xl dmesg` output:
2020-10-18 06:44:45 -04:00
2021-04-15 12:07:15 -04:00
```
(XEN) [VT-D] It's disallowed to assign 0000:00:1a.0 with shared RMRR at dbe9a000 for Dom19.
(XEN) XEN_DOMCTL_assign_device: assign 0000:00:1a.0 to dom19 failed (-1)
```
2020-10-18 06:44:45 -04:00
- during `qvm-start sys-usb`:
2020-10-18 06:44:45 -04:00
2021-04-15 12:07:15 -04:00
```
internal error: Unable to reset PCI device [...] no FLR, PM reset or bus reset available.
```
2020-10-18 06:44:45 -04:00
Another solution would be to set the pci_strictreset option in dom0:
- In Qubes R4.x, when attaching the PCI device to the VM (where `<BDF>` can be obtained from running `qvm-pci`):
2020-10-18 06:44:45 -04:00
2021-04-15 12:07:15 -04:00
```
qvm-pci attach --persistent --option no-strict-reset=true usbVM dom0:<BDF>
```
2020-10-18 06:44:45 -04:00
- In Qubes R3.x, by modifying the VM's properties:
2020-10-18 06:44:45 -04:00
2021-04-15 12:07:15 -04:00
```
qvm-prefs usbVM -s pci_strictreset false
```
2020-10-18 06:44:45 -04:00
These options allow the VM to ignore the error and the VM will start.
2021-06-17 10:01:53 -04:00
Please review the notes in the `qvm-prefs` man page and [here](/doc/how-to-use-devices/) and be aware of the potential risks.
2020-10-18 06:44:45 -04:00
## Can't use keyboard or mouse after creating sys-usb
2020-10-18 06:44:45 -04:00
You risk locking yourself out of your computer if you have a USB keyboard and use full disk encryption alongside sys-usb.
On boot, the keyboard may be inactive, preventing you from entering your LUKS decryption password.
2020-10-18 06:44:45 -04:00
When you enable a USB qube, it hides all the USB controllers from dom0, even before it gets started.
So, if your only keyboard is on USB, you should undo this hiding.
2020-10-18 06:44:45 -04:00
To solve the problem, disable the USB qube by not having it autostart, or unassigning your USB controller(s) from it. If you had created the USB qube by checking the box in the installer, then your USB controller(s) are probably hidden from dom0. To unhide them, reverse the procedure described in the [USB Qubes documentation](/doc/usb-qubes/#how-to-hide-all-usb-controllers-from-dom0) (under "How to hide all USB controllers from dom0"). That is, remove `rd.qubes.hide_all_usb`, instead of adding it.
2020-10-18 06:44:45 -04:00
Note that this procedure will attach your USB controllers to dom0, so do this only with USB devices you trust.
If your computer has a PS/2 port, you may instead use a PS/2 keyboard to enter the LUKS password.
2020-10-18 06:44:45 -04:00
## "qubes-usb-proxy not installed in the VM" error
2021-06-17 10:01:53 -04:00
When trying to [create and use a USB qube](/doc/how-to-use-usb-devices/#creating-and-using-a-usb-qube) with the `qubes-usb-proxy` package, you may receive this error: `ERROR: qubes-usb-proxy not installed in the VM`.
If you encounter this error, you can install the `qubes-usb-proxy` with the package manager in the VM you want to attach the USB device to.
Depending on your operating system, open a terminal in the template and enter one of the following commands:
- Fedora: `sudo dnf install qubes-usb-proxy`
- Debian/Ubuntu: `sudo apt-get install qubes-usb-proxy`