Merge "labs: add option for VM gui type"

This commit is contained in:
Jenkins 2014-08-26 21:40:57 +00:00 committed by Gerrit Code Review
commit 638b898fba
2 changed files with 17 additions and 2 deletions

View File

@ -698,7 +698,11 @@ function vbox_boot {
local VM=$1
echo >&2 "Starting VM \"$VM\""
$VBM startvm "$VM"
if [ -n "${VM_UI:-}" ]; then
$VBM startvm "$VM" --type "$VM_UI"
else
$VBM startvm "$VM"
fi
}
#-------------------------------------------------------------------------------

View File

@ -56,11 +56,13 @@ function print_config {
${OSBASH:+:} echo "no"
echo "VM access method: $VM_ACCESS"
echo "GUI type: ${VM_UI:-gui}"
fi
}
while getopts :e:fhnw opt; do
while getopts :e:fg:hnw opt; do
case $opt in
e)
if [ "$OPTARG" = ova ]; then
@ -77,6 +79,15 @@ while getopts :e:fhnw opt; do
wbatch_reset
unset OSBASH
;;
g)
if [[ "$OPTARG" =~ (headless|gui|sdl) ]]; then
VM_UI=$OPTARG
else
echo "Error: -g argument must be gui (default), sdl, or" \
"headless"
exit
fi
;;
h)
usage
;;