Created
August 22, 2013 14:16
-
-
Save fuzzmz/6307756 to your computer and use it in GitHub Desktop.
Revisions
-
fuzzmz created this gist
Aug 22, 2013 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ #!/bin/bash EXPECTED_ARGS=2 if [ $# -ne $EXPECTED_ARGS ]; then echo "Usage: $0 VMNAME_or_UUID SNAPSHOTNAME" exit 1 fi set -x VBoxManage controlvm "$1" poweroff #enforce turnoff VBoxManage snapshot "$1" restore "$2" #restore snapshot VBoxManage showvminfo "$1" | grep State #display state to verify VBoxHeadless -s "$1" #run in headless mode in background