•tigervnc-server-1.1.0-5.el6_4.1.x86_64.rpm
•pixman-0.32.8-1.el6.x86_64.rpm
•pixman-devel-0.32.8-1.el6.x86_64.rpm
•libXfont-1.5.1-2.el6.x86_64.rpm
•打包下载[1]
检测是否已安装相应的rpm包
rpm -qa | grep tigervnc
rpm -qa | grep pixman
rpm -qa | grep libXfont
(必要时候使用 --force忽略软件包及文件的冲突 --nodeps 不检查依赖性关系 )
rpm -ivh tigervnc-server-1.1.0-5.el6_4.1.x86_64.rpm
rpm -ivh pixman-0.32.8-1.el6.x86_64.rpm
rpm -ivh pixman-devel-0.32.8-1.el6.x86_64.rpm
rpm -ivh libXfont-1.5.1-2.el6.x86_64.rpm
vi /root/.vnc/xstartup
删除最后两行#
将其中的unset 和exec前面的注释去掉
停用防火墙
service iptables stop
修改端口配置文件
vi /etc/sysconfig/iptables
类似位置添加如下内容,多个端口添加多行
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
启动防火墙
service iptables start
重启防火墙
service iptables restart
查看防火墙状态
service iptables status
启动vncserver
vncserver
启动vncserver
service vncserver start
停止vncserver
service vncserver stop
重启vncserver
service vncserver restart
查看vncserver运行状态
service vncserver status
查看VNC使用端口
netstat -tlup | grep vnc
telnet x.x.x.x port
修改vnc密码
vncpasswd
1.The connection was refused by the host computer
•kill $(pgrep Xvnc)
•vncserver
2.No X11 DISPLAY
•export DISPLAY=:0.0
3./usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
•yum install -y pixman pixman-devel libXfont
4.no displays configured
•vi /etc/sysconfig/vncservers,添加如下两行内容至文件末尾
•VNCSERVERS="2:root"
•VNCSERVERARGS[2]="-geometry 800x600 -query localhost"
References
[1]
打包下载: https://share.weiyun.com/5EwMlgo
[2]
vncserver 配置: https://jingyan.baidu.com/article/92255446a89400851648f4b9.html
[3]
The connection was refused by the host computer: https://www.landui.com/help/show-2061.html
[4]
The connection was refused by the computer: https://linuxacademy.com/community/posts/show/topic/19320-the-connection-was-refused-by-the-computer
[5]
No X11 DISPLAY: https://stackoverflow.com/questions/662421/no-x11-display-variable-what-does-it-mean
[6]
如何在Linux上安装配置VNC服务: https://jingyan.baidu.com/article/eb9f7b6d5ff296869264e858.html
[7]
VNC 服务:no displays configured: https://blog.csdn.net/kepa520/article/details/48877067