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.

53 lines
965 B

#!/usr/bin/env bash
set -eu
synopsis() {
cat << EOF
Usage : `basename $0` [-h]
EOF
}
help() {
cat << EOF
`basename $0` démarre VDN sous KVM.
`synopsis`
-h : affiche cette aide.
Remarque : vdn-kvm, en raison de la double virtualisation qu'il implique,
même correctement configuré (nested kvm), dégrade les performances,
notammentle démarrage, d'environ un facteur 5.
EOF
}
usage() {
synopsis
exit 1
}
args() {
local opt
while getopts "h" opt; do
case $opt in
h) help; exit 0;;
?) usage;;
esac
done
}
# Programme principal
VDN_PATH=$(readlink -f $(dirname $0)/..); . $VDN_PATH/bin/functions.sh
args "$@"
qemu-system-x86_64 -smp 8 -enable-kvm -cpu host -device virtio-rng-pci,rng=rng0 \
-object rng-random,filename=/dev/urandom,id=rng0 \
-pidfile $TMPDIR/vdn-DebianBuster-amd64-$USER-pid -rtc base=localtime -m 2G \
-boot order=c -drive file=$VDN_PATH/files/DebianBuster-amd64.disk,if=virtio,format=raw