连接oracle用户的图形界面设置:
1: [root@master ]# vim /etc/sysconfig/vncservers 添加如下两行:
VNCSERVERS="89:oracle" --配置oracle的桌面是89,如果要设置多用户则:VNCSERVERS="89:oracle 90:root"
VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
--如果不做以上修改,/etc/init.d/vncserver restart 会报:no displays configured
2:[oracle@master ~]$ vncserver :89
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
You will require a password to access your desktops.
Password: --设置vnc的访问密码
Verify:
Passwords don't match - try again
Password:
Verify:
xauth: creating new authority file /home/oracle/.Xauthority
New 'master.wonder.com:89 (oracle)' desktop is master.wonder.com:89
Creating default startup script /home/oracle/.vnc/xstartup
Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/master.wonder.com:89.log
3:配置oracle桌面89
[oracle@master ]$ vim /home/oracle/.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 & --删除twn &,添加此行
5: [oracle@master ]$ vncpasswd --设置访问密码,和上面的设置密码相同即可
6: [root@master ]# /etc/init.d/vncserver restart --重启服务才生效
7:下载一个vnc客户端,访问 ip:89 或者 ip:90 即可,ip为公网IP也可以
8:如果连接后界面显示灰色,则检查/home/oracle/.vnc/master.wonder.com:89.log日志,如果发现提示gnome-session 命令找不到, yum install gnome-session 即可. 连接后,在终端选择 Bitstream Vera Sans Mono字体,Roman样式,相当好看!!!!
注意:以上执行命令时使用的用户名,涉及权限问题。