$ sudo apt-get install -y ./tigervncserver_1.16.0-1ubuntu1_amd64.deb
$ vncpasswd
$ nano ~/.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4$ nano ~/.config/systemd/user/vncserver@:1.service
[Unit]
Description=TigerVNC Server on display :1
After=network.target
[Service]
Type=simple
# Ensure the environment is inherited correctly
Environment=DISPLAY=:1
Environment=XAUTHORITY=%h/.Xauthority
# We run Xvnc
ExecStart=/usr/bin/Xvnc :1 \
-localhost no \
-geometry 1366x768 \
-depth 24 \
-FrameRate 60 \
-rfbport 5901 \
-PasswordFile %h/.vnc/passwd
# Use 'background' execution so systemd doesn't wait for the desktop to close
ExecStartPost=/bin/sh -c '%h/.vnc/xstartup &'
# This ensures that if Xvnc dies, the xstartup processes are cleaned up
KillMode=control-group
Restart=on-failure
RestartSec=2
[Install]
WantedBy=default.target
$ systemctl --user restart vncserver@:1.service