Need help with keyboard/usb

I have a fresh installation of 4.1 and initially I was able to connect my usb mouse to sys-usb, but then I tried to get a keyboard working. I tried 3 different working usb keyboards and have the same problem with each.

Also, now I cannot get the same usb mouse working because I cannot remember what I did but I think it was a multiple-step process of connecting it to sys-usb and then to a specific Qube. Between my first success and my second failed try, the system has been rebooted.

Have I done something wrong? Why doesn’t it give more information?

From checking the documentation, to try to get the keyboard working, I added
sys-usb dom0 allow usbcore.authorized_default=0
to /etc/qubes-rpc/policy/qubes.InputKeyboard using Dom0 terminal
I know it says to replace sys-usb with Qube name but I tried that it didn’t work either.

I also checked my /etc/qubes-rpc/policy/qubes.InputMouse file to confirm that it has
sys-usb dom0 ask,default_target=dom0
I also tried replacing sys-usb with the Qube name, personal, and have the same issue.

When I plug in a mouse or keyboard, it recognizes the device with brand name, and it says it’s available. Then I can go to the usb devices and see it and hover to see the list of Qubes that I could attach to. Once I pick one, like personal or anon-whonix I get this popup:

Error Attaching device my_device_name_here to personal failed. Error: QubesException - Device attached failed:
It ends like that with no further text.

The same thing happens in the command line. I can see the brand names of my devices when I do qvm-usb but when I try the attach command, it says “Device attached failed:” without explanation.

(But the command line worked for me once to connect the mouse. I may have had to do 2 commands to make it work.)

Here is what I have in my /etc/qubes-rpc/policy/qubes.InputMouse with mouse working flawlessly:

sys-usb dom0 allow,user=root
$anyvm $anyvm deny

Concerning the keyboard, do you want that it works in all qubes, or just ones which you attach it to? In the first case, you should carefully read this and this.

I changed my .InputMouse file to what you posted but I have the same issue. It says available but attaching through either method gives the same error.

I don’t want to risk locking myself out, so I don’t mind manually attaching once or twice. For now I would be glad if it worked with a lot of manual steps. Long term I need to use the keyboard in many Qubes so hopefully it can be done in bulk at the command line.

qvm-pci shows that I have one USB controller used by sys-usb.

I tried every usb port with the mouse. No luck.

I also tried a different usb mouse. Same thing, it says available but won’t attach and won’t give me more information.

sys-usb is running and so is the personal Qube.

Fresh install, no changes made except for display settings.

This is one of the compatible Lenovos.

I did have a pci error at one point, but as I said, this mouse worked at one point, so I think that is unrelated? It was failure to add a certain pci device. I believe this was when it was booting Qubes the first time.

libxl_pci.c:1774:libxl_device_pci_add failed for PCI device 0:4:0.0 (rc -9)

libxl_create.c:1904:domcreate_attach_devices: Domain 5: unable to add pci devices

Or is that the problem?

I could try reinstalling Qubes but it seems unlikely to help.

What things can I try? I’ve reread the documentation over and over but the only thing that I know to try is creating a new USB Qube. It doesn’t make sense that mine would have an issue?

1 Like

I reinstalled Qubes and upon it loading for the first time, the mouse was easy and fast to get working. Keyboard too. I was surprised that both mouse and keyboard also worked in my personal or whonix Qubes without any additional attaching, etc.

Then I shut down and started up Qubes again because of my previous experience. Like before, now I can’t get either the mouse or keyboard to work at all. It will show that the device is available after they are plugged in, but attaching gives me that error that doesn’t say much. They just won’t attach. They also don’t even work in my dom0 terminal window or anywhere.

Why is it completely different from the first loading, and how do I fix this? Seems like a permission thing.

In another thread, someone had success with disabling autostart of sys-usb. I have no difference if I have autostart off (and manage network unchecked).

I am confused if Can't use keyboard or mouse after installing sys-usb applies to my situation but I think that user had trouble using keyboard and mouse after reboot but not before reboot.