标签:vnc
确保桌面已安装
yum -y install xorg-x11-app*
yum -y install tigervnc tigervnc-server tigervnc-server-module
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
vim /etc/systemd/system/vncserver@:1.service
[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=/home/root/.vnc/%H%i.pid
# root账号
PIDFile=/root/.vnc/%H%i.pid
ExecStop=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :‘
vncpasswd
systemctl daemon-reload
systemctl start vncserver@:1.service
systemctl enable vncserver@:1.service
vncserver -list
# firewall-cmd --permanent --add-service="vnc-server" --zone="public"
# firewall-cmd --reload
ip:5901(ip:1)
本文出自 “zhangzhk” 博客,请务必保留此出处http://zhangzhk.blog.51cto.com/7667140/1965260
标签:vnc
原文地址:http://zhangzhk.blog.51cto.com/7667140/1965260