Trying to setup evdev input passthrough

Hey guys, so Im following this tutorial to set up evdev so I don’t have to use 2 mice and keyboards for my VM setup. After setting everything up when I try to boot up the VM I keep getting this error:

Summary

I tried all of the troubleshooting steps in the tutorial I linked above and none of them worked (setting the users to root gave me an additional error saying its privileges were too high).

here’s my qemu.conf:

Summary

user = “mirad”
group = “mirad”
cgroup_controllers = [ “cpu”, “devices”, “memory”, “blkio”, “cpuset”, “cpuacct” ]
cgroup_device_acl = [
   “/dev/null”, “/dev/full”, “/dev/zero”,
   “/dev/random”, “/dev/urandom”,
   “/dev/ptmx”, “/dev/kvm”, “/dev/kqemu”,
   “/dev/rtc”,"/dev/hpet", “/dev/input/by-id/usb-Razer_Razer_Ornata_Chroma-event-kbd”,
   “/dev/input/by-id/usb-04d9_USB_Laser_Game_Mouse-event-mouse”

Check if your user is in the plugdev and/or input groups.

Here’s the groups my user is in:

mirad@Ubuntu-Mirad:~$ groups mirad
mirad : mirad adm cdrom sudo dip plugdev input lpadmin sambashare libvirt

The only other group that I see that I have that may be related is kvm so could try adding that too, I can see in the bash history for root user that I only modded my user to add that group but I’m also on Arch so YMMV. Looking at /dev/input everything is root:input except a few things which are root:plugdev but the two devices I pass are:

lrwxrwxrwx 1 root root 10 Feb 17 12:01 /dev/input/by-id/usb-Razer_Razer_Naga_Epic_Chroma-event-mouse -> ../event26
lrwxrwxrwx 1 root root 11 Feb 17 12:01 /dev/input/by-id/usb-Razer_Razer_BlackWidow_Ultimate-if01-event-kbd -> ../event257

Which have ownership:

crw-rw---- 1 root input 13, 90 Feb 17 12:01 /dev/input/event26
crw-rw---- 1 root plugdev 13, 257 Feb 17 12:01 /dev/input/event257

In the comments of the post one person mentioned:

I did try that apparmor permission tweak before, all it did was give me a different error so I figured that was a dead end. Everything in my /dev/input also is root:input (running Ubuntu 18.10). Is there something behind that “Domain id=2 is tainted: custom-argv” part of the error?

Not that I know of. Sorry I am not sure at this point since I don’t run Ubuntu, hopefully someone else can help. Might help posting the error you saw with the apparmor permission tweak, I think it’s required on Ubuntu for this to work regardless.

For those who stumble across this thread one day, as I did, I was able to get the mouse (not the keyboard) working by adding the cgroup and running libvirtd as root as described in the troubleshooting section of the guide, changing from /dev/input/by-id/... to their block device targets (ls -l /dev/input/by-id to find out where those links actually point to), and adding the apparmor permission as described above. It appears all three things are necessary to get past the permission denied error.