Works on 17.04 as well.
The biggest pain about Ubuntu is changes they made to vnc setup. Often, once you think you have it set up, you connect and get nothing but the ancient X windows grey screen with no way to interact with the UI.
This method works for 17.04 and 16.04. It’s also faster performance that other approaches.
sudo apt-get install x11vnc -y sudo x11vnc -storepasswd /etc/x11vnc.pass Edit /lib/systemd/system/x11vnc.service
Description=Start x11vnc at startup.
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
sudo systemctl enable x11vnc.service sudo systemctl daemon-reload
sudo shutdown -r now
On reboot run the script:
Or, just manually start it:
x11vnc -usepw -forever
Use your vnc client to connect to the system’s ip address at port :5900