centeros8 graphical interface settings

Based on considerations of performance and versatility, the official public Linux system images provided by Alibaba Cloud do not install graphical desktop components by default.

  1. Connect to the Linux instance through the management terminal

  2. Execute the following command to install the software package of the graphical desktop.

    yum groupinstall "Server with GUI" -y 
    
  3. Execute the following command to set the graphics mode as the default mode to start.

    systemctl set-default graphical
    
  4. Execute the following command to restart the instance

    reboot
    
  5. Close the current terminal connection and connect to the instance through the VNC of the ECS management console

Normal centeros8 according to the graphical

Centos 8 Server installation graphical interface visual desktop (super detailed)

Centos 8 Server installation graphical interface visual desktop (super detailed)

Before starting, please check your Centos version and whether you have root account authority.

1. Install the Centos GUI and restart

1. Download and install the GUI

  • Excuting an order
yum groupinstall "Server with GUI" -y
  • The installation takes a long time, and the situation in the figure below indicates that the installation is complete.

    img

2. Switch the graphics mode to the default boot mode

  • Excuting an order
systemctl set-default graphical
  • The following figure shows that the switch is successful

    img

3. Restart the system

  • Excuting an order
reboot

2. VNC connection server

1. Download and install VNC

  • Excuting an order
yum install tigervnc-server tigervnc-server-module -y
  • The picture below shows the success

    img

2. Configure VNC password

  • Excuting an order
vncpasswd
  • The figure below shows the situation after execution, generally choose n
vncserver

3. Start the VNC server

  • Excuting an order
ps -aux | grep vnc

4. Check the VNC service port

  • Excuting an order
ps -aux | grep vnc
  • As shown in the figure below, 5901 is the port

    img

    Note: The cloud server needs to add port 5901 to the security group first, please Baidu for details.

5. The computer uses the VNC client to connect to the server

  • Download the VNC client first

Summary of Centos 8 Installing Graphical Desktop Core Steps

[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

[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-hCM4cdQW-1676738373613)(null)]

Attachment: CentOS8 graphical interface and command line switching

1. 查看目前默认的启动默认
systemctl get-default
命令行模式  :multi-user.target
图形界面模式: graphical.target
2. 设置为图形界面模式
systemctl set-default graphical.target
3. 设置为命令行模式
systemctl set-default multi-user.target

Ask for likes and forward

Guess you like

Origin blog.csdn.net/yumuing/article/details/129106783