Proper VNC Configuration on Modern Ubuntu 16.04

How toVNC Server

In this guide we use TigerVNC here as it is more secure and the new recommended VNC standard. TigerVNC makes use of encryption and is a much improved VNC server and client combo. Comparatively, TightVNC has not been updated in 8 years.

Download

Download the TigerVNC Ubuntu Release files using the following links:

amd64

i386

Install

sudo dpkg -i tigervnc*.deb && sudo apt install -f

Create Config File

sudo nano /etc/systemd/system/vncserver@.service

Insert these contents into /etc/systemd/system/vncserver@.service.

Replace the bolded user with your own username.

[Unit]
Description=Start TigerVNC Server at startup
After=syslog.target network.target

[Service]
Type=forking
User=user
PIDFile=/home/user/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver :%i -depth 24 -geometry 1280x1024
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target

Save the file.

Enable the service

sudo systemctl enable vncserver@1.service

Start the service

sudo systemctl start vncserver@1

Credits:

https://askubuntu.com/questions/948774/configure-tigervnc-server-to-start-with-system-in-ubuntu-gnome-16-04

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-16-04

Systemd – wtf does PAMName actually do? from linuxquestions