yum install system-config-kickstart   -y
   system-config-kickstart   ##执行过程如下图

自动安装虚拟机_images

自动安装虚拟机_file_02

自动安装虚拟机_虚拟机_03

自动安装虚拟机_file_04

自动安装虚拟机_虚拟机_05


自动安装虚拟机_虚拟机_06

自动安装虚拟机_虚拟机_07

自动安装虚拟机_file_08

自动安装虚拟机_images_09

自动安装虚拟机_file_10

自动安装虚拟机_images_11

自动安装虚拟机_虚拟机_12

自动安装虚拟机_images_13

自动安装虚拟机_虚拟机_14


  生成一个ks.cfg文件保存在/root下
  vim /root/ks.cfg
 


   vim /mnt/vmcreate
#!/bin/bash
virt-install \
--name $* \
--ram 1000 \
--file /var/lib/libvirt/p_w_picpaths/$*.img  \
--file-size 8 \
--location http://172.25.254.85/rhel7.0  \            ##将7.0的镜像挂载到/var/www/html/rhel7.0
--extra-args http://172.25.254.85/ks.cfg           ##172.25.254.8 是本人真机的ip
--vnc

  chmod +x /mnt/vmcreate
  /mnt/vmcreate