I try to start xorg from an systemd service without desktop environment.
When I log in on tty1 as a normal user, and type "startx /bin/xterm", I have an xTerm open, it's perfect.
But when I try to start automatically after boot Xorg via a systemd, It doesn't work.
Here is my systemd service file :
[Unit]
Description=Xorg server at display 0
[Service]
Type=simple
User=user1
Group=user1
SuccessExitStatus=0 1
ExecStart=/usr/bin/Xorg :0 -nolisten tcp -noreset "vt1"
[Install]
WantedBy=multi-user.target
My /etc/X11/Xwrapper.config
file :
allowed_users=anybody
needs_root_rights=yes
I try to open a session after boot with agetty
/sbin/agetty --autologin user1 --noclear %I $TERM
The session open on boot, but Xorg doesn't start
To try debug the issue, I connect myself by SSH to the machine and try to manually start Xorg with startx /bin/xterm -- :0 vt1
:
If user1 is NOT logged in on tty1 I have this error :
Fatal server error:
(EE) xf86OpenConsole: Cannot open virtual console 1 (Permission denied)
(EE)
And if user1 is logged in on tty1 :
Fatal server error:
(EE) xf86OpenConsole: Switching VT failed
(EE)
If I startx with root, I works...but I don't want to run Xorg as root...
How can I start Xorg by systemd service for a normal user ?
Is it possible to start Xorg without any logged user on tty ?