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
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.