Hello,
I am trying to run X from within a systemd-nspawn container - this is something I had set up and was running successfully about three years ago, but something seems to have changed in the meantime and I am not able to recreate this.
I created the container and installed X related packages following the wiki article, and was able to boot into my container and create an unprivileged user. The script I am using to boot is (modified from my container of three years ago):
xhost +local:
sudo systemd-nspawn -b -D /mnt/extra/nspawn-containers/test \
--bind-ro=/tmp/.X11-unix \
--bind=/dev/dri \
--bind=/dev/shm \
--bind=/dev/nvidia0 \
--bind=/dev/nvidiactl \
--bind=/dev/nvidia-modeset \
--setenv=DISPLAY=:0.0 \
xhost -
When I try to `startx` from within the container, however, I get this:
/usr/lib/Xorg.wrap: Only console users are allowed to run the X server
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
Couldn't get a file descriptor referring to the console.
I am not entirely sure where to go from here. Is there something incomplete in my configuration? Looking up the Xorg.wrap error message, I only find that X will not run on pseudo terminals, but I do not know what to do about this or if this is even the problem.
Best regards,
e