corrupt VHD

Discussions related to using VirtualBox on Windows hosts.
Post Reply
zigzag
Posts: 14
Joined: 10. Oct 2011, 12:25
Primary OS: MS Windows 7
VBox Version: OSE Debian
Guest OSses: Ubuntu

corrupt VHD

Post by zigzag »

During deleting snapshot of virtual machine (with Linux Mint instalation and ext4 (maybe ext3, I'm not sure) partition) VirtualBox felt down and now I have problem with starting this machine. I suppose have broken virtual disk.
Is it some way to repair corrupted disk and start new machine (better variant) or at least join it to another machine?
thx

Image
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: corrupt VHD

Post by mpack »

The VHD format is prone to this kind of failure, and for that reason should be avoided when possible. Deleting a snapshot would not have caused it, but running out of disk space while it was working would certainly do it.

So, first make sure you have lots of disk space free. Then I would try cloning the base VHD to VDI format. If VBoxManage doesn't work then you can try doing it with CloneVDI. If either succeeds then you should be able to build a new VM around the clone VDI. If neither works then I'm afraid the only thing that can save you is a backup.

I also suggest avoiding the use of snapshots in future, particularly if you have limited disk space.
zigzag
Posts: 14
Joined: 10. Oct 2011, 12:25
Primary OS: MS Windows 7
VBox Version: OSE Debian
Guest OSses: Ubuntu

Re: corrupt VHD

Post by zigzag »

Thx, but unfortunately, nor VBoxManage "clone hdd" command, nor CloneVDI, not helped. With cloned disk machine did not start.
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: corrupt VHD

Post by mpack »

CloneVDI might have failed - did it? But if CloneVDI successfully created a clone at all, then it must be a working disk image. Any problems you have with the clone would be due to cloning the wrong disk (you must clone a snapshot, not the base VDI), or not configuring the new VM settings properly (the new VM must match the old VM - eg. you must not have a different IO APIC setting, nor switch from IDE to SATA hard disk controller).
zigzag
Posts: 14
Joined: 10. Oct 2011, 12:25
Primary OS: MS Windows 7
VBox Version: OSE Debian
Guest OSses: Ubuntu

Re: corrupt VHD

Post by zigzag »

I cloned base .VHD disk, but when I tried clone snapshot, CloneVDI show this:

Image


..and command VBoxManage.exe clonevm {c0399e8e-1040-4576-8cfb-50bed5c5edb5}.vhd return

VBoxManage.exe: error: Could not find a registered machine named {c0399e8e-1040-4576-8cfb-50bed5c5edb5
}.vhd'
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown
VBoxManage.exe: error: Context: "FindMachine(Bstr(pszSrcName).raw(), srcMachine.asOutParam())" at line 422 of file VBoxManageMisc.cpp
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: corrupt VHD

Post by mpack »

Hmm. The caption on that CloneVDI window you pictured is almost unreadable, but I think it says you are using CloneVDI v2.10 (and you craftily covered up the second version number indication too..). You might want to fix your color scheme.

The "Source is a difference image" error means that CloneVDI was unable to resolve the difference chain. I assume you tried the newest snapshot file? If yes then the next step would be to try older files. You should copy the base VHD into the same folder as the snapshots, just to ensure that CloneVDI is able to find it, then I would try again with each snapshot from newest to oldest, until you find one that works. If none work then I'm afraid that nothing else can be done.
zigzag
Posts: 14
Joined: 10. Oct 2011, 12:25
Primary OS: MS Windows 7
VBox Version: OSE Debian
Guest OSses: Ubuntu

Re: corrupt VHD

Post by zigzag »

I copied base .VHD file to the same folder as snaphot was and then CloneVDI proceeded and now my old virtual machine is working again. Thank you very very much for help.
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: corrupt VHD

Post by mpack »

I'm glad that you got your data back.
Post Reply