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
打开本地虚拟机管理器进行安装
[[email protected] iso]# virt-manager
重新初始化所有硬件设备
安装完成后
进入虚拟机
1.修改主机名称
vi /etc/sysconfig/network
HOSTNAME=server1
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
3.配置网卡
vi /etc/sysconfig/network-scripts/ifcfg-eth0
重启ntwork服务
/etc/init.d/network restart #重启network服务
4.配置yum源
vi /etc/yum.repos.d/rhel-source.repo
检测yum仓库是否配置完成
5.关闭selinux
vi /etc/sysconfig/selinux
将Enforcing 修改为Disabled
6.关闭火墙
/etc/init.d/iptables stop
/etc/init.d/ip6tables stop
chkconfig iptables off ##火墙开机关闭
chkconfig ip6tables off
7.安装必要的软件
yum install vim openssh-clients lftp -y
8.删除 70-persistent-net.rules
rm -rf /etc/udev/rules.d/70-persistent-net.rules
虚拟机配置完成
在物理机中
1.清除缓存
yum whatprovides */virt-sysprep
yum install 1:libguestfs-tools-c-1.28.1-1.55.el7.x86_64 -y
virt-sysprep -d base
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