[Solved]VDI with snapshots - corrupted images and/or xml cfg

This is for discussing general topics about how to use VirtualBox.
Post Reply
ppaffell
Posts: 3
Joined: 5. Jul 2013, 14:12

[Solved]VDI with snapshots - corrupted images and/or xml cfg

Post by ppaffell »

Hello,

Something bad happened to my virtual machine and/or image files. I've tried some workarounds with deleting xml files, removing virtual machine without vdi files. Nothing worked for me.

I have main VDI file called Win2008.vdi, two snapshot files (with .vdi extension) and one .sav file in Snapshots directory.

VBoxManage showhdinfo IMAGE_FILE shows correct parents for both snapshot files, so one points to the other, and that one points to UUID of Win2008.vdi.

1) If i create new vm configuration and point virtual disk to Win2008.vdi file, vm starts and creates automatically new snapshot file, but this is useless because all new data is in snapshot files which are not visible by vm.

2) When I get back to position when vm stopped working I'm stuck with:

Code: Select all

$ VBoxManage showvminfo {051294a6-3d43-4c70-8a06-113607133e1c}
Name:            <inaccessible!>
UUID:            051294a6-3d43-4c70-8a06-113607133e1c
Config file:     /home/admin/VirtualBox VMs/Win2008 - OK/Win2008 - OK.vbox
Access error details:
VBoxManage: error: PCDATA invalid Char value 3.
VBoxManage: error: Location: '/home/admin/VirtualBox VMs/Win2008 - OK/Win2008 - OK.vbox', line 307 (3), column 42.
VBoxManage: error: /build/src/VirtualBox-4.1.2_OSE/src/VBox/Main/src-server/MachineImpl.cpp[685] (nsresult Machine::registeredInit())
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component VirtualBox, interface IVirtualBox, callee 
Now if I correct xml file by removing line 307: <GuestProperty name="/VirtualBox/GuestAdd/VersionEx" value="^D^C" timestamp="1356141796637834000" flags=""/> I get:

Code: Select all

$ VBoxManage showvminfo {051294a6-3d43-4c70-8a06-113607133e1c}
Name:            <inaccessible!>
UUID:            051294a6-3d43-4c70-8a06-113607133e1c
Config file:     /home/admin/VirtualBox VMs/Win2008 - OK/Win2008 - OK.vbox
Access error details:
VBoxManage: error: A differencing image of snapshot {90430448-9476-4531-a1b5-da091cd1a1db} could not be found. Could not find an open hard disk with UUID {8a271433-7c95-4eb8-b1ab-8ec961c3a2ac}
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component SnapshotMachine, interface IMachine, callee 
However in Snapshots directory I've got files:
{2c946997-8a0f-4508-948e-240ecc9d182c}.vdi
{90430448-9476-4531-a1b5-da091cd1a1db}.sav
{c6c9a53e-1f3e-4a69-a60b-8c3dd940d492}.vdi

Code: Select all

$ VBoxManage showhdinfo \{2c946997-8a0f-4508-948e-240ecc9d182c\}.vdi 
VBoxManage: error: Parent medium with UUID {c6c9a53e-1f3e-4a69-a60b-8c3dd940d492} of the medium '/home/admin/VirtualBox VMs/Win2008 - OK/Snapshots/{2c946997-8a0f-4508-948e-240ecc9d182c}.vdi' is not found in the media registry ('/home/admin/.VirtualBox/VirtualBox.xml')
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component Medium, interface IMedium, callee nsISupports
Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, AccessMode_ReadWrite, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 210 of file VBoxManageDisk.cpp

$ VBoxManage showhdinfo \{c6c9a53e-1f3e-4a69-a60b-8c3dd940d492\}.vdi 
VBoxManage: error: Parent medium with UUID {8a271433-7c95-4eb8-b1ab-8ec961c3a2ac} of the medium '/home/admin/VirtualBox VMs/Win2008 - OK/Snapshots/{c6c9a53e-1f3e-4a69-a60b-8c3dd940d492}.vdi' is not found in the media registry ('/home/admin/.VirtualBox/VirtualBox.xml')
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component Medium, interface IMedium, callee nsISupports
Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, AccessMode_ReadWrite, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 210 of file VBoxManageDisk.cpp

$ VBoxManage showhdinfo Win2008.vdi
UUID:                 8a271433-7c95-4eb8-b1ab-8ec961c3a2ac
Accessible:           yes
Logical size:         133120 MBytes
Current size on disk: 6872 MBytes
Type:                 normal (base)
Storage format:       VDI
Format variant:       dynamic default
Location:             /home/admin/VirtualBox VMs/Win2008 - OK/Win2008.vdi
I think that vdi files have good parent information and problem is related to some configuration options. I have no idea how to check anything about .sav file.

Thanks in advance for any clues.
Last edited by ppaffell on 6. Jul 2013, 09:59, edited 1 time in total.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VDI with snapshots - corrupted images and/or xml config

Post by mpack »

The .sav file is not important, that's just a hibernation file created because you suspended the VM rather than shut it down. Betcha you also upgraded VBox while VMs were suspended, which led to the first problem.

If only I knew what your host OS was, I could perhaps offer more detailed advice. For the moment all I can recommend is that you find the most recent snapshot VDI in the Snapshots subfolder, clone it using CloneVDI, and build a new VM around the resulting clone. And perhaps avoid snapshots in future.
ppaffell
Posts: 3
Joined: 5. Jul 2013, 14:12

Re: VDI with snapshots - corrupted images and/or xml config

Post by ppaffell »

Thank you for reply. Below is some more information on my situation.

I did not upgrade VBox since september 2011. For sure there were at least two new snapshots and I've deleted at least one snapshot to release some space (using VBox GUI) after VBox upgrade.

All I did yesterday I've shut down Windows guest and did poweroff to host machine. It's possible that vm was shut down incorrectly afterwards, because host instead of going down rebooted which I saw too late. Maybe guest crashed - should this end up with .sav file? I don't remember suspending this particular guest ever.

Host OS is Arch Linux with 3.0 kernel. Guest OS was Windows 2008 server.

Is CloneVDI able to "compact" snapshot with main VDI file without correct configuration in XML files?

I'll try CloneVD, but it'll take some time (all VDIs together are larger than 250GBs). I'll post results of course.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: VDI with snapshots - corrupted images and/or xml config

Post by mpack »

Yes, CloneVDI can merge a chain of snapshot VDI files and does not require anything in the xml files. However my advice assumed that the VM was created using VirtualBox v4.0 or later. Even so, the advice remains the same, except make sure that all of the snapshot files plus the base VDI are in the same folder, before you clone the most recent snapshot VDI (not the base VDI).
ppaffell
Posts: 3
Joined: 5. Jul 2013, 14:12

[SOLVED] Re: VDI with snapshots - corrupted

Post by ppaffell »

After recovering with CloneVDI I was able to create new vm with recovered vdi file. VM booted ok. Everything seems to be fine.

mpack, thanks to you and your tool I didn't loose my data. Thank you VERY much.
Post Reply