#!/usr/bin/env bash # # Provides a very simple "sane" default for quickly virtualizing a system using # kvm and qemu. Intended for use to run quick "burn-down" systems for testing # (eg: build from live-cd or prebuilt hda using configuration management) # # Requirements: # qemu # libvirt if [[ -z ${1} ]]; then echo -e " Please specify at least a system drive to boot (-hda ), or a live iso file to serve as the bootable virtual cdrom device (-cdrom .iso).\n Note that other qemu settings can be passed as well to further customize.\n" exit 1 fi # Make sure qemu is installed if [[ ! $(which qemu-system-x86_64 2>/dev/null) ]]; then echo -e " Qemu does not appear to be installed. If it is, be sure the path to its binary is in the environment PATH variable.\n" echo "Current PATH variable value is:" echo ${PATH} echo exit 1 fi # Execute qemu-system-x86_64 -enable-kvm -machine accel=kvm -vga std -m 2048 ${@}