diff --git a/labs/lib/osbash/virtualbox.functions b/labs/lib/osbash/virtualbox.functions index d27967c9..3b2714be 100644 --- a/labs/lib/osbash/virtualbox.functions +++ b/labs/lib/osbash/virtualbox.functions @@ -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 } #------------------------------------------------------------------------------- diff --git a/labs/osbash.sh b/labs/osbash.sh index 9420a539..3f9144e1 100755 --- a/labs/osbash.sh +++ b/labs/osbash.sh @@ -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 ;;