Automatically create snapshot before launching VirtualBox VM?

2

1

Does anyone have a script or know how to write one to automatically take a snapshot of a VM before launching it for use?

pthesis

Posted 2011-06-16T00:54:12.497

Reputation: 428

Answers

1

If your running windows placing this text into a .bat file should do the trick:

cd "C:\Program Files\Oracle\VirtualBox
VBoxManage snapshot "Virtual Name" take "Snapshot Name"
VBoxManage startvm "Virtual Name"

If your running a *NIX you will have to change this to something like

VBoxManage snapshot "Virtual Name" take "Snapshot Name"
VBoxManage startvm "Virtual Name"

As you wont need to change your directory to access the VBoxManage command and save it to a .sh file, change the attribute to executable and then invoke it to run it.

CenterOrbit

Posted 2011-06-16T00:54:12.497

Reputation: 1 759