18

I suffered host crash when running guest OS with VirtualBox. Now the VM won't start and complain that:

Could not open them medium '[file.vmdk]` VMDK: inconsistency between grain table and backup grain table in '[file.vmdk]' (VERR_VD_VMDK_INVALID_HEADER).

VD: error VERR_VD_VMDK_INVALID_HEADER opening image file '[file.vmdk]' (VERR_VD_VMDK_INVALID_HEADER)

All I actually need is to get some files from this hard disk image. And also, any way to prevent this in future? One of my hosts that I need to work with is pretty unstable and tends to crash from time to time. I wouldn't like to go through this again.

15

Download the VDD kit from VMWare from here and run the following command: vmware-vdiskmanager -R <Path to vmdk file> This repaired my corrupt header which was caused by a power outage while the VM was running in Virtualbox.

| improve this answer | |
  • I have the same error after a hard reset but after running the repair command I get "No errors were found on the virtual disk" Do you have any other ideas how to fix this? Thanks – user95227 Sep 21 '16 at 14:20
  • I'll add that the macOS version of this tool is quite hard to find. I was able to find it here: kb.vmware.com/s/article/1023856. It's in the Attachments column on the right; pick the first option (it says '1023856-vdiskmanager-3.0.2.zip'). I had to move this to /usr/local/bin, and run it at the same folder the VMDK was (it would not recognize the path otherwise). – DfKimera Nov 1 '19 at 15:58
12

I had the same issue today. Solved it using vdiskmanager (Download link available in attachment section) and follow the instructions here.

Regards, HBK

| improve this answer | |
  • When I run 1023856-vmware-vdiskmanager-linux.7.0.1 -R on the corrupt VMDK file, it doesn't return anything, but when I run it on the non-corrupt ones, it returns, saying they are not corrupt. This utility didn't fix my corrupt VMDK. – Geremia Oct 5 '17 at 14:53
  • 1
    Doesn't run on 64-bit Linux OS. The link gives a 32-bit LSB executable. – doughgle Oct 18 '17 at 13:46
  • This worked for me. Just a note: For those VMs that run using snapshots you may need to fix the snapshot file rather than the base image file. – rodix Apr 20 at 16:37
2

For repair corrupted.vhd file use %Program Files%\Oracle\VirtualBox\VBoxManage.exe internalcommands repairhd "corrupted.vhd"

| improve this answer | |
  • Did not work for me, while the vdiskmanager did the trick – Raffi Jun 13 '17 at 18:13
  • I had to use as is ahead VBoxManage.exe internalcommands repairhd corrupted_vdi_with_path.vdi -format VDI to be able to use the above command. However, this just lead to further info for the case to me - "..Error code VERR_VD_IMAGE_REPAIR_IMPOSSIBLE.." (Command references here - virtualbox.org/manual/ch08.html#vboxmanage-list) – parasrish Apr 9 '18 at 4:22
0

I managed to fix the corrupt header using Virtual Disk Development Kit from vmware. This post about mounting disk image led me to the vddk.

vmware-manager.exe allows you to fix the image file. It worked for me, as I was able to launch the VM, however files I needed were corrupt anyway.

| improve this answer | |
-1

A much easier way to fix this error that required no external tools.

From the main window of the Oracle VM VirtualBox Manager, select the VM that won't start. Click on Snapshots in upper right. Select the second-last entry (since presumably the last one is corrupted, and the previous one is healthy). Right-click on it and choose Restore (I didn't see a point to creating a snapshot of the current VM state, since it's buggered). Done

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.