[TOC] > 本文安装的是 centos7.8 #### 1. 下载 centos7 镜像文件 --- 阿里云centos镜像站:[https://mirrors.aliyun.com/centos](https://mirrors.aliyun.com/centos) 本文章使用的镜像:CentOS-7-x86_64-Minimal-2003.iso [https://mirrors.aliyun.com/centos/7.8.2003/isos/x86_64](https://mirrors.aliyun.com/centos/7.8.2003/isos/x86_64) #### 2. 使用 centos7 镜像文件创建虚拟机 ---- **第一步:典型模式** ![](https://img.itqaq.com/art/content/1ae50c9cd0f09549d99090e8ea1cd196.png) **第二步:稍后安装** ![](https://img.itqaq.com/art/content/2fc29cb963d728be0a538a5ef54c206f.png) **第三步:选择将要安装的操作系统类型** ![](https://img.itqaq.com/art/content/9b279d24d5c8ac9d48e86ef153533058.png) **第四步:设置虚拟机名称,虚拟机文件存放位置** ![](https://img.itqaq.com/art/content/d9659dfed66326caaa2975154d90ce18.png) **第五步:使用默认的就行** ![](https://img.itqaq.com/art/content/93115482379e64d3d7fb8a2dad6b5fa2.png) **第六步:点击 "完成"** ![](https://img.itqaq.com/art/content/c35cf72e192d4526bfb5b794fe5e297c.png) **第七步:编辑虚拟机设置,打印机一般用不到,可以移除,网络连接将默认的 NAT 模式改为桥接模式** ![](https://img.itqaq.com/art/content/3dde3a161da5d3aea32ec177e5397f91.png) ![](https://img.itqaq.com/art/content/bdac56bb8441092f7a893f0de64afe71.png) **第八步:选择镜像文件** ![](https://img.itqaq.com/art/content/fa5eb37b18bd02a8eda22e246a6047a3.png) #### 3. 安装centos7操作系统 --- **第一步:开启虚拟机** ![](https://img.itqaq.com/art/content/e4f996e133722573197541a2fe1c60a5.png) **第二步:选择界面语言,推荐使用默认的英文US,直接Continue进行下一步** ![](https://img.itqaq.com/art/content/288d41b008c2c8873f1290c860eea88e.png) **第三步:选择时区** ![](https://img.itqaq.com/art/content/895be9edcadcca4d04a9e7aecbabddd9.png) 选择上海的时区 ![](https://img.itqaq.com/art/content/40c7711dfb4bfe43d4005c70407bfa04.png) **第四步:选择分区** a. 进入分区设置 ![](https://img.itqaq.com/art/content/756ca24002dfcb500c319407ae20622c.png) b. 选择自定义分区 ![](https://img.itqaq.com/art/content/c229c2d393caea9ed7d0e0a0615fa4e1.png) c. LVM 切换为 标准分区,添加 `/boot` 分区 ![](https://img.itqaq.com/art/content/4003a5a43972709e825d4f2284f2a8e2.png) d. 添加交换分区 `swap`,一般为内存的两倍 ![](https://img.itqaq.com/art/content/61a31c0170e02e825d227df148abb47a.png) e. 添加根分区 `/` ![](https://img.itqaq.com/art/content/6f06cd0820d3311662a695f233b63a0b.png) f. 分区创建完成 ![](https://img.itqaq.com/art/content/289844e7a08a01461a6fbc6947a99191.png) g. 提示对分区进行格式化,点击同意格式化 ![](https://img.itqaq.com/art/content/10f8b230247be671403a412890e201af.png) **第五步:关闭 kdump内核崩溃转储机制** 进入设置 kdump 的界面 ![](https://img.itqaq.com/art/content/08077e92de482efce016e9d0a127ef4f.png) 取消勾选 ![](https://img.itqaq.com/art/content/1309d4dcd84abb87359692649c7b31b6.png) **第六步:网络和主机名** ![](https://img.itqaq.com/art/content/28f9af83d875034b884cd316a9b82db6.png) 开启网络 ![](https://img.itqaq.com/art/content/4d68f6f47ca4ee5c60c0ac6b377d6245.png) **第七步:配置完成,开始安装** 开始安装 ![](https://img.itqaq.com/art/content/26ac59b0223ad08d89fc6a6ef4a59b2b.png) 在安装的过程中设置超级管理员 root 的密码 ![](https://img.itqaq.com/art/content/d3ecea97b5547410f28c818b73fb7c93.png) **第八步:重启后即可使用** ![](https://img.itqaq.com/art/content/7c789dc043d5b5a6906b8b7fd0baed40.png) ![](https://img.itqaq.com/art/content/daceeaba89959ae1cd540f642fa9d7b1.png)