日期:2014-05-16  浏览次数:20738 次

Linux环境VNC服务安装、配置与使用

1.确认VNC是否安装
默认情况下,Red Hat Enterprise Linux安装程序会将VNC服务安装在系统上。
确认是否已经安装VNC服务及查看安装的VNC版本
[root@testdb ~]# rpm -q vnc-server
vnc-server-4.1.2-9.el5
[root@testdb ~]#

若系统没有安装,可以到操作系统安装盘的Server目录下找到VNC服务的RPM安装包vnc-server-4.1.2-9.el5.x86_64.rpm,安装命令如下
rpm -ivh /mnt/Server/vnc-server-4.1.2-9.el5.x86_64.rpm

2.
启动VNC服务
使用vncserver命令启动VNC服务,命令格式为“vncserver :桌面号,其中桌面号数字的方式表示,每个用户连个需要占用1个桌面
启动编号为1的桌面示例如下
[root@testdb ~]# vncserver :1

You will require a password to access your desktops.

Password:
Verify:
xauth:? creating new authority file /root/.Xauthority

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

Creating default startup script. /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/testdb:1.log

?上命令执行的过程中,因为是第一次执行,需要输入密码,这个密码被加密保存在用户主目录下的.vnc子目录(/root/.vnc/passwd)中;同?时在用户主目录下的.vnc子目录中为用户自动建立xstartup配置文件(/root/.vnc/xstartup),在每次启动VND服务时,都会?读取该文件中的配置信息。
BTW
/root/.vnc/目录下还有一个“testdb:1.pid”文件,这个文件记录着启动