Page 1 of 1

Auto restoring virtualbox machine

Posted: 10. Aug 2019, 23:18
by Zuni
Hi Guys,

How can i go about restoring Vitualbox to a certain state lets say at a frequency of 3hrs.

What i am trying to do :

I am currently running training using Virtualbox and every morning i have to restore snapshots manually and would like to automate this process ?

please help

Re: Auto restoring virtualbox machine

Posted: 11. Aug 2019, 00:07
by scottgus1
Take a look at the manual, section 8.17, the 'VBoxManage snapshot' command

Re: Auto restoring virtualbox machine

Posted: 11. Aug 2019, 00:24
by Zuni
Hi Scot,

In the manual i do not see anything on a timed restore ? but i am thinking a script that runs the command @ interval should work.
Thank you let me try that

Re: Auto restoring virtualbox machine

Posted: 11. Aug 2019, 14:03
by scottgus1
Yes, Virtualbox does not have a function to time a vboxmanage command, but you can use Windows Task Scheduler or a cron job (? I'm not a Linux guy) to run a batch file with the vboxmanage command in it.

If you have a Windows host, and you wish to have the batch file window not show in the screen while it is running, you can point your Task Scheduler task at this vbscript file (save as a text file with .vbs extension):

Code: Select all

set shell = WScript.CreateObject("WScript.Shell")
shell.Run "driveletter:\path\to\batchfile.cmd",7 ' 7: minimized; 0: hidden
The 7 makes the batch file window minimized to the taskbar, 0 hides the window completely, no icon in the taskbar.

Re: Auto restoring virtualbox machine

Posted: 11. Aug 2019, 14:09
by Zuni
Thank you mate,
will definitely work on it