CentOS 8 安装

CentOS 8 虚拟机创建与配置

VMWare创建CentOS虚拟机

首先创建虚拟机,这里选择Workstation 16.x,也可以选择更低版本15或12。高版本的Workstation可能不适配低版本的Workstation,可以选择低版本兼容其他版本的VMWare。

image-20250728164252884

选择稍后安装操作系统

image-20250728165320491

选择CentOS 8 64位

image-20250728165700085

自己填写路径与虚拟机名称(尽量别放在C盘)

image-20250728170123338

一个处理加上两个内核对于虚拟机来说够用了

image-20250728170533191

内存设置2G也行,这里设置4G

image-20250728170752032

选择NAT模式(可以联网)

image-20250728172125658

下面两个选择推荐即可

image-20250728172156548

创建新虚拟磁盘

image-20250728172214319

这里将虚拟磁盘存储为单个文件方便移动,分配了40G磁盘大小应对后续实验

image-20250728172241447

本次实验需要两块网卡,这里再添加一个网络适配器

image-20250728172435983

点击完成,最后在虚拟机设置界面选择CentOS的ISO映像即可

image-20250728172545813

至此CentOS 8虚拟机的基础创建完成

CentOS 8初始化配置设置

先打开刚刚创建的虚拟机,选择第一个Install CentOS Linux 8

image-20250728173526552

选择简体中文

image-20250728190918732

接下来对这四个选项进行操作,选择上海时区

image-20250728192119186

安装环境额外软件[传统UNIX兼容性]和[开发工具]

image-20250728191000485

选择本地标准磁盘

image-20250728191156405

启动网卡

image-20250728192101205

然后点击开始安装

image-20250728191249923

自己创建root密码和用户

image-20250728191451680

然后静等安装完成

CentOS 8系统基础配置

防火墙配置

首先查看防火墙状态

systemctl status firewalld.service

image-20250728193328430

先临时关闭防火墙

systemctl stop firewalld.service

image-20250728193435626

关闭防火墙后设置防火墙永久关闭

systemctl disable firewalld.service

image-20250728193548041

设置SELinux

vim /etc/selinux/config

image-20250728194024752

设置SELINUX=enforcing为=>SELINUX=permissive,将规则由严格改为标准

关闭虚拟网卡

systemctl disable libvirtd.service		#关闭虚拟网卡
systemctl status libvirtd.service #查看网卡状态

image-20250728194509654

换源

修改镜像源,将mirrorlist那一段代码使用#注释,取消baseurl代码的注释,将后面的网址粘贴为https://mirrors.aliyun.com/centos-vault/8.5.2111/extras/$basearch/os/

vim /etc/yum.repos.d/CentOS-Base.repo 
vim /etc/yum.repos.d/CentOS-AppStream.repo
vim /etc/yum.repos.d/CentOS-Extras.repo

image-20250728194833703

修改完成后保存退出,输入

systemctl poweroff		#关闭计算机

在关机状态下为虚拟机拍摄快照

Author: wickt42
Link: http://example.com/2025/07/28/CentOS 8 安装/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.