Install VNC server on Ubuntu Server

时间:2022-02-23 04:03:45

 

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


1.Start with the following command
sudo apt-get update


2.Than install the Gnome-Core components using
sudo apt-get install gnome-core


3.Now install a virtual desktop using
sudo apt-get install vnc4server


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


5.Than run the vnc server using
vncserver :1


6.Now before you proceed kill it once using
vncserver -kill :1


7.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
unset SESSION_MANAGER
And add sh to the line below it like this
exec sh /etc/X11/xinit/xinitrc


8.Exit the file and run the command as below
vncserver :1 -depth 16 -geometry 1028×1024


Than download tightVNC from http://www.tightvnc.com/download.html
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.


9.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.