#! /bin/sh if [ -z "$1" ]; then echo "Usage: $0 vm_name [poweroff]" >&2 exit 1 fi VM_NAME="$1" exec VBoxManage controlvm "$VM_NAME" ${2:-acpipowerbutton}