2024年3月28日发(作者:)

CentOS 5.3默认已经安装了VNC Server软件包,只要在服务列表中选中启动一下

就可以。通过编辑文件~HOME/.vnc/xstartup来启动你喜欢的窗口管理器。使用

startkde & 来启动KDE,使用 gnome-session & 来启动GNOME。

一、启动VNC Server服务:使用vncserver命令(在当前用户主目录下生成.vnc文

件夹)

[root@CPAYNET005 ~]# vncserver

You will require a password to access your desktops.

Password:<输入密码>

Verify:<输入密码>

xauth: creating new authority file /root/.Xauthority

New 'CPAYNET005:1 (root)' desktop is CPAYNET005:1

Creating default startup script /root/.vnc/xstartup

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/CPAYNET005:

二、配置VNC Server启动文件

首次创建 ~HOME/.vnc/xstartup 时,指定的窗口管理器是 twm ,它是一个极小的

窗口管理器,几乎每台 X Window 系统机器上都有 twm。twm 不具备完整“桌面管理

器”(象 KDE、GNOME 或 WindowMaker)的大部分花哨功能。下面是修改过的示例:

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