Install VNC server on Ubuntu Server

Hi all

sometimes VNC is really useful when you want to access the remote server. Though every thing can be done via command prompt but sometimes a GUI is useful (Atleast I find it useful).

Now if you want to do that here are the steps you need to follow. As you know that most or all servers dont come with Gnome installed. So thats the first step you need to do

Start with the following command

sudo apt-get update

Than install the Gnome-Core components using

sudo apt-get install gnome-core

Now install a virtual desktop using

sudo apt-get install vnc4server

Now setup a password to login using the following command. It will prompt to setup a password and verify it


Than run the vnc server using

vncserver :1

Now before you proceed kill it once using

vncserver -kill :1

Now open the config file from .vnc/xstartup or ~/.vnc/xstartup

using nano .vnc/xstartup (I perfer nano you may use vim or vi)

Than uncomment the line which says


And add sh to the line below it like this

exec sh /etc/X11/xinit/xinitrc

Exit the file and run the command as below

vncserver :1 -depth 16 -geometry 1028×1024

Than download tightVNC from

connect using ip:1 (:1 is for the vnc server window)

You might see a dialog box with error and a delete option. Click delete and done 🙂

You now have GUI access to your server.

You may want to install synaptic using

apt-get install synaptic

Thats all.. Hope this article helps. If you get stuck do write to me.

Be Sociable, Share!