Sys-net suddenly used as USB qube for integrated SD card reader

I enabled the creation of sys-usb on install. My laptop has an integrated SD card reader, and up until recently any plugged in SD cards were directly handled by dom0. But now they get handled by sys-net instead. Regular USB devices still seem to get handled properly by sys-usb however.

Does anyone have a clue what might have happened? Where I can start looking?

@wimaj asked:

Where I can start looking?

Run ‘qvm-pci’ in dom0 and check which devices are attached to which qube.

Run ‘qvm-usb’ in dom0 and check which controller/qube your SD card reader is attached to.

1 Like

Run ‘qvm-pci’ in dom0

Thank you! This made me realize what the problem was. It was caused by me physically removing the wireless network card.

Output before physically removing wireless network card (all good):

dom0:01_00.0   Ethernet controller       sys-net
dom0:02_00.0   Wireless controller       sys-net
dom0:03_00.0   Card reader

Output after physically removing wireless network card:

dom0:01_00.0   Ethernet controller       sys-net
dom0:02_00.0   Card reader               sys-net

Seems like Qubes is using these XX_00.0 values to uniquely identify PCI devices when figuring out which qube they should map to. Seems like an unwanted side-effect to me. Just something I have to think about in the future, I guess.

To fix it I went into the Qube settings for sys-net and removed 02:00.0 from the device list.

Glad you found it!

I consider this a bug and a bit of a scary one as well:
Removing a PCI device should not cause other PCI devices to become attached to random VMs. In fact this can make entire Qubes OS installations unusable just from device removal (imagine an USB controller with keyboard to be assigned to another VM…).

Thus please report it at GitHub - QubesOS/qubes-issues: The Qubes OS Project issue tracker.

Probably related: PCI devices are assigned in random order => random issues with Wi-Fi connection · Issue #6587 · QubesOS/qubes-issues · GitHub