1.软硬件准备
软件:推荐使用 VMware,我用的是 VMware 12
镜像:CentOS6 ,如果没有镜像可以在阿里云下载 https://mirrors.aliyun.com/centos/
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/787948ee30777546fc4ad6d3521b3621.png)
硬件:因为是在宿主机上运行虚拟化软件安装centos,所以对宿主机的配置有一定的要求。最起码I5CPU双核、硬盘500G、内存4G以上。
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/730f820e8b6c41ccbc89f6fb81fd9510.png)
2.虚拟机准备
1.打开VMware选择新建虚拟机
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/f752a259068646f5c62f66f35216be26.png)
2.典型安装与自定义安装
典型安装:VMware会将主流的配置应用在虚拟机的操作系统上,对于新手来很友好。
自定义安装:自定义安装可以针对性的把一些资源加强,把不需要的资源移除。避免资源的浪费。
这里我选择自定义安装。
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/cdea960f3ad5cdd523466be382d755e6.png)
3.虚拟机兼容性选择
这里要注意兼容性,如果是VMware12创建的虚拟机复制到VM11、10或者更低的版本会出现一不兼容的现象。如果是用VMware10创建的虚拟机在VMware12中打开则不会出现兼容性问题。
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/10132ce916626c04486a7bb8a9c8c9fd.png)
4.选择稍后安装操作系统
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/1d60a81c87bef1fbd4a93d3e2e1c1618.png)
5.操作系统的选择
这里选择之后安装的操作系统,正确的选择会让vm tools更好的兼容。这里选择linux下的CentOS
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/dddffc348ed2d76ab619d22e013da551.png)
6.虚拟机位置与命名
虚拟机名称就是一个名字,在虚拟机多的时候方便自己找到。
VMware的默认位置是在C盘下,我这里改成F盘。
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/850dfdec7b361ac89b2892051d177389.png)
7.处理器与内存的分配
处理器分配要根据自己的实际需求来分配。在使用过程中CPU不够的话是可以再增加的。这次只做安装CentOS演示,所以处理器与核心都选1.
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/47bfeb22555c20b7d0ade98cfe56b4ac.png)
内存也是要根据实际的需求分配。我的宿主机内存是8G所以我给虚拟机分配2G内存。
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/1c4b0ce623ee01cee4ca96166beb4c1e.png)
8.网络连接类型的选择,网络连接类型一共有桥接、NAT、仅主机和不联网四种。
桥接:选择桥接模式的话虚拟机和宿主机在网络上就是平级的关系,相当于连接在同一交换机上。
NAT:NAT模式就是虚拟机要联网得先通过宿主机才能和外面进行通信。
仅主机:虚拟机与宿主机直接连起来
桥接与NAT模式访问互联网过程,如下图所示
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/f95f0038685e9b87298b7b9f5795b303.png)
桥接与NAT区别
这里选择桥接模式
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/e40a6b8a5d23840775900844e95f2cc0.png)
9.其余两项按虚拟机默认选项即可
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/e1c8ba210d806d2ff8da330d9a90a958.png)
10.磁盘容量
磁盘容量暂时分配100G即可后期可以随时增加,不要勾选立即分配所有磁盘,否则虚拟机会将100G直接分配给CentOS,会导致宿主机所剩硬盘容量减少。 勾选将虚拟磁盘拆分成多个文件,这样可以使虚拟机方便用储存设备拷贝复制。
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/a8a9864795dc436c5cc14e73f1a7f403.png)
11.磁盘名称,默认即可
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/eb9acb885e49b0a6e26291432c31144b.png)
12.取消不需要的硬件
点击自定义硬件
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/f328ab9284366de0b6f97ba44388760d.png)
选择声卡、打印机等不需要的硬件然后移除。
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/8bc9bc0ab13579c75d8f93bc563dc160.png)
13.点击完成,已经创建好虚拟机。
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/79b4daea4321c47098ffc515e4297380.png)
3.安装CentOS
1.连接光盘
右击刚创建的虚拟机,选择设置
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/8b277129dbdbc78bd532a86e07ae8a33.png)
先选择CD/DVD,再选择使用ISO映像文件,最后选择浏览找到下载好的镜像文件。启动时连接一定要勾选上后确定。
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/b66544d62ba914fb9d1dfa45c86644cc.png)
2.开启虚拟机
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/a02ddee6720a025a8423605c8f9380d0.png)
3.安装操作系统
开启虚拟机后会出现以下界面:
- Install CentOS 7 安装CentOS 7
- Test this media & install CentOS 7 测试安装文件并安装CentOS 7
- Troubleshooting 修复故障
选择第一项,安装直接CentOS 7,回车,进入下面的界面
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/0d24a93fd87e691e0998c747dd53a013.png)
选择安装过程中使用的语言,这里选择英文、键盘选择美式键盘。点击Continue
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/0462b59c4d7940d2d5e94fe35cf1f309.png)
首先设置时间
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/30750c2252dbe89047c9f659b69255c4.png)
时区选择上海,查看时间是否正确。然后点击Done
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/24503aa42021db219554d8deab0ac672.png)
选择需要安装的软件
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/1eb5591fb6936a2e5041a0f7e509e514.png)
选择 Server with Gui,然后点击Done
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/6406858860c6161120c62b8d72870d07.png)
选择安装位置,在这里可以进行磁盘划分。
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/06161cb6bd68ac3fcbff2bde8580b786.png)
选择i wil configure partitioning(我将会配置分区),然后点击done
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/86ae9b990253ec29738bf2387f8cdc0c.png)
如下图所示,点击加号,选择/boot,给boot分区分200M。最后点击Add
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/75e65bf71b654e587224fc2f9c82355b.png)
然后以同样的办法给其他三个区分配好空间后点击Done
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/f66d68d15cc04a1b401e3a86ba974dbc.png)
然后会弹出摘要信息,点击AcceptChanges(接受更改)
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/bb17cec3f94496bd099482398ccc615d.png)
设置主机名与网卡信息
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/34b20fbfd0bc827a229a5cb42b6ef8c3.png)
首先要打开网卡,然后查看是否能获取到IP地址(我这里是桥接),再更改主机名后点击Done。
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/5ec1002ac426708f816820893104dc97.png)
最后选择Begin Installation(开始安装)
![VMware 安装 Centos7 超详细过程](https://co.gd.cn/wp-content/themes/b2/Assets/fontend/images/default-img.jpg)
设置root密码
![VMware 安装 Centos7 超详细过程](https://co.gd.cn/wp-content/themes/b2/Assets/fontend/images/default-img.jpg)
设置root密码后点击Done
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/19308023cd1b97e0fa7cd0ee4af12792.png)
点击USER CREATION 创建管理员用户
![VMware 安装 Centos7 超详细过程](https://co.gd.cn/wp-content/themes/b2/Assets/fontend/images/default-img.jpg)
输入用户名密码后点击Done
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/4ff0506abeb747b64ace916e47dd42f4.png)
等待系统安装完毕重启系统即可
![VMware 安装 Centos7 超详细过程](https://freexyz.cn/d/file/20231006/e2f71559433848f7fc647498ff2292f7.png)