How to fix a corrupted VMDK VirtualBox disk image

I was testing a VMDK VirtualBox disk image created as a dynamically sized sparse disk.  And I tested putting data into it to grow its size until my disk ran out of space on the host OS --- while inside the guest OS the disk image still had space.

It crashed and corrupted the VMDK disk image.  And VirtualBox doesn't have a way to fix it.

VMDK is actually a VMWare format.  They have a utility to fix it.

Just download the vdiskmanager from the Attachments section of this page [1].  Then use it as sudo /path/to/vmware-vdiskmanager -R /path/to/broken.vmdk to fix it as documented here [2].

[0] Can I fix corrupted vmdk image? VERR_VD_VMDK_INVALID_HEADER
[1] Repairing a virtual disk in Fusion 3.1 and Workstation 7.1 (1023856)
[2] Repairing a sparse virtual disk in Fusion (1023888)

No comments: