I referred the following steps :
=======================
1. On server-linux(Which will be accessed) : yum install vnc*
2. On client-linux(who will access the remote desktop of the server ) : yum install vncviewer
Note : You can install the tigerVNC instead of yum. Just download the package and install it on both client and server. Here is the URL :
----------
http://sourceforge.net/projects/tigervnc/files/
----------
3. On server :
Enter command : vncpasswd
now setup a password to connect it via vnc
4. vi /etc/sysconfig/vncservers
Do the following (You can setup another user):
VNCSERVERS="1:root"
PS : here user is root
5. chkconfig vncserver on
6. service vncserver start
7. allow port 5901 at firewall
8. restart vncserver like " service vncserver restart
9. vi /root/.vnc/xstartup and comment following lines :
----
#unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
----
Note : In case of tigerVNC you don't need to do this.
10. On client :
Execute command : vncviewer
Enter IP of the server and password of the server. Now remote desktop will appear. OR you can access the rdesktop like :
-----
[kmaiti@kmaiti ~]$ vncviewer 10.65.211.80:1
-----
Here 10.65.211.80 is the IP of the remote linux server and 1 is the 1st user which is root.
To access the server from windows machine please install vncviewer on it and execute the binary. Then put IP of the server and password. that's it.
Here are the content of the files on linux server.
----------------
[root@vm80 /]# cat /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
#
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-nohttpd" to prevent web-based VNC clients connecting.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
VNCSERVERS="1:root"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
[root@vm80 /]#
[root@vm80 /]# cat /root/.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 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session &
#twm &
[root@vm80 /]#
----------------
========================
Try :)
0 comments:
Post a Comment