VirtualBox_Snapshots - UW-Libraries/druw GitHub Wiki
VirtualBox Snapshots
VBoxManage
VBoxManage
is the command-line command used for most VirtualBox management functions, including snapshots. It's documentation can be found at: https://www.virtualbox.org/manual/ch08.html
Finding a VM's Name
Most VBoxManage commands require you to specify which VM you want to manage, either by name or UUID. The best way I’ve found to figure out which VM is which is to halt all of your VMs, except for the one you want to manage, then execute: VBoxManage list runningvms
Your output will look something like:
12:57 $ VBoxManage list runningvms
"vagrant-ansible-druw_default_1485536207171_75158" {7ce8011e-c2b0-4bae-8396-6c8b50e630b8}
The string in quotes is the VM's name. The string in curly brackets is its UUID. For the following commands, the name and UUID can be used interchangably.
Additional options for VBoxManage list
can be found in the VBoxManage manual.
Taking a Snapshot
You can take a snapshot of a VM whether it's running or not. To take or restore a snapshot of a VM, use: VBoxManage snapshot
The syntax is: VBoxManage snapshot <uuid|vmname> take SnapshotName
e.g. VBoxManage snapshot "vagrant-ansible-druw_default_1485536207171_75158" take FirstSnap
will take a snapshot named FirstSnap of the VM named "vagrant-ansible-druw_default_1485536207171_75158".
Restoring a Snapshot
You can only restore a snapshot if the VM is halted. To restore a snapshot of a VM, use: VBoxManage snapshot
The syntax is: VBoxManage snapshot <uuid|vmname> restore SnapshotName
e.g. VBoxManage snapshot "vagrant-ansible-druw_default_1485536207171_75158" restore FirstSnap
will restore a snapshot named FirstSnap to the VM named "vagrant-ansible-druw_default_1485536207171_75158".
Listing Existing Snapshots
To list existing snapshots, use: VBoxManage snapshot list
Additional Snapshot options
Additional options for VBoxManage snapshot
can be found in the VBoxManage manual.