I'm aware there is a question with a similar issue, like this one, however the solutions within there are not specific enough for my situation.
I understand there is a way to start X using startx and xinit and logind, but I wanted to do things this way instead:
For context: I am using OpenSUSE Tumbleweed and Systemd
I am trying to use custom user targets and user services to start a bunch of programs upon login from a specific tty, and one of these services is the X server. For the time being, I have the following service file sitting in ~/.config/systemd/user/Xserver.service, which is meant to start an empty Xorg server on vt7:
[Unit]
Description=Starts the X server
After=default.target
[Service]
Type=simple
ExecStart=/usr/bin/X vt07 :0
NoNewPrivileges=false
[Install]
# Irrelevant as of time being, just some custom targets I plan on isolating later.
When attempting to start this service,(systemctl --user start Xserver.service) however, it fails with exit code 1, and hen reading the Xorg logs I find they say that "switching VT failed".
I understand X at that point is suppposed to be running with root privileges (due to setuid), and is already connected to /dev/tty7, so how is this happening?
What could I do to make it work?
PS: (The reasoning behind systemd allocating ttys dynamically doesn't apply here since I'll have already logged in to the tty by the time this service is started)