参考:https://linux.cn/article-5335-1.html
安装 vnc 服务器
1 yum install tigervnc-server -y
配置 vnc
1 cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
更改配置 /etc/systemd/system/vncserver@:1.service
1 ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i" 2 PIDFile=/home/<USER>/.vnc/%H%i.pid
替换成
1 ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i" 2 PIDFile=/root/.vnc/%H%i.pid
重启 systemd
1 systemctl daemon-reload
设置 vnc 密码
1 vncpasswd
加入开机启动
1 systemctl enable vncserver@:1.service
other
防火墙、端口 balabala