Deleting old snapshots

This is for discussing general topics about how to use VirtualBox.
Locked
KevinM1
Posts: 14
Joined: 22. Dec 2011, 21:22
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu

Deleting old snapshots

Post by KevinM1 »

Dumb question: I'd like to delete several old snapshots because, well, I don't need them any longer and they're simply wasting space on my laptop. Since all of my snapshots are sequential, am I in any danger of messing up my current VM state if I delete snapshots that the current state is derived from? In other words, given this sequence of snapshots as shown in my attached screenshot, would my current saved state be potentially messed up if I deleted the snapshots that were taken in January?
Attachments
Screenshot
Screenshot
vbox.jpg (74.31 KiB) Viewed 8839 times
Last edited by KevinM1 on 3. Dec 2018, 19:07, edited 1 time in total.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Deleting old snapshots

Post by socratis »

Please edit your message and attach the image here, locally. Also, if you're using a HiDPI setup, please shrink the image by at least 50%.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
KevinM1
Posts: 14
Joined: 22. Dec 2011, 21:22
Primary OS: MS Windows 10
VBox Version: OSE other
Guest OSses: Ubuntu

Re: Deleting old snapshots

Post by KevinM1 »

Done... please let me know if I need to resize it so it's a bit bigger. I didn't want it to be too big, but I may have shrunk it a bit too much.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Deleting old snapshots

Post by mpack »

I can still just about read it.
KevinM1 wrote:am I in any danger of messing up my current VM state if I delete snapshots ... ?
Quick answer, yes. All software is subject to bugs, plus a power cut at the wrong time could leave you with a permanently dead VM.

Best to make a backup of the VM folder before you start. I suggest that you get rid of all your snapshots, and in future rely purely on backups for the purpose of reverting to earlier VM states. The procedure is robust and it minimizes disk space used on the host. Sure it costs a little more time, so go get a coffee while the backup runs.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Deleting old snapshots

Post by socratis »

KevinM1 wrote: I didn't want it to be too big, but I may have shrunk it a bit too much.
Well, it could be, but let's not start splitting hair. As long as you're below the 128 KB limit, you're fine.

Yes, you can delete all the intermediate snapshots. I have never had an issue, but others have reported issues, so you might want to take a backup first.

Another option would be to Clone the current state to a new VM.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Axter
Posts: 1
Joined: 29. Mar 2024, 21:28

Re: Deleting old snapshots

Post by Axter »

I'm using VirtualBox version 7.0, I haven't had any problems deleting intermediate snapshots.

If you have to delete 5 or more snapshots, this can take a long time using the GUI. For my VM's it was taking between 10-12 minutes for each snapshot deletion, and because the GUI doesn't give users the option to delete multiple snapshots at the same time, you can easily waste an hour deleting 5 snapshots.

To delete multiple snapshots unattended, I used the below script.

Code: Select all

@echo off
:: Description: This script deletes multiple VirtualBox snapshots unattended
:: Rename the following two lines to the correct VM name and executable path.
set VM_NAME="Win10ProWrk64TorrentTest"
set VBoxManageCMD="C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"

for /F "tokens=* delims=" %%a in (SnapshotsList.txt) DO  (
    Echo Deletting snapshot %%a from VM %VM_NAME%
    %VBoxManageCMD% snapshot %VM_NAME% delete %%a
    Echo *********************************************
)
This script uses a text file named SnapshotsList.txt which list the names of the snapshots to be deleted.
Example:

Code: Select all

"qBitTorrent Installed"
"Increased Resolution"
"Updated VM software"
"Installed DiskGenius"
"qTorrent option changes"
"Before removing DiskGenius"
The SnapshotsList.txt file can easily be created using the following command line:

Code: Select all

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" snapshot "MyVmNameHere" list --machinereadable >SnapshotsList.txt
Just edit the file to only include the SnapshotName's that are to be deleted.

If you try this, remember to use double quotes for the snapshot names and for the VM name.
Locked