在真机中准备rhel6.5 镜像
安装6.5 虚拟机
挂载6.5镜像:
[root@foundation76 ~]# mkdir /iso
[root@foundation76 ~]# mv /home/kiosk/rhel-server-6.5-x86_64-dvd.iso /iso/
[root@foundation76 ~]# mkdir /var/www/html/sources6.5
[root@foundation76 ~]# mount /iso/rhel-server-6.5-x86_64-dvd.iso /var/www/html/sources6.5/
[root@foundation76 ~]# vim /etc/rc.d/rc.local
virt-manager
选择本地镜像安装
重新初始化所有硬件设备:
选择时区:
设置密码:
1.配置hostname
vi /etc/sysconfig/network
2.配置ip
vi /etc/sysconfig/network-scripts/ifcfg-eth0
/etc/init.d/network restart #重启network服务
3.配置yum源
vi /etc/yum.repo.d/rhel....
4.安装
yum install -y vim lftp openssh-clients
5.配置hosts
vi /etc/hosts
6.关闭火墙
/etc/init.d/iptables stop
/etc/init.d/ip6tables stop
chkconfig iptables off
chkconfig ip6tables off
7.selinux设置为disabled
vi /etc/sysconfig/selinux
8.删除 70-persistent-net.rules
rm -rf /etc/udev/rules.d/70-persistent-net.rules
9.在真机中
yum provides */virt-sysprep
yum install ....
virt-sysprep -d base ##清除缓存
10.创建虚拟机快照
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
virt-manager
更改虚拟机hostname和ip