Sha256: 4978e8c2e56e132e6f8014456f06cada6b936c0f47a13c13cfb0178bd212f0e4

Contents?: true

Size: 927 Bytes

Versions: 3

Compression:

Stored size: 927 Bytes

Contents

#!/bin/bash
# Copied from thig gist:
# https://gist.github.com/1325354

VER=1.1

action="$1"
vm="$2"

vbcontrol() {
  VBoxManage controlvm ${vm} $@
}

oscontrol() {
  ssh ${vm} sudo $@
}


usage() {
  echo "$0 v$VER"
  echo "Usage: $(basename $0) [ACTION]"
  echo " Actions: up,down,create,hdds,info,list,modify,..."
}

case "$action" in
"up") VBoxHeadless --startvm ${vm} -v off & ;;
"down") vbcontrol poweroff ;;
"create") VBoxManage createvm --name ${vm} --ostype $3 --register; defaults;;
"hdds") VBoxManage list hdds ;;
"info") VBoxManage showvminfo ${vm} --machinereadable ;;
"list") VBoxManage list runningvms ;;
"modify") VBoxManage modifyvm ${vm} --$3 $4 ;;
"pause") vbcontrol pause ;;
"restart") oscontrol "shutdown -r now" ;;
"resume") vbcontrol resume ;;
"sendenter") vbcontrol "keyboardputscancode 1c" ;;
"shutdown") oscontrol "shutdown -h now" ;;
"suspend") vbcontrol savestate ;;
help) usage ;;
*) usage ;;
esac

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sakuric-2.1.3 bin/virtualbox-manage
sakuric-2.0.3 bin/virtualbox-manage
sakuric-2.0.1 bin/virtualbox-manage