blob: dbeda751db2ef13eedbe9f757a1654237fcd3ba5 (
plain)
1 #!/usr/bin/env bash
2 #
3 # Provides a very simple "sane" default for quickly virtualizing a system using
4 # kvm and qemu. Intended for use to run quick "burn-down" systems for testing
5 # (eg: build from live-cd or prebuilt hda using configuration management)
6 #
7 # Requirements:
8 # qemu
9 # libvirt
10
11 if [[ -z ${1} ]]; then
12 echo -e "
13 Please specify at least a system drive to boot (-hda <path>), or a live iso
14 file to serve as the bootable virtual cdrom device (-cdrom <path>.iso).\n
15 Note that other qemu settings can be passed as well to further customize.\n"
16 exit 1
17 fi
18
19 # Make sure qemu is installed
20 if [[ ! $(which qemu-system-x86_64 2>/dev/null) ]]; then
21 echo -e "
22 Qemu does not appear to be installed. If it is, be sure the path to its
23 binary is in the environment PATH variable.\n"
24 echo "Current PATH variable value is:"
25 echo ${PATH}
26 echo
27 exit 1
28 fi
29
30 # Execute
31 qemu-system-x86_64 -enable-kvm -machine accel=kvm -vga std -m 2048 ${@}
|