USB devices cause entire laptop to freeze for up to half an hour or more

I’m running the framework 13 laptop with the 12th Gen Intel Core i7-1260P.

When I start sys-usb, there is a chance my entire laptop freezes for a very long time.
Most of the time, when it happens, I simply have to restart, which takes much, much longer than it normally does.
I noticed it only seems to happen when sys-usb is started around the same time, before or after, another vm is being manipulated in some way.
This was a big enough issue for me at one point that I moved away from qubes for a couple of months, but I found that qubes is too good to not run, and nothing else I tried can compare.

I moved back to qubes, but this time didn’t set up a usb handling vm during the install process as I wondered if usb devices would “just work” without it.
Yes, I read the security considerations before doing this, and decided that no matter what, running qubes without this one feature is still more secure than any of my other options.

To my delight, usb devices did just work, until they didnt.
USB block devices do just work, along with my microphone.
Anything else has the potential to freeze my system.

I have a vm specifically for zoom.
I needed to attach my laptop camera to it, so I followed the instructions from this link:
https://qubes-doc-rst.readthedocs.io/en/latest/user/how-to-guides/how-to-use-usb-devices.html

It worked! Until it didn’t.
If I start the vm too soon after boot, it won’t work and will almost always freeze my system.
If it doesnt stop everything, it almost always freezes my zoom vm, even though qvm-ls says its running. I can qvm-kill my zoom vm, reboot it, and it works fine.
qvm-shutdown doesnt work, it leaves it in a transient state seemingly indefinitely.

However, if I wait some period of time (I don’t know exactly how long, but it seems to be in the range of at least 3 minutes), my zoom vm will start up just fine.
This is exactly what would happen with sys-usb on my first install.

Due to the sometimes it works, sometimes it doesn’t nature of this, it makes me wonder if this is some sort of race condition.
However, I’m not sure, as I am certainly no expert in this field.

I have replicated this 3 times by simply rebooting and immediately starting my zoom vm, and recorded journalctl -b -r into 3 different files, zipped them, and attached them to this post.
However, not all of the journal entries had the same error, even though the same thing happened all three times.
I believe it is error.txt that has the entry with the big red (in journalctl) error in it.
The other 2 did not have that same error.

If someone could help me figure out the issue, I would greatly appreciate it.
I hope this is enough information, though if it is not, I will gladly provide whatever I need to.
Thank you so much for your help.

journal.gz (820 KB)

1 Like

Try to increase the sys-usb memory and VPCUs.
You can also try to work around the issue with USB webcam by using qubes-video-companion:

Jul 16 10:51:40 dom0 kernel: nvme nvme0: I/O 550 QID 1 timeout, completion polled
Jul 16 10:51:30 dom0 libvirtd[2181]: internal error: connection closed due to keepalive timeout
Jul 16 10:51:10 dom0 kernel: nvme nvme0: I/O 549 QID 1 timeout, completion polled

Maybe it’s an issue with your storage.
Try to switch the storage mode from RAID to AHCI/NVME or disable Intel Volume Management Device (VMD) in BIOS.

UPD:
Or not, it seems like an issue with the lack of resources in sys-usb:

1 Like

This worked!
Thank you so much!

More RAM stabilizes USB usage a little, but the system still freezes quickly. It has to do with the hard disk (mode: AHCI). In my case, as in tech_nerd’s case, it is an WD PC SN730 or SN740 SSD hard disk. There is no kernel so far under which the problem disappears.

Unfortunately, the freezing still seems to occur, though it’s not to the point that it isn’t usable anymore, and it’s not near as frequent.
I have an expansion card I can boot from for the framework as a workaround, but I’d like to just be able to use qubes for everything.

Do you have any other ideas?

Thanks so much for your help up to this point, my system is stable enough that it is at least usable now.
I really, really appreciate the help

Yeah, it helps some, but I still get some freezes some of the time, but it’s mostly usable now

I guess you’ll have to get the crash log to see what’s happening with your system.
You can use USB3 debug cable for this:

I bought a different ssd for my laptop, the sn850x available on frameworks website.
Everything works perfectly fine now.
Not sure why, but this issue definitely has something to do with the ssd.

Thanks so much!