sudo apt install xfce4 xfce4-goodies tightvncserver -y
vncserver -alwaysshared -geometry 1024x768 -depth 16
nano /etc/gdm3/custom.conf
Uncomment WaylandEnable=false
, and reboot in order to remotely access the login screen.
vncserver -kill :1
Copy the current configuration to a backup just in case
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
Create a new xstartup file
nano ~/.vnc/xstartup
Edit the new xstartup file with the VNC server details
#!/bin/bash
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
xrdb $HOME/.Xresources
xsetroot -solid grey
xfce4-session &
# Ubuntu 18.04 and Later:
/usr/lib/gnome-settings-daemon/gsd-xsettings &
Enable permissions for this to run at startup
chmod +x ~/.vnc/xstartup
Then restart the xvncserver
vncserver -localhost