Skip to content

Instantly share code, notes, and snippets.

@fuzzmz
Created August 22, 2013 14:16
Show Gist options
  • Select an option

  • Save fuzzmz/6307756 to your computer and use it in GitHub Desktop.

Select an option

Save fuzzmz/6307756 to your computer and use it in GitHub Desktop.

Revisions

  1. fuzzmz created this gist Aug 22, 2013.
    12 changes: 12 additions & 0 deletions vbox_start.sh
    Original 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