2

I trying to convert a VMDK image (Windows installed) to RAW format with the qemu-img command. However, it is failing with the following error:

   $ qemu-img convert -f vmdk -O raw image.vmdk /tmp/image.img
   qemu-img: Could not open 'image.vmdk': invalid VMDK image descriptor
   qemu-img: Could not open 'image.vmdk'

As far as I can tell, the image itself seems fine, at least I can boot properly from it using VMWare Player. I'm using qemu-img version 2.0.0.

Jim Holden
  • 123
  • 1
  • 1
  • 4

4 Answers4

8

Do not use the .vmdk image itself but the smaller .vmdk file which references the image.

nope
  • 102
  • 1
  • 2
1

It may be the VMDK file is using an image format not supported by QEMU. An example of this is detailed http://brezular.com/2014/07/22/how-to-run-juniper-firefly-perimeter-vsrx-on-gns3/ where the VMDK file format used by the shipped Juniper images are streamOptimized vmdk's, which need to be converted by VMDK tools to a format supported by QEMU.

Gareth
  • 11
  • 1
0

I encountered this problem as well. The root cause is that even the file extension is VMDK, the source file format may be raw. Therefore "-f raw" can fix the issue. The following command "qemu-img info [source filename]" can be issue to check the source file format.

0

I tend to use VBoxManage which ships with VirtualBox for converting virtual disk images from one format to another. It's very versatile and fast.

VBoxManage clonehd /path/to/image.vdmk /path/to/newimage.raw --format RAW
Janne Pikkarainen
  • 31,454
  • 4
  • 56
  • 78