在linux下使用vnc的机会也不多,也就是几个数据库的安装,自从学会了在命令行下安装Oracle之后,更是将之忘记得一干二净,近来搞DB2又不得不把它捣鼓起vnc了。
[root@www db2]# vncserver
You will require a password to access your desktops.
Password:
Verify:
xauth: creating new authority file /root/.Xauthority
New 'www:1 (root)' desktop is www:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/www:1.log
[root@www db2]# cd ~/.vnc/
[root@www .vnc]# ls
passwd www:1.log www:1.pid xstartup
[root@www .vnc]# vim xstartup
[root@www .vnc]# pwd
/root/.vnc
[root@www .vnc]# vim xstartup
# 修改 xstartup
[root@www .vnc]# cat 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" &
# twm & # 注释这一行
gnome-session& # 添加这一行
[root@www db2]# vncserver -kill :1
[root@www db2]# vncserver