Creating virtual input devices requires /dev/uinput to exist and be writable by the current user.
Group setup ​
Create a
uinputgroup:bashsudo groupadd --system uinputAdd your user to it:
bashsudo usermod -aG uinput "$USER"
Udev setup ​
Create a udev rule:
bashecho 'KERNEL=="uinput", GROUP="uinput", MODE="0660",' \ 'OPTIONS+="static_node=uinput"' \ | sudo tee /etc/udev/rules.d/99-uinput.rulesLoad the kernel module:
bashsudo modprobe uinputReload udev rules:
bashsudo udevadm control --reload-rules sudo udevadm triggerStart a new login session, or refresh the current shell group list:
bashnewgrp uinputTIP
Logging out and back in is the cleanest way to pick up the new group.
Verify ​
Confirm the node exists and the group is correct:
bashls -l /dev/uinputExpected shape:
textcrw-rw---- 1 root uinput 10, <minor> <MMM DD HH:MM> /dev/uinput