<div id="Article">
<p>我们这里的CentOS是32位的(没有搞定64位<a href="https://www.2cto.com/os/xuniji/" target="_blank" class="keylink">虚拟机</a>设置),且是最小化安装!</p>
<p>首先,我们需要先安装 <a href="https://www.2cto.com/database/Oracle/" target="_blank" class="keylink">Oracle</a> VM VirtualBox,</p>
<center>
<img alt="\" height="388" src="/uploadfile/Collfiles/20171118/20171118090813154.png" width="499" />
</center>
<p>安装完毕后,我们可以手动修改虚拟机文件目录,(默认是C盘,不建议)</p>
<center>
<img alt="\" height="371" src="/uploadfile/Collfiles/20171118/20171118090813155.png" width="497" />
</center>
<p>接下来,我们就创建自己的虚拟机,名称为CentOS,对应的类型就是 Red Hat !CentOS 与 Red Hat的关系就不用多说了。</p>
<center>
<img alt="\" height="373" src="/uploadfile/Collfiles/20171118/20171118090814156.png" width="499" />
</center>
<p>继续下一步的操作,内存选择上面最少1G,这是CentOS中文图形化安装需求的。</p>
<center>
<img alt="\" height="377" src="/uploadfile/Collfiles/20171118/20171118090814157.png" width="505" />
</center>
<p>继续下一步,基本上都是默认选项,直接点击“下一步”,硬盘大小默认是8G, 我调整成了16G,个人需求而已!</p>
<center>
<img alt="\" height="380" src="/uploadfile/Collfiles/20171118/20171118090814158.png" width="509" />
</center>
<p>设置完虚拟机完成之后,我们还需要设置两个项目,一个是网络,一个是加载iso文件。</p>
<p>VirtualBox的提供了四种网络接入模式,我们只是用 “网络地址转换(NAT)” 和 “桥接网卡 ”!!</p>
<p>网络地址转换(NAT)是最简单的实现虚拟机上网的方式。</p>
<p>桥接网卡是通过主机网卡,使得虚拟机能被分配到一个网络中独立的IP,可以被访问。</p>
<center>
<img alt="\" height="384" src="/uploadfile/Collfiles/20171118/20171118090814159.png" width="514" />
</center>
<center>
<img alt="\" height="384" src="/uploadfile/Collfiles/20171118/20171118090814160.png" width="515" />
</center>
<p>有了上面的配置,我们的虚拟机就可以上网,并且可以通过分配的IP被宿主访问。</p>
<p>最后我们需要设置加载我们下载的 CentOS-6.9-i386-minimal.iso 文件</p>
<center>
<img alt="\" height="394" src="/uploadfile/Collfiles/20171118/20171118090814161.png" width="579" />
</center>
<center>
<img alt="\" height="394" src="/uploadfile/Collfiles/20171118/20171118090814162.png" width="528" />
</center>
<p>终于设置完毕,我们可以启动虚拟机了。</p>
<center>
<img alt="\" height="463" src="/uploadfile/Collfiles/20171118/20171118090815163.png" width="540" />
</center>
<p>跳过自检!SKIP !</p>
<center>
<img alt="\" height="353" src="/uploadfile/Collfiles/20171118/20171118090815164.png" width="540" />
</center>
<center>
<img alt="\" height="428" src="/uploadfile/Collfiles/20171118/20171118090815165.png" width="543" />
</center>
<p>点击 next 进行安装工作,选择简体中文,美式键盘,忽略硬盘数据,设置主机名,选择时区!</p>
<p>最后设置分区工作,我们这里使用 “创建自定义布局 ”,<a href="https://www.2cto.com/os/linux/" target="_blank" class="keylink">Linux</a>下硬盘分区和Windows下是不同的!</p>
<p>Linux下是目录在先,硬盘在后,即硬盘需要挂着在目录上面。</p>
<center>
<img alt="\" height="428" src="/uploadfile/Collfiles/20171118/20171118090815166.png" width="543" />
</center>
<p>我们先创建交换分区,即SWAP分区,一般默认是内存的2倍,这个东西不清楚的可以百度!</p>
<center>
<img alt="\" height="431" src="/uploadfile/Collfiles/20171118/20171118090815167.png" width="547" />
</center>
<center>
<img alt="\" height="436" src="/uploadfile/Collfiles/20171118/20171118090815168.png" width="552" />
</center>
<center>
<img alt="\" height="439" src="/uploadfile/Collfiles/20171118/20171118090815169.png" width="556" />
</center>
<p>最后我们创建主分区,将硬盘剩余空间全部挂着到根目录下“/”, 其实可以继续详细的分区方案,这里不讨论!</p>
<center>
<img alt="\" height="449" src="/uploadfile/Collfiles/20171118/20171118090815170.png" width="569" />
</center>
<p>分区格式为 Ext4, 这里选择项很多!</p>
<center>
<img alt="\" height="448" src="/uploadfile/Collfiles/20171118/20171118090816171.png" width="568" />
</center>
<p>分区方案已经完成,下一步格式化即可!图中使用的一些参数选项,都可以去百度,挺好理解的。</p>
<center>
<img alt="\" height="451" src="/uploadfile/Collfiles/20171118/20171118090816172.png" width="572" />
</center>
<center>
<img alt="\" height="454" src="/uploadfile/Collfiles/20171118/20171118090816173.png" width="575" />
</center>
<p>重新引导,即可登录CentOS<a href="https://www.2cto.com/os/" target="_blank" class="keylink">系统</a>了!</p>
<center>
<img alt="\" height="462" src="/uploadfile/Collfiles/20171118/20171118090816174.png" width="586" />
</center>
<p>至此,我们的CentOS虚拟机安装完毕,下一节我们介绍一些系统基本设置,以及安装LAMP环境!</p>
</div>