How to install VNC Server.

For RHEL5 or Centos

yum groupinstall “KDE (K Desktop Environment)”
yum install vncserver

Edit the lines below in the file /etc/sysconfig/vncservers and add a user “test1″
(user should be a valid user).

VNCSERVERS=”1:test1″
VNCSERVERARGS[1]=”-geometry 1024×768 -depth 16″

To add more users, just add the lines in the next box below for second user. You can continue with more number of users.
Now the port for user one is 5900+1=5901, The port for user two is 5900+2=5902 and so on.

VNCSERVERS=”2:newuser”
VNCSERVERARGS[2]=”-geometry 1024×768 -depth 16″

Add a password

$ vncpasswd
Password:
Verify:

Edit the startup script

$ vi ~/.vnc/xstartup

# Uncomment the following two lines for normal desktop:

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

/etc/X11/xinit/xinitrc: Bourne-Again shell script text executable

Go for Reboot. When the server is back type the command below to start the VNC server.

$ vncserver :1

Connect to VNC server from your local machine.

(Dont forge to allow 5901 in your firewall.)

$ vncviewer IP:5901

Now you can login using the login created previously.

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.