I recently made the switch from a headless Virtualbox server running PHPVirtualbox to the free VMWare vSphere Hypervisor (ESXi). Switching out the Ubuntu Server 10.04 OS for the vSphere hypervisor was simple. Took less than thirty minutes. The problem came when I found out that vSphere doesnt like the VDI files that Virtualbox creates by default. I probably should have checked that first.
I knew it couldnt be that hard to convert the files, so I started by checking out tools that were available from VMWare. First was the VMWare vCenter Converter. It was described as “Automate and simplify physical to virtual machine conversions as well as conversions between virtual machine formats”. vCenter Converter did not recognize my VDI files.
Next I came across a lot of people saying to use Qemu to do the conversion. Currently I am on a Windows 7 workstation, so this option is no good. I could use a Linux VM or boot to a live distro, but what can I do with what I already have?
Then I found, in the last place I thought to look, in the Virtualbox documentation…http://www.virtualbox.org/manual/ch08.html. I had used VBoxManage in the past to create VDI files from RAW disks, but it didnt occur to me at first to see what else it could do. Well, it can convert from VDI to VMDK and it is VERY easy. All you need is Virtualbox installed.
In a Windows command prompt ‘cd to the Virtualbox installation directory and run the following command. You can also add the Virtualbox installation directory to your PATH statement if you do not want to ‘cd all the time. Dont forget to change the “pathtoimage.vdi” and “pathtoimage.vmdk”.
In Linux you can run the command as is. Just copy and past, changing the “pathtoimage.vdi” and “pathtoimage.vmdk”.
VBoxManage clonehd "pathtoimage.vdi" "pathtoimage.vmdk --format VMDK