文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档> 如何设置VNC使之在启动时运行GNOME或KDE?

如何设置VNC使之在启动时运行GNOME或KDE?

时间:2009-07-16  来源:benxiong

相关版本:Red Hat Enterprise Linux 3,Red Hat Enterprise Linux 4,Red Hat Enterprise Linux 5

VNC xstartup程序中默认的设定值是启动twm,而不是GNOME或KDE。

默认的配置文件在第一次启动vncserver之前,运行vncpasswd命令创建密码的时候生成在用户的家目录中:


${HOME}/.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" &
twm &

为了启动GNOME或者KDE,先去掉“unset SESSION_MANAGER“和”exec /etc/X11/xinit/xinitrc“这两行的注释,然后将twm&注释掉,最后添加“gnome-start”,其设置如下:


#!/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-start &

类似的,如果要启动KDE,需要修改为:


#!/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 &
startkde &

修改配置文件后,关闭所有客户端vncviewer连接,然后重启动VNC,GNOME或KDE即已做为默认桌面。


service vncserver restart
相关阅读 更多 +
排行榜 更多 +
浴血混战官方下载

浴血混战官方下载

飞行射击 下载
检票员模拟器免广告下载

检票员模拟器免广告下载

模拟经营 下载
最终前哨最终版手机版下载

最终前哨最终版手机版下载

休闲益智 下载