Auto restoring virtualbox machine

Discussions about using Windows guests in VirtualBox.

Auto restoring virtualbox machine

Postby Zuni » 10. Aug 2019, 23:18

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

Re: Auto restoring virtualbox machine

Postby scottgus1 » 11. Aug 2019, 00:07

Take a look at the manual, section 8.17, the 'VBoxManage snapshot' command
Human government is like that crazy uncle who hides a quarter in his fist behind his back, then asks you to guess which fist the quarter is in...
No matter which side you choose, Left or Right, both Sides are empty.
scottgus1
 
Posts: 4262
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Win7

Re: Auto restoring virtualbox machine

Postby Zuni » 11. Aug 2019, 00:24

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

Re: Auto restoring virtualbox machine

Postby scottgus1 » 11. Aug 2019, 14:03

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   Expand viewCollapse view
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.
Human government is like that crazy uncle who hides a quarter in his fist behind his back, then asks you to guess which fist the quarter is in...
No matter which side you choose, Left or Right, both Sides are empty.
scottgus1
 
Posts: 4262
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Win7

Re: Auto restoring virtualbox machine

Postby Zuni » 11. Aug 2019, 14:09

Thank you mate,
will definitely work on it
Zuni
 
Posts: 3
Joined: 10. Aug 2019, 23:17


Return to Windows Guests

Who is online

Users browsing this forum: No registered users and 7 guests