USB Drive Disappears on Passthrough

Greetings,

I’m new to Qubes OS and Linux, and been trying to do my research and figure out the systems before asking questions but this one I just can’t figure out so I’d appreciate any pointers.

I’ve had difficulty mounting a 64GB FAT USB to an appVM. It successfully appears in the file GUI on sys-usb and I can access the files on the usb drive from there. It also appears in the terminal with the commands lsusb or lsblk.

However once I use the device widget to try and mount the USB to a VM, it won’t show appear on the file GUI of that VM. I get a popup notification saying Device () Connected and then almost immediately it says Device () Disconnected, and in that time i have not tried to access the drive or link it to an app or anything. It will appear briefly in the terminal when I type lsubs or lsblk, but its gone once I get the notification saying Device () Disconnected. If I go back to sys-usb, it doesn’t appear there either with lsusb or lsblk. The device widget marks it as mounted to the appVM still.

I’ve also tried with a 2gb macos journaled USB, and I don’t have this problem - I can use the devices widget to mount it to another VM and it will appear in the GUI normally.

Any pointers? It seems to disappear when I try passing it through to a VM, connects momentarily and then disconnects and no longer in sys-usb either.

Is it an issue with the USB format? With it’s size?

Thanks.

Correction, the drive will always be listed under sys-usb with the command lsusb, it is the block that disappears (lsblk)

Hello redfinch, welcome to Qubes.
I see two messages coming from different places - “Removed” tells
you that it has been removed from sys-usb, and the other, that it is
connected to the appVM.

This isn’t your case, but it can be a source of confusion.

In your case, the widget shows it as still connected to the qube, and
the block isn’t shown in sys-usb. This suggests that it is attached to
the target qube.
If you are attaching a partition, then you would not expect lsusb to
show anything.
What do you see with dmesg when you attach the device/partition?

What template are you using for sys-net and for the target qube?

Hello Unman, thank you!

Makes sense about why lsusb would not show anything

The messages I see are in the following order:
Italics are my replacements

Device available
Device (Device Name) is available

Device available
Device USB_2.0_FD () is available

Device available
Device USB_2.0_FD (EFI) is available

Device available
Device USB_2.0_FD (Partition Name) is available

After mounting sys-usb:2-1_Device Name to my VM I see the following messages:

Attaching Device
Attaching (Device Name) to (VM)

Device removed
Device USB_2.0_FD (EFI) is removed

Device removed
Device USB_2.0_FD (Partition Name) is removed

Device removed
Device USB_2.0_FD () is removed

So this makes sense along the lines of what you are saying! And to reproduce what I said earlier, I notice now I have to go to the files GUI of the VM and as soon as I click something (but not before) I get the following messages

Device available
Device () is available

Device removed
Device () is removed

When i try dmesg, first in sys-usb with the usb mounted, then in the VM I’m trying to attach the USB too both before and after the last two messages, I only get the following:

dmesg: read kernel buffer failed: Operation not permitted

The template for sys-net and sys-usb are the defaults from initial os installation, fedora-32

The template for the target qube was also fedora but its a standalone qube, only modification right now is the default network

Access to the logs is (generally) restricted to the root account.
You need to use sudo to gain that privilege temporarily.
So sudo dmesg will help.

Thanks Unman,

sudo dmesg doesn’t say much when the USB is attached to sys-usb. When I attach the usb to the VM it’s a whole other story! Pasting the results below with some of what I think is unnecessary information (removed) in Italics

[ 48.883942] usb 1-1: new high-speed USB device number 2 using vhci_hcd
[ 48.998951] usb 1-1: SetAddress Request (2) to port 0
[ 49.018465] usb 1-1: New USB device found, idVendor=(removed), idProduct=(removed), bcdDevice= 1.00
[ 49.018495] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 49.018520] usb 1-1: Product: USB 2.0 FD
[ 49.018533] usb 1-1: Manufacturer: (removed)
[ 49.018545] usb 1-1: SerialNumber: (removed)
[ 49.070446] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 49.070769] scsi host0: usb-storage 1-1:1.0
[ 49.071346] usbcore: registered new interface driver usb-storage
[ 49.075315] usbcore: registered new interface driver uas
[ 50.124067] scsi 0:0:0:0: Direct-Access (manufacturer) USB 2.0 FD PMAP PQ: 0 ANSI: 6
[ 50.124460] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 50.129417] sd 0:0:0:0: [sda] 121145344 512-byte logical blocks: (62.0 GB/57.8 GiB)
[ 50.132453] sd 0:0:0:0: [sda] Write Protect is off
[ 50.132475] sd 0:0:0:0: [sda] Mode Sense: 2b 00 00 08
[ 50.136109] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn’t support DPO or FUA
[ 60.373300] vhci_hcd: unlink->seqnum 36
[ 60.373317] vhci_hcd: urb->status -104
[ 61.265053] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 62.153053] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 63.041064] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 63.929082] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 63.929192] usb 1-1: USB disconnect, device number 2
[ 63.937032] sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[ 63.937101] sd 0:0:0:0: [sda] Sense not available.
[ 63.937136] sd 0:0:0:0: [sda] 0 512-byte logical blocks: (0 B/0 B)
[ 63.937166] sda: detected capacity change from 62026416128 to 0
[ 63.937320] sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[ 63.937354] sd 0:0:0:0: [sda] Sense not available.
[ 63.937381] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 64.841053] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 65.729757] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 65.729791] usb usb1-port1: attempt power cycle
[ 66.929048] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 67.817136] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 67.817171] usb usb1-port1: unable to enumerate USB device
[ 71.331017] kauditd_printk_skb: 2 callbacks suppressed

Hi!

Any thoughts on how I should interpret this, or what next steps might be?

It seems to be indicating that it is unable to mount, but it’s not a hardware issue since the port and the mounting process works with a different usb drive, and these drives that are failing do connect successfully to sys-usb.

Thanks!