Step 1: Login as root user
Install vncserver rpm package, check whether its already installed or not
vnc-server-4.1.2-14.el5_5.4.x86_64.rpm
[root@ebsdev ~]# rpm -q vnc-server-4.1.2-14.el5_5.4.x86_64
vnc-server-4.1.2-14.el5_5.4
[root@ebsdev ~]#
Step 2: password for vncserver
[root@ebsdev ~]# vncpasswd
Password:
Verify:
[root@ebsdev ~]#
Step 3:
[root@ebsdev ~]# vncserver
xauth: creating new authority file /root/.Xauthority
New ‘ebsdev.ace-ins.com:1 (root)’ desktop is ebsdev.ace-ins.com:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/ebsdev.ace-ins.com:1.log
Step 4:
[root@ebsdev ~]# vi .vnc/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 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
twm &
remove the command from unset and exec
[root@ebsdev ~]# vi .vnc/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 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
twm &
Step 5:
[root@ebsdev ~]# vncserver -kill :1
Killing Xvnc process ID 20106
[root@ebsdev ~]#
Step 6:
[root@ebsdev ~]# vncserver
New ‘ebsdev.ace-ins.com:1 (root)’ desktop is ebsdev.ace-ins.com:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/ebsdev.ace-ins.com:1.log
[root@ebsdev ~]#
Step 7: Download vncviewer
http://www.realvnc.com/download/viewer/
Step 8: connect the host with vncviewer
Note : Some times you cann’t able connect your host, in this case check your firewall of linux and If already vncserver process aviable, kill the session using by vncserver -kill :1
If you want to connect the server which was installed on RHEL 7, you just install “tigervnc-server-1.8.0-5.el7.x86_64.rpm” and then start vncserver & you can able to connect the server using vncviewer from your pc.


