RHEL 6 下 VNC Server 的配置详解
1 VNC的安装
在Linux 主机上安装 VNC Server ,在主控端安装VNC Viewer [root@localhost ~]# yum install tigervnc* Installing:
tigervnc x86_64 1.0.90-0.15.20110314svn4359.el6 RHEL6 261 k tigervnc-server x86_64 1.0.90-0.15.20110314svn4359.el6 RHEL6 1.0 M Install 2 Package(s) Total download size: 1.3 M Installed size: 3.5 M Is this ok [y/N]: y
Installed:
tigervnc.x86_64 0:1.0.90-0.15.20110314svn4359.el6 tigervnc-server.x86_64 0:1.0.90-0.15.20110314svn4359.el6 Complete!
2 在Linux 上启动 VNC Server
随后启动 VNC Server,这时会要求你输入两次进行连接的初始密码。 [root@localhost ~]# vncserver
You will require a password to access your desktops.
Password: //输入密码 Verify: //再次输入密码
xauth: creating new authority file /root/.Xauthority
New ‘localhost.localdomain:1 (root)’ desktop is localhost.localdomain:1 Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/localhost.localdomain:1.log
启动后系统默认打开的是1号登录端口,并以root用户登录,也可以使用命令来设置密码 [root@localhost ~]#vncpasswd Password: //输入密码 Verify: //再次输入密码
再次运行vncserver ,打开的是2号虚拟服务端口,如果再次运行端口号,则依次往下排序 [root@localhost ~]# vncserver
New 'localhost.localdomain:2 (root)' desktop is localhost.localdomain:2 Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/localhost.localdomain:2.log
3 以图形界面登录linux
那么需要修改/root/.vnc/xstartup的配置文件。 使用 vi 打开 xstartup 文件,如下: [root@localhost /]# cd /root/.vnc [root@localhost .vnc]# vi xstartup 添加如下内容:
unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc
4. 重启动 VNC Server
[root@localhost ~]# vncserver -kill :1 Killing Xvnc process ID 21198 [root@localhost ~]# vncserver
New ‘localhost.localdomain:1 (root)’ desktop is localhost.localdomain:1 Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/localhost.localdomain:1.log
5 在windows 端使用VNC Viewer 进行远程管理
在windows 下运行VNC Viewer ,输入Linux的IP地址及端口号 这里的端口号要用5900+虚拟服务端口号
即可登录linux