一:服务器端(Centos6.5)
1:安装桌面:
- # yum groupinstall "GNOME Desktop Environment"(CentOS 5.x安装GNOME桌面环境)
复制代码
- # yum groupinstall "X Window System""Desktop"(CentOS 6.x安装GNOME桌面环境)
复制代码
2:安装vncserver
(1) 检查是否已经安装了VNCServer
- [java] view plain copy print?
- [root@centos6 ~]# rpm -qa | grep vnc
- tigervnc-1.0.90-0.17.20110314svn4359.el6.i686
- gtk-vnc-0.3.10-3.el6.i686
- tigervnc-server-1.0.90-0.17.20110314svn4359.el6.i686
- gtk-vnc-python-0.3.10-3.el6.i686
复制代码
- [java] view plain copy print?
- <span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">如果上面的几个rpm包已经存在,说明VNC server已经安装好了,接下来跳转步骤(3)启动vncserver就可以了,否则执行步骤(2)</span>
复制代码
(2) 安装vncServer
- [java] view plain copy print?
- # yum install tigervnc
- # yum install tigervnc-server
复制代码
(3)启动vncserver
第一次启动vncserver需要输入密码两次
- [java] view plain copy print?
- [root@centos6 mnt]# vncserver
-
- You will require a password to access your desktops.
-
- Password:
- Verify:
-
- New 'centos6.xman.org:1 (root)' desktop is centos6.xman.org:1
-
- Creating default startup script /root/.vnc/xstartup
- Starting applications specified in /root/.vnc/xstartup
- Log file is /root/.vnc/centos6.xman.org:1.log
复制代码
注意:
- # /etc/init.d/vncserver restart
复制代码
注:有时候上面的命令启动会报错,直接运行就可以:
注:关闭具体的vncserver命令:vncserver -kill :1vncserver -kill :2
(4) 设置远程登陆到gnome桌面的配置:
- # vim /etc/sysconfig/vncservers(SUSE企业版不用配置此文件)
复制代码
再最后面加入如下两行:
- VNCSERVERS="1:root"
- VNCSERVERARGS[1]="-geometry 1024x768 -alwaysshared-depth 24"
复制代码
注意:如果windows连接的时候出现黑屏(在ip地址和端口没有输出错误的情况下),可将这里的分辨率改为800x600.
(5)防火墙的设置
不设置防火墙连接的时候有可能会被阻止,这是可以选择关闭防火墙或者将VNC的服务器端口号加入到防火墙的信任列表中:
关闭防火墙:service iptables stop
或者:将VNC server添加到linux的防火墙信任列表中
- [java] view plain copy print?
- [root@centos6u2 ~]# vim /etc/sysconfig/iptables
- # then add below line to this file
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 5900:5910 -j ACCEPT
-
- # restart iptables
- [root@centos6u2 ~]# service iptables restart
复制代码
防火墙的其它操作可见:http://blog.csdn.net/jemlee2002/article/details/7042991
二:客户端(windows)
接下来可以在网上下载http://vnc-pe.softonic.cn/vncviewer进行安装。打开输入ip地址和端口号。这里的端口号我也没有弄清楚,我这里输入的是1,你可以试试2 或者5901或者5902,具体我没有研究,有明白的也可以告诉我。
|