1,查看系統版本信息
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)
2,安裝 VNC Server
[root@localhost ~]# dnf install -y tigervnc-server tigervnc-server-module
3,複製配置文件
[root@localhost ~]# cp /lib/systemd/system/[email protected] /etc/systemd/system/vncserver@:1.service
4,添加用戶
[root@localhost ~]# vim /etc/tigervnc/vncserver.users
# TigerVNC User assignment
#
# This file assigns users to specific VNC display numbers.
# The syntax is <display>=<username>. E.g.:
#
# :2=andrew
# :3=lisa
:1=root
5,初始化
[root@localhost ~]# systemctl daemon-reload
6,創建 vncviewer 登錄密碼
[root@localhost ~]# vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used
7,啓動 vncserver
[root@localhost ~]# systemctl start vncserver@:1.service
[root@localhost ~]# systemctl enable vncserver@:1.service
[root@localhost ~]# systemctl status vncserver@:1.service
8,VNC Viewer 登錄