Auto restoring virtualbox machine

Discussions about using Windows guests in VirtualBox.
Post Reply
Zuni
Posts: 3
Joined: 10. Aug 2019, 23:17

Auto restoring virtualbox machine

Post 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
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Auto restoring virtualbox machine

Post by scottgus1 »

Take a look at the manual, section 8.17, the 'VBoxManage snapshot' command
Zuni
Posts: 3
Joined: 10. Aug 2019, 23:17

Re: Auto restoring virtualbox machine

Post 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
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Auto restoring virtualbox machine

Post 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.
Zuni
Posts: 3
Joined: 10. Aug 2019, 23:17

Re: Auto restoring virtualbox machine

Post by Zuni »

Thank you mate,
will definitely work on it
Post Reply