Linux安装6.5版本虚拟机

物理机准备6.5镜像

[[email protected] iso]# ls
rhel-server-6.5-x86_64-dvd.iso  rhel-server-7.2-x86_64-dvd.iso
[[email protected] iso]# vim /etc/rc.d/rc.local 
[[email protected] iso]# mkdir /var/www/html/rhel6.5
[[email protected] iso]# mount /iso/rhel-server-6.5-x86_64-dvd.iso /var/www/html/rhel6.5

/etc/rc.d/rc.local

Linux安装6.5版本虚拟机
打开本地虚拟机管理器进行安装

[[email protected] iso]# virt-manager

重新初始化所有硬件设备
Linux安装6.5版本虚拟机
Linux安装6.5版本虚拟机
安装完成后
进入虚拟机

1.修改主机名称
vi /etc/sysconfig/network       
	HOSTNAME=server1

Linux安装6.5版本虚拟机

2.添加本地解析
vi /etc/hosts      
	172.25.68.1 server1
	172.25.68.2 server2
	172.25.68.3 server3
	172.25.68.4 server4
	172.25.68.5 server5
	172.25.68.6 server6

Linux安装6.5版本虚拟机

3.配置网卡
vi /etc/sysconfig/network-scripts/ifcfg-eth0

Linux安装6.5版本虚拟机

重启ntwork服务

/etc/init.d/network restart    #重启network服务

Linux安装6.5版本虚拟机

4.配置yum源
vi /etc/yum.repos.d/rhel-source.repo

Linux安装6.5版本虚拟机
检测yum仓库是否配置完成
Linux安装6.5版本虚拟机

5.关闭selinux
vi /etc/sysconfig/selinux
将Enforcing 修改为Disabled

Linux安装6.5版本虚拟机

6.关闭火墙
/etc/init.d/iptables stop
/etc/init.d/ip6tables stop
chkconfig iptables off        ##火墙开机关闭
chkconfig ip6tables off

Linux安装6.5版本虚拟机

7.安装必要的软件
yum install vim openssh-clients lftp -y

Linux安装6.5版本虚拟机

8.删除 70-persistent-net.rules
rm -rf /etc/udev/rules.d/70-persistent-net.rules

Linux安装6.5版本虚拟机
虚拟机配置完成
在物理机中

1.清除缓存
yum whatprovides */virt-sysprep

 yum install 1:libguestfs-tools-c-1.28.1-1.55.el7.x86_64 -y

virt-sysprep -d base

Linux安装6.5版本虚拟机
Linux安装6.5版本虚拟机

2.生成快照
cd /var/lib/libvirt/images/
qemu-img create -f qcow2 -b base.qcow2 vm1 
qemu-img create -f qcow2 -b base.qcow2 vm2
qemu-img create -f qcow2 -b base.qcow2 vm3

Linux安装6.5版本虚拟机

3.生成虚拟机(更改虚拟机的主机名和ip)

Linux安装6.5版本虚拟机
Linux安装6.5版本虚拟机