How can I run /usr/bin/Xorg without sudo?
To determine who is allowed to run X configure it with
There are three options: root only, console users only, or anybody. The entry is located in
Since Debian 9 and Ubuntu 16.04 this file does not exist. After installing
xserver-xorg-legacy, the file reappears and its content has to be changed from:
You also need to specify the virtual terminal to use when starting X, otherwise, errors may occur. For example:
Xorg :8 vt8
X needs access to input devices (mouse and keyboard) and to the monitor and graphics card for output.
To achieve this for non-root X, you can change the group of
input, set the setgit bit, and add your user to group
chown root:input /usr/lib/xorg/Xorg chmod g+s /usr/lib/xorg/Xorg adduser YOURUSERNAME video
(Instead you could add your user to both
input, but that is discouraged. A user in group
input can spy on inputs of other users. E.g. a GUI in X could probably spy on root password typed into console/tty.)