-
-
Save eberfreitas/32aab76b9cd762efccab to your computer and use it in GitHub Desktop.
Easier VBoxManage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VBOXPATH="/cygdrive/c/Program Files/Oracle/VirtualBox/VBoxManage.exe" | |
case "$1" in | |
"start" | "startvm") | |
echo "Starting VM \"$2\"..." | |
cmd="\"$VBOXPATH\" startvm $2 --type headless" | |
eval $cmd | |
;; | |
"getip" | "get") | |
echo "Getting IP address for VM \"$2\"..." | |
cmd="\"$VBOXPATH\" guestproperty get $2 /VirtualBox/GuestInfo/Net/0/V4/IP" | |
eval $cmd | |
;; | |
"poweroff" | "shutdown") | |
echo "Shutting down VM \"$2\"..." | |
cmd="\"$VBOXPATH\" controlvm $2 poweroff" | |
eval $cmd | |
;; | |
*) | |
echo "Unknown command!" | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment