How to configure vnc session with gnome desktop in Cent OS
Step 1
Install vncserver
#yum install vncserver
Step 2
Install gnome-desktop in linux
#yum groupinstall -y "GNOME Desktop"
Step 3
Start vncserver
#/etc/init.d/vncserver start
Step 4
Create some users in order to
configure multiple vnc sessions,
#adduser vnc1
#passwd vnc1 “give
a suitable password for the user”
#adduser vnc2
#passwd vnc12 “give
a suitable password for the user”
Step 5
In order to get elevated privilege for the above users we
have to add them to the sudoer’s file as shown below, before that please change the file permission to 440(#chmod /etc/sysconfig/sudoers)
#visudo and add the below details to the file as shown
below,
## Allow root to run any commands
anywhere
root ALL=(ALL) ALL
thinkpalm ALL=(ALL) ALL
vnc1 ALL=(ALL) ALL
vnc2 ALL=(ALL) ALL
Step 6
Edit /etc/sysconfig/vncserver file add the below details,
VNCSERVERS="2:vnc1 3:vnc2 4:vnc3"
Step 7
Restart vnc server and as a result it will create
sessions like,
“ip address”:2
“ip address”:3
“ip address”:4
Step 8
The above step will not give the gnome desktop while
logging in using vnc viewer, in order to
get the gnome environment we have to edit the xstartup file located on each users home directory (ie, /home/username/.vnc/xstartup) and the
highlighted value,
# 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
&
exec
gnome-session &
Comments
Post a Comment