[root@localhost ~]# rpm -qa |grep vnc gvnc-0.5.2-7.el7.x86_64 tigervnc-server-minimal-1.3.1-4.el7_2.x86_64 gtk-vnc2-0.5.2-7.el7.x86_64 tigervnc-license-1.3.1-4.el7_2.noarch tigervnc-server-minimal-1.3.1-3.el7.x86_64 tigervnc-license-1.3.1-3.el7.noarch libvncserver-0.9.9-9.el7_0.1.x86_6
[root@localhost ~]# yum installtigervnc-server tigervnc-server-module
[root@localhost ~]# systemctl disable firewalld.service [root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
若出現cannot stat ‘/lib/systemd/system/vncserver@.service’: No such fileor directory從新yum安裝便可vim
[root@localhost ~]# vim /etc/systemd/system/vncserver@:1.service [Unit] Description=Remote desktop service (VNC) After=syslog.target network.target [Service] Type=forking # Clean any existing files in/tmp/.X11-unix environment ExecStartPre=/bin/sh -c '/usr/bin/vncserver-kill %i > /dev/null 2>&1 || :' ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i" PIDFile=/root/.vnc/%H%i.pid ExecStop=/bin/sh -c '/usr/bin/vncserver-kill %i > /dev/null 2>&1 || :'
#這裏使用root用戶,將<user>換成root,PIDFile路徑注意去掉/home/!bash
[root@localhost~]# systemctl enable vncserver@:1.service
[root@localhost ~]# vncpasswd
[root@localhost ~]# systemctl start vncserver@:1.service
[root@localhost ~]# netstat -nat | grep 590* tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN tcp6 0 0 :::5901 :::* LISTEN
[root@localhost ~]# grep vnc/var/log/messages