#vncserver安装方法
#su - root
rpm -ivh tigervnc-server-1.8.0-13.el7.x86_64.rpm
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
sed -ri 's/\<USER\>/root/g' /etc/systemd/system/vncserver@:1.service
sed -i 's/home\///g' /etc/systemd/system/vncserver@:1.service
#vim /etc/systemd/system/vncserver@:1.service #修改<USER>为root
#ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i"
#PIDFile=/root/.vnc/%H%i.pid
vncpasswd
systemctl daemon-reload
systemctl enable vncserver@:1.service
systemctl restart vncserver@:1.service
systemctl status vncserver@:1.service
如果提示
PID file /root/.vnc/gsmc:1.pid not readable (yet?) after start.
执行mv /tmp/.X11-unix /tmp/.X11-unix_bak正常
systemctl restart vncserver@:2.service
#su - gsmc -c 'vncpasswd'
#systemctl stop vncserver@:1.service
#systemctl start vncserver@:1.service
#killall Xvnc
#vncviewer:root用IP:1
#echo n|vncpasswd<<EOF
#123123
#123123
#EOF