How to Setup Free VNC Server on Linux – Debian and Ubuntu

how to setup vncVNC means Virtual Network Computing and is a simple way to share the remote desktop of server machines and normal computers. Basically it is a two step process. In the first part, we will install free VNC server on the host linux machine and in the second part we will use free VNC viewer to connect to the free VNC server that we installed in the first step. So here is the step by step tutorial on how to setup free VNC  server on a Linux machine running Debian or Ubuntu OS. There are many VNC servers and clients pairs but for this tutorial we are going to use TightVNC.

Step One:

First of all we connect to the machine via Putty . Once inside the machine we need to upgrade the OS by running the following commands one by one.

apt-get update
apt-get upgrade

Step Two: Now we will install the desktop environment on the linux machine if it is already not installed by this command:

apt-get install gnome-desktop-environment

Step Three: Next we are going to install the fonts that will be required for proper working of the remote desktop:

apt-get install xfonts-100dpi
apt-get install xfonts-100dpi-transcoded
apt-get install xfonts-75dpi
apt-get install xfonts-75dpi-transcoded
apt-get install xfonts-base

Step Four: Now is the time to install free vnc server (TightVNC server) with this command

apt-get install tightvncserver

Now use the following command to start the free vnc server (TightVNC) for the very first time. It will get the necessary configuration files together and prompt for a password which you can set here for later connection to this server:

tightvncserver :1

we will not stop the VNC server so that we can configure it.

Step Five: Next we edit the configuration file by using Nano editor. You may use editor of your choice too.

nano ~/.vnc/xstartup

edit the file and make sure that it looks like this:

#!/bin/shxrdb $HOME/.Xresources
xsetroot -solid grey
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
# x-window-manager &
gnome-session &

Now press Ctrl+x and then Y to confirm the changes.

Step Six: Now in this final step we are going to start the VNC server with the desired resolution by this command:

tightvncserver -geometry 1024x768 :1

Thats all about the free vnc server part and the next step is to download free tighvnc viewer from here and connect using your Server IP and the default port of 5901. You will be prompted to enter the password that you set in the Step four above. I am sure you would have liked this how to setup free VNC server tutorial and it would be useful for you.


  1. arpit
  2. Khing

Leave a Reply