You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
564 B

#!/bin/bash
# Check which virtualization technology to use
# We prefer kvm, kqemu, userspace in that order.
[[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS=""
$(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS="-kernel-kqemu "
[[ -b /dev/kvm && -x /usr/bin/kvm ]] && BIN=/usr/bin/kvm && ARGS=""
[[ -b /dev/kvm && -x /usr/bin/qemu-kvm ]] && BIN=/usr/bin/qemu-kvm && ARGS=""
[[ $BIN ]] || {
echo "Could not find a working KVM or QEMU to test with!" >&2
echo "Please install kvm or qemu." >&2
exit 1
}
echo "Running $BIN $ARGS"
$BIN $ARGS "$@"