chattr +i /etc/resolv.conf
yum install -y tigervnc tigervnc-server
yum groupinstall "Desktop"
yum install gnome-panel
yum install nautilus
vncpasswd
vi ~/.vnc/xstartup
#!/bin/sh
[ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
export LANG
export SYSFONT
vncconfig -iconic &
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
OS=`uname -s`
if [ $OS = 'Linux' ]; then
case "$WINDOWMANAGER" in
*gnome*)
if [ -e /etc/SuSE-release ]; then
PATH=$PATH:/opt/gnome/bin
export PATH
fi
;;
esac
fi
if [ -x /etc/X11/xinit/xinitrc ]; then
exec /etc/X11/xinit/xinitrc
fi
if [ -f /etc/X11/xinit/xinitrc ]; then
exec sh /etc/X11/xinit/xinitrc
fi
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
gnome-session &
vi /etc/sysconfig/vncservers
VNCSERVERS="1:root 2:oracle"
VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERARGS[2]="-geometry 1024x768"
cp -r /root/.vnc ~oracle/.vnc
chown oracle ~oracle/.vnc/
chown oracle.oinstall -R ~oracle/.vnc/
chown oracle ~oracle/.vnc/
chown oracle.oinstall -R ~oracle/.vnc/
# su - oracle #切换到之前创建好的oracle用户去创建vnc登陆密码
$ vncpasswd #输入两次密码即可
service vncserver restart/start/stop #启动与关闭vnc