Install CentOS 7 on a virtual machine and solve graphical interface problems

Find the CentOS image file from the network

This file may be a bit slow to download, you can go to GitHub to find it yourself, so I won’t talk about it.

After downloading the image file of CenOS, the installation begins

Steps

Create a new virtual machine, first create an empty disk

Select your own version of the image file here

Network address can choose NAT

The meaning of bridging the network here is: it is equivalent to assigning an address to the virtual machine in the network. Others can see this virtual machine. It is equivalent to a real computer. To use this method, you need to Configure your own IP address

For NAT network address translation , this is to share a network address with your computer. From the network, others cannot see the existence of your virtual machine, only you can see it

What is the third host-only mode ? This is because the virtual machine needs to be connected to the network. It only communicates with the host and does not play with others, so this does not use the network.

The fourth one is easy to understand without a network connection, that is, simply put a virtual machine there, and do not play with anyone

Then go straight to the next step, here I choose to use a single file

Click on the custom hardware, select your own image file here (downloaded CenOS 7)

Click Finish, click Run to start the installation

GUI not installed

After selecting the language, click this, and then click Finish to automatically assign it. Then configure the network

Click on the network and host name , enter and open that

Then wait for the installation, set the root password, and the user name to complete the setup

After the completion, you can restart the login, as shown in the figure, I use the username to log in

This completes the installation, but there is no graphical interface.

Install GUI

选择完语言后,点击这个,再点击完成,自动分配即可。然后进行安装,(看下面的软件选择)

配置网络连接,(我们采用NAT连接)

点开之后,把这个打开,看见出来了IP地址,掩码什么的就好了

注意看你现在软件选择那一栏是最小安装,什么意思?就是你安装完之后是没有图形化界面的,最小化安装就是最优,省去那些图形化界面,如果你想加上图形化界面可以在这里面点开,软件选择(如图)

把GNOME 桌面给点上。(也可以从右侧一栏选择你需要的程序,看自己需求)

然后开始安装

你可以在安装的时候选择,root管理员密码的设置,和用户名的设置。

安装完成,进行重启,进入后是图形化界面,如图

进行ping baidu.com,ping通说明网络没有问题

没有安装时候选择图形化界面后如何再安装图形化界面

首先进入虚拟机你需要使用root管理员用户进行登陆

再安装图形化界面的时候你需要先安装一下X Window 这个控制功能。

    yum groupinstall "X Window System"

如图,安装时出现下图,输入y

y代表yes:下载并安装
d代表download:只下载不安装
N代表no:不下载不安装

安装完成,出来complete

输入安装命令

    yum groupinstall -y "GNOME Desktop"

安装完成

输入

yum grouplist

输入下面代码可以看到,把multi-user.target改成graphical.target

systemctl get-default

输入命令

systemctl get-default graphical.target

然后再输入systemctl get-default进行查看

重启CentOS,检测,出现图形化界面ok解决

Guess you like

Origin blog.csdn.net/qq_61897141/article/details/129229578