10

The setup in question is as follows: Windows 7 64bit host running VirtualBox. The guest machine is running Windows XP 32bit.

After a power failure on the host box, the guest machine cannot boot and complains that

inconsistency between grain table and backup grain table

Any help to boot the guest machine without reinstalling it appreciated.

PS: What is a grain table anyway?

4

Can't really help, but I found what the grain tables are here: http://www.vmware.com/support/developer/vddk/VirtualDiskAPIprogramming.pdf (page 16)

Like the user mailq says, looks like your virtual drive is broken. Maybe check the vmdkck tool (on this page http://datto.org/projects/vmdk-tools ) to double check it's broken?

| improve this answer | |
12

VMware has a tool called vmware-vdiskmanager located in "/Applications/VMware Fusion.app/Contents/Library/" and symlinked to /usr/local/bin when installed. You can use this tool to repair VirtualBox VMDK disks as well. It saved me a couple of times already.

Installation

a. You can install vmware-fusion

brew cask install vmware-fusion

b. Or you can download the vmware-vdiskmanager utility directly from Attachments section at the bottom of this page:
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1023856

Usage

vmware-vdiskmanager -R <your_disk>.vmdk

Invoking without parameters gives help usage:

Usage: vmware-vdiskmanager OPTIONS <disk-name> | <mount-point>
Offline disk manipulation utility
...
     -R                   : check a sparse virtual disk for consistency and attempt
                            to repair any errors.
...
| improve this answer | |
  • 1
    The name of the tool has a v in it: "vmware-vdiskmanager". I tried to edit the answer, but it only added 2 characters, and edits have to be at least 6? :) – Ned Batchelder Mar 15 '15 at 10:44
  • This worked great, it just saved me after my Mac crashed and left a vagrant virtualbox in a dirty state. Thank you! – Fred Nov 20 '15 at 18:13
  • 1
    I'm getting "no errors were found on the virtual disk" after running the repair command even though I have the same grain table error. Any other ideas fro solving this? – user95227 Sep 21 '16 at 14:19
  • Awesome, thanks! Was able to fix corrupted appliance file (*.vmdk) after forced poweroff. – Matt Borja Oct 18 '16 at 19:41
  • 1
    Last night, a ServerFault answer saved my life! – Spencer Williams Jul 14 '17 at 21:55
2

Your virtual hard drive is broken. Grain tables are some internal stuff of virtualization environments.

Googling for the exact term reveals that there are not many possibilities to recover: https://forums.virtualbox.org/viewtopic.php?f=6&t=40049

| improve this answer | |
  • Thank you for the prompt reply. I had googled prior to asking at SF. I asked hoping for a long-shot answer not already covered by the VirtualBox fora. – adamo Oct 24 '11 at 14:21
2

I used CloneVDI to solve this problem. I made a clone and the new file works very well.

| improve this answer | |
  • I can attest to this. This saved my life. Whew. – Ardee Aram Apr 1 '14 at 4:28
1

I had this error after moving my ~/VirtualBox\ VMs from Linux to MacOS. I tried @mens solution using vmware-vdiskmanager, but it failed for me.

During my migration from linux to MacOS, I added all of the *.vbox files back into Virtualbox and they all failed to boot with the same error (using vagrant):

There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "<UUID 1>", "--type", "headless"]

Stderr: VBoxManage: error: Could not open the medium '/path/to/box-disk1.vmdk'.
VBoxManage: error: VMDK: inconsistency between grain table and backup grain table in '/path/to/box-disk1.vmdk' (VERR_VD_VMDK_INVALID_HEADER).
VBoxManage: error: VD: error VERR_VD_VMDK_INVALID_HEADER opening image file '/path/to/box-disk1.vmdk' (VERR_VD_VMDK_INVALID_HEADER)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MediumWrap, interface IMedium

I verified that the data transfered correctly, md5 box-disk1.vmdk returned the same thing for both files.

I managed to get a vm to boot again by converting the vmdk files to vdi doing the following. (Requires qemu, brew install qemu)

# Convert from `.vmdk` to `.bin`
qemu-img convert box-disk1.vmdk box-disk1.bin

# Convert from `.bin` to `.vdi`
VBoxManage convertdd box-disk1.bin box-disk1.vdi

Updated path to volume for .vdi and machine booted.

In my case, vdi file is slightly larger, don't forget to delete .bin as it's huge. Oh and it fails to authenticate on first run. Anyway, if possible, maybe you should spin up a new vm from scratch instead.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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