Hello & welcome to this tutorial where we’ll be learning how to install VNC on a Centos 6 VPS so lets start:
First of all we’ll be installing the desktop environment you have a wide choice in this step but i think the best to fit in a vps with low spec is the XFCE basicly because its a light weight GUI & it uses very low ressources.
Pre-Requise : Things you Should know
The Centos 6 Installation that come with the VPS doesn’t have the Desktop Package information , in this case we must add this befor any thing else.
Note also that the centos repos dont have XFCE so we must do a little trick to be able to install the XFCE by installing epel( wich stands for Extra Packages for Enterprise Linux).
you can learn more about epel following the link in the wiki here ( http://fedoraproject.org/wiki/EPEL).
Required Software & Tools
1- A VPS with minimal Centos 6 installation( Of Course ).
2- SSh Client : PuTTy download here http://the.earth.li/~sgtatham/putty/lat … /putty.zip
3- VNC Viewer : i use RealVNC youcan download it here http://www.realvnc.com/download/viewer/
Preparing the VPS
Lets download the latest version of epel from the following link: http://ftp-stud.hs-esslingen.de/pub/epel/6/i386/
scoll to the epel-release-x-x.noarch.rpm & copy the link of that file.
the file version while writing this tutorial is epel-release-6-8.noarch.rpm
so we do a wget request to download the file
then when finished we install the rpm package
rpm -ivh epel-release-6-8.noarch.rpm
we importe the key that is needed for the package to work from this address (choose the latest one too) http://ftp-stud.hs-esslingen.de/pub/epel/ in our case its http://ftp-stud.hs-esslingen.de/pub/epe … KEY-EPEL-6
run the following command
rpm --import http://fedora.mirror.nexicom.net/epel/RPM-GPG-KEY-EPEL-6
when this is done you should have the package info for the XFCE to bve installed & you can check it by running the following command
yum search xfce4
you should have result like the screen shot bellow.
Step 01 : installing the Desktop Envirenment
Next we’ll install the desktop with all necessary files for it to work correctly
yum groupinstall Desktop yum groupinstall Fonts yum groupinstall Xfce
Relax take a cup of coffée or a cold beer & let it finish this should take some time.
Step 02 : installing the VNC Server
Now that we’ve finished installing the Desktop Envirenment we’ll install the VNC & in our case its Tightvnc Server:
Run the following command & confirm by typing “Y” when promoted to:
yum install tigervnc-server
Step 03 : Adding User to Run the VNC Envirenment
One good thing to do is run the vnc as user & not as root because it my harm your system if used by unautorized person
lets create a user with a password using the following commands:
useradd vncuser passwd vncuser
now lets login to this user
su -l vncuser
now lets create a password for the vnc envirenment so type:
now enter the password & confirm it again, a promopt will confirm you that the vnc password file was created successfully:
confirm that by these commands:
cd .vnc ls
you should find & passwd file there.
now we go back to the root accoutn just tupe :
if nano is not installed then run this to install it:
yum install nano
now we’ll be editing the vnc server configurations so :
VNCSERVERS="1:vncuser" VNCSERVERARGS="-geometry 1024x786"
this modification will start the server in a resolution of 1024×768 & connect to it as a vncuser on port 1 so if you want to add more users just change 1 by the identification number you want.
Step 04 : Starting the Server at Boot
now we start the vnc server as a service:
service vncserver start
all servers in the above sile will be started with the coppesponding parameters
to stop or restart your vnc server :
service vncserver stop service vncserver restart
Now is you want to start you vnc server whenever your vps boots or restarts do the following:
/sbin/chkconfig vncserver on
this should cover up the installation of the vnc on centos6 with the XFCE desktop envirenment.
Update: Video Version of the Tutorial