This article show you how to convert Sun Virtualbox vmi file to Vmware vmdk file. Recently I have started using Ubuntu as my desktop in my company. And installed Sun Virtualbox for test VMs. But most of the people have vmplayer installed. So they donot know how to use this vmi images on a windows box. So here is a solution for converting those vdi image files to VMware .vmdk images.

When we install Sun Virtualbox we have so many command lines tools installed along with it. One good tool is VBoxManage, Please remember commands in Linux are case sensitive. So if you try to type vboxmange it will not work. You have to type exactly as VBoxManage.

Step1 : Convert from vdi to raw.
#VBoxManage internalcommands converttoraw /data/Vm-images/ubuntu-vm.vdi /data/Vm-images/ubuntu.raw

Step2 : Now install qemu, which is used to convert .raw files to .vmdk
#apt-get install qemu

Step3 : Convert .raw files to .vdmk using qemu-img command
#qemu-img convert -O vmdk /data/Vm-images/ubuntu.raw /data/Vm-images/ubuntu.vmdknow try to access this .vmdk file using your VMware workstation or VMware player.

So what about viseversa?here there are two methods are there
1. By default your Sun Virtualbox will support .vmdk vmware images.
2. If it’s not supported use the following way.

Step1 : Use again qemu-img to convert .vmdk disk to .rawqemu-img convert ubuntu.vmdk /tmp/ubuntu.raw

Step2 : VBoxManage convertdd /tmp/ubuntu.raw ubuntu.vdiplease share your thoughts.