##############rhel6.5虚拟机安装################

首先下载镜像到真机

rhel-server-6.5-x86_64-dvd.iso

配置好真机yum源

Screenshot from 2018-01-27 21-13-35.png


Screenshot from 2018-01-27 21-13-19.png

下来就可以安装虚拟机了!

按照以下步骤进行


Screenshot from 2018-01-27 21-20-26.png


Screenshot from 2018-01-27 21-23-37.pngScreenshot from 2018-01-27 21-23-47.png


Screenshot from 2018-01-27 21-24-03.png


Screenshot from 2018-01-27 21-26-25.png


Screenshot from 2018-01-27 21-26-32.png



Screenshot from 2018-01-27 21-26-40.png



Screenshot from 2018-01-27 21-26-47.png


Screenshot from 2018-01-20 20-10-31.png


Screenshot from 2018-01-20 20-13-30.png


这样我们的虚拟机就装好啦!

下来对虚拟机进行相关操作,使的以后的安装更加方便。

1.在/etc/udev/rules.d目录下,删除如下


Screenshot from 2018-01-27 21-34-41.png


Screenshot from 2018-01-27 21-35-07.png


2.网络配置,给它一个IP


Screenshot from 2018-01-27 21-37-33.png


Screenshot from 2018-01-27 21-37-55.png



Screenshot from 2018-01-27 21-39-50.png


3.yum源配置


Screenshot from 2018-01-27 21-41-24.png


Screenshot from 2018-01-27 21-41-50.png


配置好后,可以如下安装啦!


Screenshot from 2018-01-27 21-42-49.png


Screenshot from 2018-01-27 21-47-48.png


4.火墙策略及selinux

iptables -F 刷掉火墙策略

关闭防火墙,设置开机不启动。


Screenshot from 2018-01-27 21-51-41.png


在/etc/sysconfig/selinux中,设置selinux为disabled


Screenshot from 2018-01-27 21-54-54.png



5.做解析及永久更改主机名

在/etc/hosts中,添加解析

Screenshot from 2018-01-27 21-56-41.png


在/etc/sysconfig/network中更改主机名

将localhost.localdomain换成你想要的主机名

Screenshot from 2018-01-27 21-58-37.png


最后也可在做一些清理,使你的虚拟机更加干净


Screenshot from 2018-01-27 22-01-30.png


快速安装

为了以后快速安装虚拟机,我们可以通过快照实现,如下


在/var/lib/libvirt/images中得到rhel6.5-base.qcow2

qemu-img create -f qcow2 -b rhel6.5-base.qcow2 server$  通过该命令做快照

Screenshot from 2018-01-21 20-53-06.png


Screenshot from 2018-01-21 20-54-46.png


有了快照,就方便多了

下来,我们就来快速装一个虚拟机


Screenshot from 2018-01-21 20-55-39.png


Screenshot from 2018-01-21 20-55-57.png


Screenshot from 2018-01-21 20-57-24.png


Screenshot from 2018-01-21 20-57-42.png



Screenshot from 2018-01-21 20-57-53.png


这样就ok啦!