qemu.sh (461B)
1 #!/bin/sh 2 3 PORTSDIR="$(dirname $(dirname $(realpath $0)))" 4 SCRIPTDIR="$(dirname $(realpath $0))" 5 6 [ -f /tmp/qemu-vm.img ] || { 7 qemu-img create -f qcow2 /tmp/qemu-vm.img 50G 8 } 9 10 qemu-system-x86_64 -enable-kvm \ 11 -cpu host \ 12 -drive file=/tmp/qemu-vm.img,if=virtio \ 13 -device virtio-rng-pci \ 14 -m 2G \ 15 -smp 4 \ 16 -monitor stdio \ 17 -name "QEMU" \ 18 -boot d \ 19 -cdrom $@ 20 21 rm -f /tmp/qemu-vm.img 22 23 exit 0