Recover from snapshot

Discussions related to using VirtualBox on Linux hosts.
Post Reply
plux
Posts: 4
Joined: 12. May 2009, 18:42
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Recover from snapshot

Post by plux »

Hello everyone,
A harddrive of mine recently crashed and I wonder if I could recover my virtual machine from a snapshot?
The thing is that I have a snapshot of the machine saved, but the original .vdi is lost because it happened to be on the drive that crashed.
Is there anyway I can recover data or even possible use the snapshot as a virtual machine in vbox?
I should also note that i have my old .VirtualBox dir intact with the xml-files etc.
I've tried to mount the snapshot .vdi file using vdfuse, but all I got from it was:

Code: Select all

ERROR: opening vbox image failed
When I try to load the snapshot vdi as a harddrive in virtualbox it tells me this:

Code: Select all

ERROR: Parent hard disk with UUID {<UUID>} of the hard disk {<UUID2>} is not found virtualbox.
Do you guys have any idea if I could use my snapshot to recover files from the machine?

BTW, my host OS is Ubuntu 9.04 and the guest OS is Windows XP.

I really hope you can help me! :)
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Recover from snapshot

Post by Perryg »

The closest thing that I could find http://forums.virtualbox.org/viewtopic. ... 37&start=0

You can also try to recreate the original VM (new) and then put the (saved) snapshot in the new Snapshot folder then edit the .virtualbox.xml and the machine.xml files to use the snapshot and then save the state. It is a long and drawn out process but should be doable.
plux
Posts: 4
Joined: 12. May 2009, 18:42
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Recover from snapshot

Post by plux »

Hey,
I tried what you said. Basically I created a new machine and edited the xml files to use my old snapshot.
But the new machine can't use the old snap shot, when i try to add it to the drive I get this error:
Image

Any idea how to proceed?
I'll attach the .xml files.
Attachments
winxp2.xml
(9.52 KiB) Downloaded 13 times
VirtualBox.xml
(2.48 KiB) Downloaded 118 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Recover from snapshot

Post by Perryg »

That is the part where I told you that you would need to edit the virtualbox.xml file.

<HardDisk uuid="{c45d7d81-cebb-4161-8d28-4b16d399305d}" location="/media/disk/vbox/winxp2.vdi" format="VDI" type="Normal">
<HardDisk uuid="{854fd3e8-a57d-47e0-a540-2f4d84a2fd1c}" location="/home/plux/.VirtualBox/Machines/winxp2/Snapshots/{854fd3e8-a57d-47e0-a540-2f4d84a2fd1c}.vdi" format="VDI"/>

Replace the one in red above with the one in your screen shot

If everything is equal it should open. If not you will need to play with the settings.

You also may need to change the uuid for the main hard drive to match the snapshoot. I only did this once (so a little fuzzy) and then never failed to backup my files since. Way too much of a hassle.
plux
Posts: 4
Joined: 12. May 2009, 18:42
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Recover from snapshot

Post by plux »

Ok, now I get this error when trying to start the machine:
Image

Not sure where UUID {65871a9d-b638-4c48-82ba-ee55cc368f27} comes from, but my guess is that it's stored in the snapshot vdi?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Recover from snapshot

Post by Perryg »

There are 3 uuids that have to match. they are in virtualbox.xml, the actual machine.xml and the snapshot . Since the snapshot is not changeable you need to change the other two to match. Case is sensitive and everything must match perfectly. You just need to mess with it until you get everything as it needs to be.
plux
Posts: 4
Joined: 12. May 2009, 18:42
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP

Re: Recover from snapshot

Post by plux »

Thanks for having patience with me..
I figured out the problem probably is that the UUID {c45d7d81-cebb-4161-8d28-4b16d399305d} is stored in winxp2.vdi also, and I don't quite understand how to convince virtualbox it is actually the parent disk with UUID {65871a9d-b638-4c48-82ba-ee55cc368f27} stored in the snapshot vdi.
I'll attach my latest xml files aswell.
Attachments
VirtualBox.xml
(2.07 KiB) Downloaded 19 times
winxp2.xml
(9.48 KiB) Downloaded 11 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Recover from snapshot

Post by Perryg »

Man I don't know. I just had to do a lot of messing around with it. Using settings editing xml and using the CLI VBoxManage on it until I got it to work. As I said it was a pain and I will never let myself go there again. I back everything that is important up. Just keep on tying and hopefully it will work for you. If not I don't know what else to tell you, sorry.
Post Reply