VMware Communities
krische
Contributor
Contributor

Revert to snapshot on reboot

I've created a VM to run some automated software testing. It will be run on another machine with vmware Player. Basically, I want a way to reset the VM back to the state it was prior to running the test.

I've looked into both Independent/Nonpersistant disks and "rever to snapshot on power off." However, both of those require a power cycle to reset. I want to either be able to revert to the snapshot from inside the guest OS or somehow have revert on a reboot.

Does anyone have any ideas?

Thanks in advance.

Tags (2)
0 Kudos
1 Reply
krische
Contributor
Contributor

I figured it out.

On the host pc running the vmware player, I just created a simple shell script that uses a never ending loop to call vmplayer.

while [ 1 -eq 1 ]
do
     vmplayer "/path/to/vm.vmx"
done

So now all I have to do is just have the VM shutdown. It will poweroff, closing vmware player, thus restarting the loop and opening it back up to the now restored snapshot.

0 Kudos