QEMU evdev passthrough for multiple vms?

I’ve tryed evdev passthrough for mouse and keyboard, and it works beautifully, but i would like to use it for multiple vms. If it would let me circle though vms by clicking hardcoded shortcut, it would be perfect.

I couldn’t find any information for such scenario on the internet. Is it even possible?

It is already hard-coded… You need to click left and right CTRL at the same time…

I was not asking about the shortcut.

For example if i have 2 vms, which both have evdev passthrough enabled in them. I turn on 1st vm, then 2nd vm. Evdev will only circle though host and 2nd vm, forgeting about 1st vm.

I was asking if there was a possibility to make Evdev circle from host --> 1st vm --> 2nd vm --> back to host?

That is strange, because I think that is what Evdev should do by default. At least thats how it works for me. I guess you tested that evdev works in each individual VM, just not if you use it for multiple VMs at the same time? I sometimes have to click more times than I would expect until it works in the right VM so. Not an expert here unfortunately… I just followed a tutorial to set it up.
https://passthroughpo.st/using-evdev-passthrough-seamless-vm-input/

The only thing I can think of, is that the first VM is somehow unregistering from evdev if you don’t use it or leave it for whatever reason.

After setting up the system again, I have a similar issue. The Moment I switch the Mouse / Keyboard to the Windows-VM, I cannot release them back to another VM. It works between multiple Linux-VMs so… I have no idea whats the problem here.

Did you find a solution?

I have a system with multiple VMs that all use evdev pass through from qemu. It works, which is good news and hitting the two Ctrl buttons swaps but its random which one.

Basically what is consistent is that it will swap between the host and one of your VMs when you press the combo., then back to the host if you press the combo again.

So the rule here is, every other time you press the key combo (Left Ctrl+Right Ctrl) you will return to the host.

Now which VM it goes to seems to be random, often returning to the same one for seversal times before sudfdenly with no sense of reason it goes to the other one.

I basically ended up just hitting the combo over and over and eventually I land in the VM I wanted.

Has anyone figured out something that makes more sense and gives more control which VM to cycle to?

I have a system with 2 GPUs added for passthrough. evdev seems to work ok initially. The toggle between vm’s seems to be random (with every other toggle being the host, then a random vm).

However, after a period of time the hotkey toggle just stops working. It is like evdev “disconnects”. I sort of work around it right now with using barrier in addition to evdev to share the mouse and keyboard and a usb keyboard passed through to “recover” if the screen locks and barrier stops working. I have not figured out how to fix this behavior.