一、安装VNC相关包
yum-yinstalltigervnctigervnc-servertigervnc-server-module
二、复制配置模板文件为vncserver@:1.service
cp/lib/systemd/system/vncserver@.service/lib/systemd/system/vncserver@:1.service
- [root@kvm01~]#cat/lib/systemd/system/vncserver\@\:1.service|grep-v^#|grep-v^$
- [Unit]
- Description=Remotedesktopservice(VNC)
- After=syslog.targetnetwork.target
- [Service]
- Type=forking
- ExecStartPre=/bin/sh-c'/usr/bin/vncserver-kill%i>/dev/null2>&1||:'
- ExecStart=/usr/sbin/runuser-lroot-c"/usr/bin/vncserver%i"
- PIDFile=/root/.vnc/%H%i.pid
- ExecStop=/bin/sh-c'/usr/bin/vncserver-kill%i>/dev/null2>&1||:'
- [Install]
- WantedBy=multi-user.target
四、设置VNC用户密码
vncpasswd
输入两次密码,完成密码设置
五、重新载入system配置
systemctldaemon-reload