Skip to content

Instantly share code, notes, and snippets.

@goyalankit
Created February 11, 2014 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goyalankit/8930804 to your computer and use it in GitHub Desktop.
Save goyalankit/8930804 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
VBM=VBoxManage
VMID=8f8d7a7e-7aba-466f-a28f-3cf87100a58e
start(){
$VBM startvm $VMID --type headless
}
stop() {
$VBM controlvm $VMID poweroff
}
do_ssh(){
ssh -p 2022 user@localhost $1
}
case $1 in
start | up) start;;
pause | suspend) pause;;
stop | halt | down) stop;;
ssh) shift; do_ssh "$@";;
*) echo "Usage $0 {start|up|stop|halt|ssh}"; exit 1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment