USB stops working from time to time / can't log in


I’m having an occasional issue with USB (I think). Everything works flawlessly for maybe a week, and then when I try to log into my workstation in the morning, the USB keyboard/mouse does not work and I have to restart the system and then it works fine again.

It does not help to use a different keyboard (wired USB), even if connected to any of the other USB port, etc. And without a working keyboard I can’t investigate much.

I was looking in the various system logs, both in dom0 and sys-usb for suspicious stuff, but nothing obviously bad seems to be there …

The only idea I have is that this might be some USB-related problem - not sure if in kernel or xen, or whatever. But I don’t have a good idea how to confirm/investigate it, or even how to fix it.

I’m running Qubes 4.2.1 and AFAIK the system is exactly as installed (I haven’t done any customizations or whatever). And other than this, it works pretty fine. Also, this is MSI motherboard, model MS-7D43 (PRO B660M-A DDR4).

Any suggestions / ideas what to try?

If you have multiple USB controllers you can try to designate one of them exclusively for the keyboard/mouse use in dom0 like this:

This way you can access your system if there will be an issue with your sys-usb to investigate it further.

1 Like

Unfortunately I think there’s only one USB controller :frowning: at least judging by what lspci shows.

Are you able to shutdown it gracefully by pressing the power button once? Do you see the shutdown process on the display or any change? Or is it in a hung up state where only hard shutdown by holding the power button works?

I wasn’t aware it’s possible to do graceful shutdown just by pressing the power button, I though that’d require some keyboard input too, but I’ll give it a try next time this happens.

However, it certainly is not entirely stuck - I’ve been able to make the login dialog to appear (I think it was after pressing the power button), but then unable to input anything.

If it’s not hung up then you can check the logs in dom0 using journalctl to see what happened wuth sys-usb.
If sys-usb is crashed and stopped then you can try to add sys-usb start in cron like this:

Or maybe add some script in cron that’d check that USB keyboard is available in sys-usb and it’s proxied to dom0.