How To: Remote Virtual Desktop
Today we're setting up a virtual desktop environment using a VNC server. This works for any provider such as DigitalOcean, AWS, Vultr, Hetzner, etc. pp.
Update & Install
Log in to your fresh Ubuntu machine via SSH, and type the following:
&&
Initialise VNC
To get to the password prompt we will initially run the server, set a password and kill it. This password has to be 6-8 characters long. Everything after the 8. character will be cut off.
For changing it afterwards, simply run:
Configure VNC
And add the following to xstartup:
#!/bin/sh
&
And finally, make it executable and restart:
Connect To VNC
VNC doesn't a use secure connection, so always connect via a SSH tunnel to your desktop:
This command opens a secure tunnel from localhost:8888 to <vncserver_ip>:5901. Now open up your VNC client (e.g. Real VNC Viewer) and connect to localhost:8888.