vnc的安装配置:
查找vnc相应的安装包:
[root@bogon ~]# yum list | grep vnc
gtk-vnc.i686 0.3.10-3.el6 base
gtk-vnc.x86_64 0.3.10-3.el6 base
gtk-vnc-devel.i686 0.3.10-3.el6 base
gtk-vnc-devel.x86_64 0.3.10-3.el6 base
gtk-vnc-python.x86_64 0.3.10-3.el6 base
libvncserver.i686 0.9.7-4.el6 base
libvncserver.x86_64 0.9.7-4.el6 base
libvncserver-devel.i686 0.9.7-4.el6 base
libvncserver-devel.x86_64 0.9.7-4.el6 base
tigervnc.x86_64 1.1.0-8.el6_5 updates
tigervnc-server.x86_64 1.1.0-8.el6_5 updates
tigervnc-server-applet.noarch 1.1.0-8.el6_5 updates
tigervnc-server-module.x86_64 1.1.0-8.el6_5 updates
在Centos6中名称已改成tigervnc了,真的很奇怪。
安装tigervnc:
[root@bogon ~]# yum -y install tigervnc.x86_64 tigervnc-server.x86_64
设置vncserver自动启动:
[root@bogon ~]# chkconfig --list | grep vnc
vncserver 0:off1:off2:off3:off4:off5:off6:off
[root@bogon ~]# chkconfig vncserver on
[root@bogon ~]# chkconfig --list | grep vnc
vncserver 0:off1:off2:on3:on4:on5:on6:off
增加vnc的测试用户且配置vnc接入密码:
[root@bogon ~]# useradd vnc1
[root@bogon ~]# passwd vnc1
[root@bogon ~]# su vnc1
[vnc1@bogon root]$ vncpasswd
Password:
Verify:
要想root用户也能通过vnc的方式接入服务器,也要为root用户设置vnc密码。
配置vncservers配置文件:
[root@bogon ~]# vim /etc/sysconfig/vncservers #在最后增加下行
VNCSERVERS="1:root 2:vnc1"
启动vncserver服务:
[root@bogon ~]# service vncserver start
PS:
一些资料上说建议修改用户家目录下的“~/.vnc/xstartup”文件的最后的“twm &”,把这行替换成“gnome-seesion &”,如果是KDE桌面那就修改成“startKDE &”,保存后重新启动vncserver服务。
twm 启动twm窗口管理器
gnome-seesion 启动gnome的窗口管理器
startKDE 启动KDE的窗口管理器
但我没有发现有什么区别。
最后下载realvnc来进行测试:
######################## Test VNC server ######################
Now, download VNCViewer onto our desktop computer from which we want to access the shared
desktop.
download link: http://www.realvnc.com/download/viewer/
start vnc tool & type
serverip:1 or serverip:2 [1 for root user & 2 for vnc1 user]
example:
192.168.1.200:1 or 192.168.1.200:2 (192.168.1.200 is vncserver Ip)
Enter the password that we created using the vncpasswd command: