VBoxManage
We have used VBoxManage to clone VirtualBox disks. The method here is identical, except that we will be converting to a different disk format. Let’s see how this is done.
VBoxManage clonehd source.vdi target.vmdk –format VMDK
Where source is your VirtualBox disk, target is your VMware disk and –format VMDK is the desired output format. Similarly, you can go the other way around, using VMDK as your source and VDI as your target. Make sure to specify the right disk format. VBoxManage clonehd function supports other formats as well.
Vice versa
Oh, yes, the other direction is fairly simple.
VBoxManage clonehd source.vmdk target.vdi –format VDI
QEMU
QEMU is an old friend, too. We’ve seen in my very first article on virtualization, when I was still young and naive. Strike that, I was never young. We have also used QEMU to convert VMDK disks to RAW format, so we could use them with Amazon EC2 machines. The concept is exactly the same here. And it works both ways.
VDI to VMDK
It’s extremely simple.
qemu-img convert something.vdi -O vmdk something.vmdk
VMDK to VDI
You have two ways to do this. Use a one-step qemu-img-vdi tool or go about using classic qemu-img, which will require an intermediate conversion to raw format.
qemu-img-vdi
Pretty much like all other conversions we’ve seen before:
qemu-img-vdi convert something.vmdk -O vdi something.vdi
qemu-img
Now, using qemu-img, you have two steps, first convert to RAW format, then use VBoxManage to convert to VDI. Older versions of VirtualBox used the tool called vditool, so you may find online resources that reference this utility.
Step 1: Convert VMDK to RAW (you don’t need any file extension, btw)
qemu-img convert something.vmdk something.raw
Step 2: Convert RAW to VDI
VBoxManage convertdd something.raw something.vdi
Note: If you’re using sparse disks, as we’ve seen in other tutorials, the raw file will them inflated to their intended max. size. A 20GB disk, even though if only 2.4GB are used, will become a 20GB byte-by-byte file on your hard disk.
That would be all. Next, please!
Conversion method 3 (maybe): VMware Converter
To the best of my knowledge, and I’ve already stated in the past, it does not seem that VMware Converter supports VirtualBox. Therefore, using VMware Converter may or may not work.
Now, you can try a different method. Export your VirtualBox machine as an appliance, which will save it in the .ovf format, including a ready VMDK disk. Then, convert the appliance using VMware Converter. There’s no guarantee, though. I have read a few forum threads here and there where various users claimed to have done it successfully, so it indeed may be possible.
I have not managed this yet, so keep this in mind!
Recent Comments