Restore Virtualbox snapshot from backup

backup-restorationvirtualbox

I have a .SAV and .VHD file from a backup. Since these files were created the revert to snapshot feature was used, by design this deleted everything since the snapshot was created. However I now need to access the data that was in the snapshot.

Is there any way of using the .sav and associated vhd file to restore the virtual machine?

Best Answer

After much exploration I have found that this is possible!

NB I don’t have any experience with XML so please excuse the terminology......also please backup any configuration files before making any of the changes suggested..

I could not find any references to this in the VirtualBox documentation or on any websites. In case anyone ever has the same problem here are the steps I went through to resolve the problem:

  1. I Turned off the virtual machines and took a copy of the VirtualBox directory, which contains all of the virtual machine folders and configuration files.
  2. Created a new snapshot of the machine in question
  3. Compared the copy of the VirtualBox folder with the original after the snapshot was created to see what changes were made.

I was happy to see the changes were fairly simple. To restore the snapshot from the backup I:

  1. Opened the VirtualBox.xml file from the VirtualBox folder and found the node named
  2. Under the node I located the child node of the virtual machine I wanted to add the snapshot to - which you can tell by the name of the VHD file.
  3. As the temporary snapshot I added to compare the directories was no longer needed I found the folder where it was created and replaced it with the snapshot from the backups.
  4. I then amended the line which contained the information about the temporary snapshot by changing the uuid of the temporary snapshot with the uuid of the snapshot from backup as well as changing the name of the snapshot file. The section looked like:

Notice that the uuid is the same as the snapshot file name, if you need to find out what the uuid is just copy and paste the snapshot filename without the extension.

  1. That’s it for the VirtualBox.xml file, save it and close it. Now open the MachineName.xml file from within the virtual machines directory
  2. Scroll down to the section that looks similar to this:

  1. Replace the uuid of the temporary snapshot with the uuid of the snapshot from backups.
  2. Save the file and close it

That worked for me. The machine booted up fine with the snapshot restored from backup and all the data back!

Related Topic