as long as wayland is not sufficient for my purposes i run xserver rootless for security reasons, s. https://wiki.archlinux.org/index.php/Xorg#Rootless_Xorg.
On a pc with amd-graphic, a notebook with intel graphic and a notebook with hybrid graphics (nvidia, intel) i can start xserver rootless from vt by a little shell-script for selecting DE and modifying .xinitrc.
I only needed to set
# nano /etc/X11/Xwrapper.config
needs_root_rights = no
and get
$ ps -o user $(pgrep Xorg)
USER
<myusername>
after starting xserver on all 3 machines. On the notebook with hybrid-graphics i can use both cards by nvidia-prime.
Now i wanted to use a login manager, installed gdm and activated xdm. On the pc with amd-graphic and the notebook with intel graphic xorg is started rootless by the user logged in as expected.
On the notebook with hybrid graphics kms had to be manually enabled for the nvidia driver, s. https://wiki.archlinux.org/index.php/Kernel_mode_setting.
# nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT=".....nvidia-drm.modeset=1....."
# grub-mkconfig -o /boot/grub/grub.cfg
This parameter is shown in the output of
$ cat /proc/cmdline
gdm starts, i can login but i get a grey screen and dead keyboard. I can't open a vt b< CTRL+ALT+FN.
After ssh from another machine i get:
$ ps -o user $(pgrep Xorg)
USER
gdm
Only if i set
# nano /etc/X11/Xwrapper.config
needs_root_rights = yes
xorg starts, but by user root.
What can i do?