NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ
for more details.
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.
Hope you found this post useful...
...so please read on! I love writing articles that provide beneficial information,
tips and examples to my readers. All information on my blog is provided free of
charge and I encourage you to share it as you wish. There is a small favour I ask in return however -
engage in comments below, provide feedback, and if you see mistakes let me know.
If you want to show additional support and help me pay for web hosting and
domain name registration,
donations, no matter how small, are always welcome!
Use of any information contained in this blog post/article is subject to this disclaimer
Other posts you may like...