1.1 准备工作
虚拟机:VMware Workstation 12 Pro
CentOS版本:CentOS-6.10-x86_64-bin-DVD1.iso
获取CentOS路径
1.2 创建虚拟机
1.2.1 新建虚拟机
![image.png](https://upload-images.jianshu.io/upload_images/12968546-587de61c1223a9f9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1.2.2 选择类型
![image.png](https://upload-images.jianshu.io/upload_images/12968546-fadcf7f662d687cd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1.2.3 选择稍后安装操作系统
![image.png](https://upload-images.jianshu.io/upload_images/12968546-d08123ac4a48bfcb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1.2.4 选择Centos 64位
![image.png](https://upload-images.jianshu.io/upload_images/12968546-0d47dd3276de980a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1.2.5 输入虚拟机名称和安装位置
![image.png](https://upload-images.jianshu.io/upload_images/12968546-fd8415c7e9eadb5d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1.2.6 选择磁盘大小,这里我选择200G,也可保持默认;建议将虚拟磁盘存储为单个文件;
![image.png](https://upload-images.jianshu.io/upload_images/12968546-40941ea2003919d3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1.2.7 自定义硬件
![image.png](https://upload-images.jianshu.io/upload_images/12968546-d9345581f9c35787.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
cpu数量根据自己电脑配置设置,我这里将cpu数量设置为2,如下图所示:
![image.png](https://upload-images.jianshu.io/upload_images/12968546-38567066b165cd70.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
内存至少给足1G,保证可以正常安装
点击移除打印机
![image.png](https://upload-images.jianshu.io/upload_images/12968546-76ecb14e281adb63.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
插入iso镜像——单击CD/DVD,选择使用ISO镜像文件,点击浏览,找到iso镜像,点击确定
![image.png](https://upload-images.jianshu.io/upload_images/12968546-25b3e41a636710e3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
点击右下角的关闭,再点击完成,虚拟机创建成功
1.3 安装
开机,选择“Install or upgrade an existing system”(安装或升级现存的系统)
![image.png](https://upload-images.jianshu.io/upload_images/12968546-937a42edcaab4b0a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
是否检测光盘完整性,选择“skip”
![image.png](https://upload-images.jianshu.io/upload_images/12968546-df4e7d57ea50808d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
语言,保持默认即可
![image.png](https://upload-images.jianshu.io/upload_images/12968546-65dda67a969cec8b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
键盘布局,同样保持默认
![image.png](https://upload-images.jianshu.io/upload_images/12968546-be292c34d012c6e2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
安装位置,选择基本存储设备
![image.png](https://upload-images.jianshu.io/upload_images/12968546-d7c55a60f545cabf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
选择清除磁盘上的所有数据
![image.png](https://upload-images.jianshu.io/upload_images/12968546-0c7848822b8b998d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
自定义主机名
![image.png](https://upload-images.jianshu.io/upload_images/12968546-13151ad1223ad42e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
点击左下角,配置网络
![image.png](https://upload-images.jianshu.io/upload_images/12968546-37863729c06edc29.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
勾选“connect automatically”,即打开自动连接(默认网卡不启用), 然后点击Apply,点击close
![image.png](https://upload-images.jianshu.io/upload_images/12968546-b80238839eeedd0e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
点击“next”下一步
![image.png](https://upload-images.jianshu.io/upload_images/12968546-ca7aa63fe88cdd7c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
配置时区,在地图上找到上海,并取消勾选“System clock uses UTC”
![image.png](https://upload-images.jianshu.io/upload_images/12968546-347dae50950e6784.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
设置root密码
![image.png](https://upload-images.jianshu.io/upload_images/12968546-0c02c29aefb16b8b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
选择“Use Anyway”,即无论如何都使用
![image.png](https://upload-images.jianshu.io/upload_images/12968546-ed2fb977a7047790.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
安装方式,选择“Create Custom Layout”自定义布局
![image.png](https://upload-images.jianshu.io/upload_images/12968546-85cba7c0642c8631.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
点击“Free”,再点击“Create”创建分区
![image.png](https://upload-images.jianshu.io/upload_images/12968546-798b5a41daaa10c1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
分区建议如下:
总空间:200G
/dev/sda1——mount /boot—— 1G /dev/sda2——mount /————50G /dev/sda3——mount /app(实验安装软件使用)————20G /dev/sda4——划分为swap交换分区————2G
选择“Standard Partition”,创建标准分区
![image.png](https://upload-images.jianshu.io/upload_images/12968546-cea7b44649e97e93.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![image.png](https://upload-images.jianshu.io/upload_images/12968546-feeb72fe362048ce.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![image.png](https://upload-images.jianshu.io/upload_images/12968546-071218fcbb03a492.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![image.png](https://upload-images.jianshu.io/upload_images/12968546-76b5fe83c9caeb2d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![image.png](https://upload-images.jianshu.io/upload_images/12968546-11edaea3445d93cb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
效果如图所示
![image.png](https://upload-images.jianshu.io/upload_images/12968546-5c06af2dd3bfd1ec.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
点击“Format”格式化
![image.png](https://upload-images.jianshu.io/upload_images/12968546-c4548c8d8f385e7b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
点击“Write change to disk”,开始分区
![image.png](https://upload-images.jianshu.io/upload_images/12968546-1917b4bc130b4dfe.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
保持默认,点击“next”
![image.png](https://upload-images.jianshu.io/upload_images/12968546-4e597074f017eb18.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
选择服务器角色,选择“Desktop”,然后点击“Customize now”定制
![image.png](https://upload-images.jianshu.io/upload_images/12968546-8f4bb0053a319827.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
根据需要安装软件包,然后点击“next”
![image.png](https://upload-images.jianshu.io/upload_images/12968546-1f06943aa9071344.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
然后进入安装界面,开始安装
![image.png](https://upload-images.jianshu.io/upload_images/12968546-a57e9b54e65dc46c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
安装完成后,点击“reboot”
![image.png](https://upload-images.jianshu.io/upload_images/12968546-872a030a3782eadb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
点击“Forward”,开始设置
![image.png](https://upload-images.jianshu.io/upload_images/12968546-205ae4f1dc2cfc3e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
选择同意许可
![image.png](https://upload-images.jianshu.io/upload_images/12968546-e2e2fcd45d55f9b7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
选择是否创建普通用户
设置时间,保持默认即可
![image.png](https://upload-images.jianshu.io/upload_images/12968546-b6efc211d9fd20fd.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
是否开启kdump,选择“No”,点击“finish”完成设置
![image.png](https://upload-images.jianshu.io/upload_images/12968546-0a7890523629a506.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
好了,终于安装完成了。
建议:关机创建一个初始快照,便于后期恢复。