During my OSCP course times I've break system and took my time to recover. After I search Google, I couldn't find any good tool that automates this process so here is a simple tool that will help you to not lose your VirtualBox states and save your time.
This PowerShell script automates the creation of daily backups for a VirtualBox VM, removing older snapshots to conserve space, and ensuring that only snapshots with the name format "DailyBackup_" are deleted if they are older than 2 days.
- Windows operating system
- VirtualBox installed
- PowerShell
- Download or clone the repository to your Windows Desktop.
- Edit the
DailySnapshot.ps1
file:- Replace
$VMName
with your virtual machine's name. - Update
$VBoxManagePath
with the correct path toVBoxManage.exe
if it's different on your system.
- Replace
- Run the script:
.\DailySnapshot.ps1
- Open Task Scheduler.
- Import the
DailySnap.xml
file included in the repository:- Right-click on "Task Scheduler Library" and select "Import Task..."
- Browse to the location of the
DailySnap.xml
file and select it. - Click "Open" to import the task.