My blog has moved! Redirecting...

You should be automatically redirected. If not, visit http://techienote.com and update your bookmarks.

Tech Resources

Sunday, April 5, 2009

VNC Server on CentOS

RealVNC provides remote control software which lets you see and interact with desktop applications across any network.
The software has a widespread user base from individuals to the largest multi-national companies. Founded by the original developers of VNC to promote, enhance and commercialise VNC.

Operating System:
CentOS5.2

VNC Server version:
vnc-server-4.1.2.14

Installing VNC Server:

#cd /usr/local/src/
#wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
#rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
#rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
#yum -y install vnc vnc-server

Configuring VNC Server:

#echo 'VNCSERVERS="1:root"' >> /etc/sysconfig/vncservers

Before starting vncserver as a service, let's create a vnc password with vncpasswd command.

[root@localhost ~]#vncpasswd
Password:
Verify:

Now let's start vncserver as a service.

#service vncserver start



If you edit the script called xstartup, you will notice following comment in red.
Uncomment those two lines in red as shown below!!! Otherwise, you will get nothing but grey screen.

#cd /root/.vnc
#vi xstartup

#!/bin/sh

# Uncomment the following two lines for normal desktop:

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &


Since we've just edited vnc startup script, let's restart the vncserver.

#service vncserver restart

So how do I connect to vncserver? Use vncviewer command in vnc client as following.

[root@localhost ~]$ vncviewer localhost:1

Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home