#!/bin/bash

## TODO
## windows edition function with video driver NAME=win2008r2_fei_test
CPU=
MEM= ISO="/home/kvm/iso/win2k8.iso"
VIRTIO_ISO="/usr/share/virtio-win/virtio-wentao1.iso" DISK="/home/kvm/img/${NAME}.qcow2"
SIZE= DATA_DISK="/home/kvm/img/win2008r2_fei_test_data.qcow2"
DATA_SIZE= # --os-type=windows --os-variant=win2k12 \
# --os-type=windows --os-variant=win2k8r2 \
# --video qxl \
virt-install --connect qemu:///system \
--hvm --autostart \
--name "$NAME" \
--vcpus "$CPU" --ram "$MEM" \
--graphics vnc,password=disp1ayvm,listen=0.0.0.0 \
--network bridge=br0,model=virtio \
--input bus=usb,type=tablet \
--network bridge=br1,model=virtio \
--disk path="$ISO",device=cdrom \
--disk path="$VIRTIO_ISO",device=cdrom \
--disk path="${DISK}",size="${SIZE}",bus=virtio,format=qcow2 \
--disk path="${DATA_DISK}",size="${DATA_SIZE}",bus=virtio,format=qcow2

virtio.iso文件可以留言找我要取,也可以去官网进行下载。

05-11 20:36