Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

| Views: 10655
Recently my Xen server has been retired and taken away for recycling, but the disk images that were running the VMs remained on the external drives that I've been using with it. I've needed to use one of these VMs, but with the Xen server gone I had no way other than to convert everything to VMware to run on my Mac. It took some time to do the disk image conversion (6 days for a 200Gb disk!), but it did get there in the end and the VM works perfectly off of my laptop now.

Doing some research on how to convert a raw disk image (.img file) to a VMware virtual disk (.vmdk file) indicated that I needed qemu-img for the task. This is not installed on OSX by default, but there is a project that ports QEMU to OSX here: http://www.kju-app.org. This is the whole QEMU package, what I needed was just the qemu-img utility.

To get to the qemu-img utility needed to go via the Terminal into the package contents, the utility is found here:

To do the actual conversion, I ran the following command:
./qemu-img convert -f raw -O vmdk /Volumes/xxx/rawdisk200gb.img /Volumes/xxx/vdisk200gb.vmdk

This converted the raw disk image to a VMware disk image. I've tried a small disk image of 10Gb, which took only around 10mins to convert, however the large image of 200Gb took 6 days, but it would all depend on how the data was laid out on the original disk.

Something I noted is that the qemu-img help screen you get when you run the utility without parameters gives misleading information that suggests that the -f and -O parameters should have the file names for the disk images immediately after each one of them, but the reality is you have to specify these parameters first, then specify both the disk image file names as above.


Have comments or feedback on what I wrote? Please share them below! Found this useful? Consider sending me a small tip.
comments powered by Disqus
Other posts you may like...