[[email protected] ~]# dnf groupinstall “workstation”
或者
[[email protected] ~]# dnf groupinstall “Server with GUI”
启用图形模式:
[[email protected] ~]# systemctl set-default graphical
然后
[[email protected] ~]# reboot
安装VNC配置远程连接
[[email protected] dnf install -y tigervnc-server tigervnc-server-module
设置 VNC 密码
[[email protected] ~]# vncpasswd
设置 VNC 服务器配置文件
[[email protected] ~]# vim /etc/systemd/system/[email protected]
[Unit]
Description=Remote Desktop VNC Service
After=syslog.target network.target
[Service]
Type=forking
WorkingDirectory=/root
User=root
Group=root
ExecStartPre=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :’
ExecStart=/usr/bin/vncserver -autokill %i
ExecStop=/usr/bin/vncserver -kill %i
[Install]
WantedBy=multi-user.target
启动 VNC 服务并允许防火墙中的端口
[[email protected] ~]# systemctl daemon-reload
[[email protected] ~]# systemctl start [email protected]:1.service
[[email protected] ~]# systemctl enable [email protected]:1.service