Page 1 of 1

Snapshot caused my VM to not load

Posted: 30. Aug 2013, 01:34
by SamT
Greetings, I have used VirtualBox casually for the past year but have not delved into it much. It provides excellent virtual machines and control for the various environments I must run as a DBA and software developer.

Last night I got a little nervous and decided to take a snapshot of my main vm, a Windows XP machine I use to maintain an older software environment. I then intended to export it as well. There were no previous snapshots, and I intended to export the entire virtual machine as well - as another form of backup. I am running version 4.10 of VirtualBox on a Windows 7 Pro 64-bit laptop and the virtual machine was powered down cleanly before attempting this.

However, once I created the snapshot and tried to perform the export, I received the message "Parent UUID {00000000-0000-0000-0000-000000000000} of the medium 'C:\Users\Sam.Trexler\VirtualBox VMs\CT-EDBMS-XP\Snapshots/{6f6bed49-0fe6-4458-612-093ddfb81be4}.vhd' does not match UUID {05872920-d882-404a-a034-161792b554c7} of its parent medium stored in the media registry ('C:\Users\Sam.Trexler/.VirtualBox\VirtualBox.xml')." I also could not start the vm at that point, receiving the same error.

I copied all of the files in the "VirtualBox VMs" folder for this VM to my user directory for safekeeping, and also copied the VHD file from D:\VirtualBox for this VM to my directory.

A post on this forum suggested I delete the snapshot to merge the changes back into the original VHD. I tried that, but it failed with the same error message and wouldn't delete it.

I then tried to delete the VHD in Media Manager (it has a caution triangle next to it) and re-copy it, as suggested on another forum, but this is greyed out and I cannot delete it.

I then tried to remove the VM without deleting files, and then with deleting files, and re-install the VM. However, the forum with this suggestion was on a site where canned vms are provided, and I don't know of a way to "install" the vm again - their tool does not apply to my case. I tried "Adding" the virtual machine in the VirtualBox GUI, but it came back with the same problem.

Next I created a new VM with a different name and no VHD, and then tried to add the old VHD to this VM. However, this gives the error "Cannot register the hard disk 'D:\VirtualBox\CT-EDBMS\CT-EDBMS-XP.vhd' {05872920-d882-404a-a034-161792b554c7} because a hard disk 'D:\VirtualBox\CT-EDBMS-XP\CT-EDBMS-XP.vhd' with UUID {05872920-d882-404a-a034-161792b554c7} already exists."

I have done some more research on this forum, and understand that the all-zeroes UUID is the parent full VHD, not a snapshot. And I've learned how snapshots work and store the differences. So it seems that on loading the original VM it found a registry entry indicating the UUID of a snapshot, but the actual VHD is not a snapshot but a full VHD. Is that right?

So how do I get back to a runnable VM? I have the files from just after the snapshot was performed. (Foolish me, I didn't back them up before the snapshot - I thought I was backing them up!) And I now have a new VM without a VHD. What's the best way to get my machine running again?

Thanks for your help.

Re: Snapshot caused my VM to not load

Posted: 30. Aug 2013, 09:24
by mpack
The base VHD of the original VM should still be usable. I would just clone it using CloneVDI, then build a new VM around the resulting VDI. VHD should be avoided for other reasons, and snapshots should be avoided at all times. To backup a VM you simply copy the VM folder off somewhere - export is not required except in very unusual circumstances (e.g. you're using VirtualBox 3.x).

Speaking of versions, there is no VirtualBox 4.10, the current release is still 4.2.x. I assume you mean 4.1.10 or 4.2.10.


As to the cause of the error, VirtualBox has a number of known bugs related to the slow updating of the background (memory resident) media register. It's possible that if you had simply shut everything down after creating the snapshot - then restarted after 30 seconds - then everything would have worked ok.

Re: Snapshot caused my VM to not load

Posted: 30. Aug 2013, 19:09
by SamT
mpack, this is very informative and helpful. And you are right, I am running 4.2.10.

In looking for cloneVDI, I find the "clonehd" command in VBoxManage - which says that cloneVDI is supported for backward compatibility and mapped internally to the clonehd command. Is this the appropriate method, or is there another tool that does a better job for this?

I'll give it a try, it looks pretty straightforward and should get me going.

I chose VHD format because we are basically a Hyper-V shop (with some tentative steps toward VMware), so I thought that would be most portable if they gave me a server to put it on instead of my laptop. But with these easy conversion of format, I'll use the vdi format as you suggest.

And thanks for the tips on backing up the vms. Very helpful.

Re: Snapshot caused my VM to not load

Posted: 30. Aug 2013, 20:13
by mpack
CloneVDI is a third party application that makes some tasks easier. See the sticky at the top of this forum.

Re: Snapshot caused my VM to not load

Posted: 31. Aug 2013, 01:48
by SamT
Got it and ran it. Very nice little program, does the job very well and easy to use. Well done! And thanks for creating and publishing it.

It did the job I needed, and I now have the vm back in VirtualBox and running successfully. Everything appears to be back to normal.

Just one further question: I converted the base vhd using CloneVDI, but I did not include the snapshot. And I did not copy the existing snapshot (in my backup directory) into the vm folder. But the vm in VirtualBox GUI still shows the snapshot as present. Is this going to cause any problems?

Thanks for all your help.

Re: Snapshot caused my VM to not load

Posted: 31. Aug 2013, 11:50
by mpack
You should build a new VM around a clone. Never put a cloned disk into a VM where snapshots have been used, because the snapshot information is still present in the VM config file, but no longer correctly describes the disk. Once the new VM exists you can delete the broken one.

Re: Snapshot caused my VM to not load

Posted: 3. Sep 2013, 20:53
by SamT
Thanks for bearing with my newbie attempts on this. You have been extremely helpful. I have created a new virtual machine (following the settings of the old one), re-cloned the original vhd and added it to the storage of the new VM. Everything appears normal, and the new VM is working fine. I have deleted the old VM and all of its files.

I'm all good now. Thanks so much for your help.

Re: Snapshot caused my VM to not load

Posted: 4. Sep 2013, 11:44
by mpack
I'm glad you're back up and running.