[SOMEWHAT-SOLVED]Some weird keyboard shenaningans in my virtual machine

Okay, So I have been playing around with the virtual machine I had set up thanks to these forums, and over all I have been enjoying the result, however, the keyboard I have been using has started to screw up(not really surprised as it’s a cheap Walmart branded mechanical with rgb backlight) but anyways the keyboard started to drop characters, and the lights started going out.

So anyways, I bought a Corsair Strafe Mk.2 Keyboard to replace said Walmart keyboard, and the way I have been using the keyboard, at least up till now was I would start barrier(which is like an open source synergy), and setting my host machine as a client. I would start the VM, have passed through both my main keyboard and mouse, and when I log into windows barrier is automatically set to start as the server so once barrier starts on that end I could then pass my mouse and keyboard and use the same mouse and keyboard on both my host, and my guest.

However,with the new keyboard in question this no longer works, for some reason passing my new keyboard to the machine I get a code 10 in windows saying that the corsair driver couldn’t properly initialize, but the machine does recognize that is the keyboard installed, even showing me said keyboard in my devices tab, so It knows what keyboard is there, but I can’t type on the keyboard, at all.

Even stranger, in the past when i was done with the VM and wanted to go back to my main OS, I would simply shut down my windows box, and within a few seconds it would give primary control of the keyboard back to the main OS, however, now it keeps my keyboard in like a weird Limbo state, as I can’t type on my new keyboard until I either unplug the keyboard(and plug it back in), or restart my machine.

Now at first, I thought it must have something to do with the USB hub on the back of the keyboard, so as an experiment, I installed my mouse dongle to the usb hub, reconfigured my VM, and oddly the mouse continues to work just as it did before, even while plugged in to this usb hub, also as of note, you cant see this hub with the Virtmanager USB HOST DEVICE addition screen anyways, you can only see devices that are otherwise connected to it, so I’m pretty sure it is just a glorified usb extension, as there are two cables you can plug in to the back of your PC with this keyboard, and only the one that has a tiny keyboard needs to be plugged in for this keyboard to work.

Either way any insight someone has on this topic would be greatly appreciated, as I’m over here scratching my head on this one.

FIGURED OUT A BETTER SOLUTION BELOW:

You need to pass through the controller. The keyboard stops being a hid device when the driver loads and it gets a new id is my guess. The k95 is like this too.

So you need to pass through the USB controller instead of the device because the subtle change basically disconnects the keyboard from the VM when the driver loads

Correct me if I’m wrong, but wouldn’t passing the usb controller for that, cause my computer to not boot with those USB ports enabled? I guess I’m just having a hard time finding what exactly it is I need to pass through,at least i cant find it in any of the lists.

There are multiple usb controllers… lspci

If you only have one keyboard you might need to move the port it’s in

okay so when I do a " lspci -nn | grep -iP “USB” " the output I get is:

the problem is I cant use 08: as that happens to also be the nvidia card I’m passing to the vm, I cant seem to use 01: as that apparently also controls the additional usb hub that I have on the front of my PC, and I would like that to be able to still be accessed from the host normally, also 01: has the same issue that 09: and 43: have which is,it throws this error if trying to pass it:
ERROR

So is there some sort of binding trick to get this to work properly?

OKAY, so I found A solution,and although it isn’t preferred It does work, supposedly some corsair keyboards come with a Bios mode that you can enable by pressing in the windows lock and F1 for a few seconds, if you do this before enabling the virtual machine the keyboard will work fine in the VM, Only with a lack of rgb control.

This tells me ultimately that it has something to do with the base firmware of the keyboard, and possibly is something that could be worked on should some one want to spend the time on it. which I may at some point, but for now, I’ll leave it at this. for anybody who runs into this issue, and cant otherwise pass another USB controller like in my case.

1 Like