Zend certified PHP/Magento developer

Autostart a tigervnc session for the local display

Hi I’m trying to setup tigervnc so I can remotely view my laptops screen. I’ve followed the guide on the arch wiki (https://wiki.archlinux.org/title/TigerVNC) and I can start the server but no matter what I try all I get is a black screen when I connect. I can see the mouse and move/click about and I can see this on the physical display I just can’t see the display through VNC.

After looking at various sites I’m convinced the issue is to do with my user being logged in and running the VNC server at the same time. I’ve tried to setup a service for tigerVNC but it just doesn’t seem to work for me. I have to login before the service will start or it just fails and I have to restart it once I’ve logged in. Essentially putting me back in the position of logging in twice i.e. on the laptop and via vnc.

Any help fixing the issue would be greatly appreciated. Some of the other posts I’ve seen have simply been closed after the OP gave up and switched to another vnc server. I have tried x11vnc which does start succesfully on boot but still leaves me with a black screen.

I’ve included my configs below:

x0vncserver.service

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
User=${USER}
ExecStart=/usr/bin/sh -c '/usr/bin/x0vncserver -display :0 -rfbport 5900 -passwordfile /home/${USER}/.vnc/passwd

[Install]
WantedBy=multi-user.target

xstartup

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
OS=`uname -s`

xsetroot -solid grey
xterm -geometry 1920x1080 -ls -title "$VNCDESKTOP Desktop" &
twm &
exec dbus-session gnome.desktop

vnc config file

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
OS=`uname -s`

xsetroot -solid grey
xterm -geometry 1920x1080 -ls -title "$VNCDESKTOP Desktop" &
twm &
exec dbus-session gnome.desktop

Sites I’ve used/looked at:

https://linoxide.com/install-configure-tigervnc-arch-linux/

https://stackoverflow.com/questions/42371319/fedora-25-tigervnc-displays-black-screen

https://bbs.archlinux.org/viewtopic.php?id=230545

Also as a bit of a side note does anyone have information on why only a user can only login to an x session once?