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

首先下载镜像到真机

rhel-server-6.5-x86_64-dvd.iso

配置好真机yum源

rhel6 -安装虚拟机


rhel6 -安装虚拟机

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

按照以下步骤进行


rhel6 -安装虚拟机


rhel6 -安装虚拟机rhel6 -安装虚拟机


rhel6 -安装虚拟机


rhel6 -安装虚拟机


rhel6 -安装虚拟机



rhel6 -安装虚拟机



rhel6 -安装虚拟机


rhel6 -安装虚拟机


rhel6 -安装虚拟机


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

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

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


rhel6 -安装虚拟机


rhel6 -安装虚拟机


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


rhel6 -安装虚拟机


rhel6 -安装虚拟机



rhel6 -安装虚拟机


3.yum源配置


rhel6 -安装虚拟机


rhel6 -安装虚拟机


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


rhel6 -安装虚拟机


rhel6 -安装虚拟机


4.火墙策略及selinux

iptables -F 刷掉火墙策略

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


rhel6 -安装虚拟机


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


rhel6 -安装虚拟机



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

在/etc/hosts中,添加解析

rhel6 -安装虚拟机


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

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

rhel6 -安装虚拟机


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


rhel6 -安装虚拟机


快速安装

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


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

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

rhel6 -安装虚拟机


rhel6 -安装虚拟机


有了快照,就方便多了

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


rhel6 -安装虚拟机


rhel6 -安装虚拟机


rhel6 -安装虚拟机


rhel6 -安装虚拟机



rhel6 -安装虚拟机


这样就ok啦!