1、卸载旧版本
rpm -e *************
2、安装
811 rpm -ivh tigervnc-1.8.0-13.el7.x86_64.rpm
812 rpm -ivh tigervnc-icons-1.8.0-13.el7.noarch.rpm
813 rpm -ivh tigervnc-1.8.0-13.el7.x86_64.rpm
814 rpm -ivh tigervnc-license-1.8.0-13.el7.noarch.rpm
815 rpm -ivh tigervnc-server-1.8.0-13.el7.x86_64.rpm
816 rpm -ivh tigervnc-server-applet-1.8.0-13.el7.noarch.rpm
817 rpm -ivh tigervnc-server-minimal-1.8.0-13.el7.x86_64.rpm
818 rpm -ivh tigervnc-server-module-1.8.0-13.el7.x86_64.rpm
819 rpm -ivh tigervnc-server-minimal-1.8.0-13.el7.x86_64.rpm
依赖该升的升
822 rpm -ivh libXfont2-2.0.3-1.el7.x86_64.rpm
823 rpm -ivh tigervnc-server-minimal-1.8.0-13.el7.x86_64.rpm
也可以用rpm -Uvh升级
841 rpm -Uvh tigervnc-license-1.8.0-13.el7.noarch.rpm
842 rpm -Uvh tigervnc-server-minimal-1.8.0-13.el7.x86_64.rpm
3、复制配置、修改文件
845 cp /lib/systemd/system/[email protected] /etc/systemd/system/vncserver@:1.service
vim /etc/systemd/system/vncserver@:1.service
修改用户
重加载 systemd
[root@linuxidc ~]# systemctl daemon-reload
4、为VNC设密码
[root@linuxidc ~]# vncpasswd
5、vim /etc/sysconfig/iptables
在合适位置加上
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5900:5903 -j ACCEPT
重启iptable
service iptables restart
如果是用Centos 7 默认防火墙的可能需要
[root@linuxidc ~]# firewall-cmd --permanent --add-service vnc-server
[root@linuxidc ~]# systemctl restart firewalld.service
第六步,设默认启动并开启VNC
[root@linuxidc ~]# systemctl enable vncserver@:1.service