Linux installation switching graphical interface?

1.Description

        ​​​​A test server was installed using a minimal installation and did not install a "server with GUI" environment.

        I want to install it when using it: because when using vncserver, the connection does not display the graphical interface

2. Install the graphical interface

yum groupinstall "Server with GUI"
--或者
--yum groupinstall “GNOME Desktop” “Graphical Administration Tools”
--查看组信息
[root@test ~]# yum grouplist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Installed Environment Groups:   --已经安装的环境分组
   Server with GUI
Available Environment Groups: 	--可用的环境分组
   Minimal Install 							--最小安装
   Compute Node								--计算节点
   Infrastructure Server 					--基础设施服务器
   File and Print Server					--文件及打印服务器
   Basic Web Server							--基本网页服务器
   Virtualization Host 						--虚拟化主机
   GNOME Desktop 							--GNOME 桌面
   KDE Plasma Workspaces 					--KDE Plasma Workspaces
   Development and Creative Workstation 	--开发及生成工作站
Available Groups: 				--可用组
   Compatibility Libraries 					--兼容性程序库
   Console Internet Tools 					--控制台互联网工具
   Development Tools 					 	--开发工具
   Graphical Administration Tools 			--图形管理工具
   Legacy UNIX Compatibility 				--传统 UNIX 兼容性
   Scientific Support 						--科学记数法支持
   Security Tools 							--安全性工具
   Smart Card Support 						--智能卡支持
   System Administration Tools 				--系统管理工具
   System Management 						--系统管理
Done

    Here I directly installed the GUI environment group. Of course, you can also install only the graphical desktop GNOME.

3.Switch

        Server switching generally uses 3 character interface and 5 graphical interface. The switching command can be found in /etc/inittab

[root@test ~]# cat /etc/inittab 
# inittab is no longer used when using systemd.
#
# ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target
#
# systemd uses 'targets' instead of runlevels. By default, there are two main targets:
#
# multi-user.target: analogous to runlevel 3
# graphical.target: analogous to runlevel 5
#
# To view current default target, run:
# systemctl get-default
#
# To set a default target, run:
# systemctl set-default TARGET.target
#
--备注:
0:系统停机/关机模式,系统默认运行级别不能设置为0,否则不能正常启动,一开机就自动关机。
1:单用户模式,root权限,用于系统维护,禁止远程登陆,就像Windows下的安全模式登录。
2:多用户模式,没有NFS网络支持。
3:完整的多用户文本模式,有NFS,登陆后进入控制台命令行模式。
4:系统未使用,保留一般不用,在一些特殊情况下可以用它来做一些事情。例如在笔记本电脑的电池用尽时,可以切换到这个模式来做一些设置。
5:图形化模式,登陆后进入图形GUI模式或GNOME、KDE图形化界面,如x Windows系统。
6、系统正常关闭并重启,默认运行级别不能设为6,否则不能正常启动,就会一直开机重启开机重启。

        I mainly use vnc here, so I won’t switch here. 

systemctl set-default multi-user.target //Switch character interface

systemctl set-default graphical.target //Switch graphical interface

4.vncserver

        vncserver also appears normal. vncserver is a remote desktop protocol that allows users to access and control computers remotely. It allows users to connect to a remote computer over a network and view or control the desktop environment on the remote computer. vncserver is often used in Linux and Unix operating systems. It can remotely connect and control Linux or Unix servers through VNC client software.

        So even if the server runlevel is 3, it does not affect the graphical interface of vnc.

        Pay attention and don’t get lost 

Guess you like

Origin blog.csdn.net/qq_63693805/article/details/133852279