VNC (Virtual Network Computing) lets you open the graphical desktop of a remote Linux server. A desktop environment and a display manager must be installed first.
Step 1: Install the VNC server
TightVNC is one of the options. Run as root:
apt-get install tightvncserver
Step 2: Start it
vncserver
Enter a password for VNC. It must be 6 to 8 characters, and longer passwords are cut to 8. It is different from your Linux password. You can also set an optional view-only password.
The server creates a desktop and shows its number. For example :1 uses port 5901, :2 uses 5902, and so on.
Step 3: Install a client
Install a VNC client on your computer. TightVNC has a Windows client at tightvnc.com, and other VNC clients also work.
Step 4: Enter the address
In the client enter the server IP followed by the desktop number:
203.0.113.10:1
Step 5: Connect
Click Connect and enter your VNC password. The desktop of the server opens.
ssh -L 5901:localhost:5901 user@your-server-ip, then connect to localhost:1.Change the screen size
The default is 1024x768. Stop the desktop and start it again with a new size:
vncserver -kill :1
vncserver -geometry 1920x1080
Quick recap
- Install
tightvncserver, runvncserverand set a password. - Connect to
IP:1(port 5901), best through an SSH tunnel.