Centos 8 安装图形化桌面

[root@centos8 ~]# dnf groupinstall “workstation”
或者
[root@centos8 ~]# dnf groupinstall “Server with GUI”

启用图形模式:
[root@centos8 ~]# systemctl set-default graphical

然后
[root@centos8 ~]# reboot

安装VNC配置远程连接
[root@centos8 dnf install -y tigervnc-server tigervnc-server-module

设置 VNC 密码
[root@centos8 ~]# vncpasswd
设置 VNC 服务器配置文件
[root@centos8 ~]# 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 服务并允许防火墙中的端口
[root@centos8 ~]# systemctl daemon-reload
[root@centos8 ~]# systemctl start vncserver@:1.service
[root@centos8 ~]# systemctl enable vncserver@:1.service

在这里插入图片描述

发布了13 篇原创文章 · 获赞 2 · 访问量 199

猜你喜欢

转载自blog.csdn.net/weixin_46389364/article/details/104804703
今日推荐