evdev passthrough is nice

All you have to do is add some lines to your win10.xml file, then add your user to the input group, and then click ctrl + ctrl the right and left one, and it’ll switch the keyboard and mouse to the other OS.


sudo usermod -a -G input user

win10.xml:


  <qemu:commandline>
    <qemu:arg value='-object'/>
    <qemu:arg value='input-linux,id=kbd1,evdev=/dev/input/event1,grab_all=on,repeat=on'/>
    <qemu:arg value='-object'/>
    <qemu:arg value='input-linux,id=mouse1,evdev=/dev/input/event14'/>
  </qemu:commandline>

You need


<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>

At the top of the xml file.

Oh yeah, you have to edit qemu.conf too.


cgroup_device_acl = [
    "/dev/input/by-id/usb-Kingsis_Peripherals_ZOWIE_Gaming_mouse-event-mouse",
    "/dev/input/by-id/usb-Logitech_Logitech_USB_Keyboard-event-kbd",
    "/dev/null", "/dev/full", "/dev/zero",
    "/dev/random", "/dev/urandom",
    "/dev/ptmx", "/dev/kvm", "/dev/kqemu",
    "/dev/rtc","/dev/hpet"
]

Obviously, you have to change the /devs to the correct devices. Using by-id in the xml might not work, you have to use whatever the symlink is to.

Nice, if Windows fails to boot, you don’t have to unplug the keyboard and mouse, just click both ctrl buttons.

Nothing in dmesg with any errors, so no idea why Windows won’t boot.

Run “dmesg | grep vfio”, and you might see “vfio_ecap_init: 0000:25:00.0 hiding ecap 0×19@0×270”. My entire computer doesn’t freeze, Windows just won’t boot.

Update
The mouse stopped working last time I played a game, didn’t work on the desktop in Windows either, worked fine in Linux. I added a virtio device for the mouse and keyboard. Uninstalled the ps2 mouse and keyboard in Windows, you can’t remove them from the VM, it’ll re add em.

Windows also might just reinstall it every time you boot. You can’t disable it in Windows either, only uninstall. You could find the ps2 driver and delete it.