Deletion of .sav files and Snapshot .vdi files

Discussions related to using VirtualBox on Windows hosts.
Post Reply
MacNala
Posts: 176
Joined: 12. Oct 2008, 00:20
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7, 10, 11 & Ubuntu 20.04 & 22.04
Location: UK
Contact:

Deletion of .sav files and Snapshot .vdi files

Post by MacNala »

I am in the processing of minimizing the size of backups of one of my Windows Hosts which supports 5 different Guests.
I have come across a large number of files with the .sav extension.

Can these be deleted?
VBox: 6.1.16
Host: Windows 10 Win 20H2 32GB RAM 3.4 GHz CPU 6 Cores.
Guests: Windows 10 Win 20H2 6GB RAM x 2
Linux Ubuntu server 1804 6GB RAM
Linux Ubuntu Server 2004 6GB RAM

The same question concerning the deletion of Snapshot files of the Guest machines where no snapshots are still in use. That is, all snapshots have been deleted from the machines.
I tried looking in the manual for 6.1.16 but cannot see anything relevant, if there is something there point me to the section of the manual.
multiOS
Volunteer
Posts: 1227
Joined: 14. Sep 2019, 16:51
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux, BSD
Location: United Kingdom

Re: Deletion of .sav files and Snapshot .vdi files

Post by multiOS »

Deleting Snapshots is covered in Para. 1.10.1 (Section 3 on page 18)

The .sav files are from when you choose 'Save the Machine State'. If they are still present after closing down the VM fully using Virtual Operating System's own shut down/power off procedure, not Power Off in VirtualBox's own pop-up menu which is the equivalent of' simply 'killing' the PC by turning of the power, you should be able to right-click on the VM in the VirtualBox Manager and choose "Discard Saved State..." Para 1.8.6

Hope that helps.
MacNala
Posts: 176
Joined: 12. Oct 2008, 00:20
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7, 10, 11 & Ubuntu 20.04 & 22.04
Location: UK
Contact:

Re: Deletion of .sav files and Snapshot .vdi files

Post by MacNala »

Those pointers were very valuable and enabled me to delete a lot of unnecessary files from the backups.
Can I ask another question. What are the purposes of the .vbox and .vbox-prev files?
There are a lot of them and could they also be deleted
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Deletion of .sav files and Snapshot .vdi files

Post by scottgus1 »

The .vbox file is the guest's 'recipe'. For all intents and purposes it is the guest's motherboard and hardware.

Virtualbox re-writes the .vbox files every so often as needed, and the existing .vbox file gets renamed to .vbox-prev, so that if a glitch happens while writing the new .vbox (which does happen), the original .vbox can be recovered by renaming the .vbox-prev back to .vbox.

Occasionally there will be a vmname-#.##-Hosttype.vbox, like 'vmname-1.12-windows.vbox'. These are backups of the .vbox file when Virtualbox needs to upgrade the XML version it uses in the .vbox file. I don't know if these are ever needed again after the new .vbox file runs the guest correctly, or if a major downgrade of Virtualbox might make the guest not run anymore if these files were deleted. They take only a couple kB, and I wouldn't delete them myself.

To add to multiOS's info on .sav and snapshot files, .sav's are also used if one takes a snapshot of a running VM. Restoring that snapshot would recover the VM to a running state, so the snapshot needs the .sav.

It is usually not a good idea to delete anything from a guest folder until at least a complete confirmed backup of the guest folder and all other disk files outside the guest folder is made.

One way to see if a particular snapshot or .sav file is orphaned, is to study the disk parent and child UUID stack in the guest's drives in Virtual Media Manager. Also test each snapshot or .sav disk file's UUID in the file's name against the contents of the .vbox file. If the UUID shows up in the Virtual Media Manager or the .vbox file, it's needed, don't delete it.
MacNala
Posts: 176
Joined: 12. Oct 2008, 00:20
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 7, 10, 11 & Ubuntu 20.04 & 22.04
Location: UK
Contact:

Re: Deletion of .sav files and Snapshot .vdi files

Post by MacNala »

Also very useful info.
I have checked that the VM had no media associated with it and deleted all but the latest .vbox, .vbox-prev and checked that the VM was still operational which it was so assumed that all was well. The deletion of the redundant files gave me the space back that was being backed up and saved a good few hours, days rebuilding.
Post Reply