QEMU/KVM Startup Script

Right now I’m running this with root privileges for the bridged network adapter.  I really need to find a better, cleaner way to do this…

#!/bin/sh
export QEMU_AUDIO_DRV=alsa
DISKIMG=/export/vm/win7old.qcow2
APPIMG=~/vm/apps.qcow2
VIRTIMG=/export/vm/virtio-win-0.1-81.iso
#CZ=~/vm/clonezilla-live.iso
CZ=~/vm/win7-64.iso
qemu-system-x86_64 –enable-kvm -drive file=${DISKIMG},if=virtio -m 8192 \
-device virtio-net,netdev=tunnel -netdev tap,id=tunnel,ifname=vnet0 \
-drive file=${VIRTIMG},index=3,media=cdrom \
-cdrom ${CZ} \
-rtc base=localtime,clock=host -smp cores=8 \
-drive file=${APPIMG},if=virtio \
-no-quit -no-frame \
-usbdevice tablet -soundhw all -cpu host -vga vmware
#-usb -device usb-host,hostbus=1,hostaddr=6
# Last part was working for USB pass through — disabled for now, slow?

Comments are closed.