How to Fix Evdev Passthrough with KVM/QEMU for Wine Gaming

I was personally having a lot of issue when playing Wine emulated Windows games on my Linux machine when running through KVM/QEMU using the Evdev Passthrough.

The issue was mainly around when playing games with the mouse then it would suddenly “loose focus” or stop responding to the game that was on the screen, requiring alt+tab to be used to regain focus. This really was annoying and stopped me from continuing with Linux for gaming.

After performing some troubleshooting and trying to use the right terms on the internet as a lot were pointing back at wine being the issue, thanks to using synergy I found it was the Evdev Passthrough causing it (who would have thought).

To fix the issue perform these simple steps…

  1. Open up your virtual machine’s configuration file with which text editor you like (I use nano for this).

sudo nano /etc/libvirt/qemu/vminquestion.xml

Note: by default the storage of configuration files should be under /etc/libvirt/qemu/

  1. Once the configuration file is open, scroll down until you see the following entries.

input type=‘mouse’ bus= ‘ps2’ /
input type=‘keyboard’ bus= ‘ps2’ /

We need to change these two entries to the following…

input type=‘mouse’ bus= ‘virtio’ /
input type=‘keyboard’ bus= ‘virtio’ /

  1. Then make sure you define your changes to the configuration file

sudo virsh define /etc/libvirt/qemu/vminquestion.xml

The solution was thanks to a post on Reddit after I was able to find the right words to use in Google :smiley:

I hope this helps people, I am still very new to Linux but I want to thank the Level1 Techs forum for all the articles for making it easier and easier to transition from Windows :slight_smile: