jeffcoughlin.com

Convert VirtualBox (vdi) to VMWare (vmdk)

Recently I decided to switch from VMWare desktop to VirtualBox desktop VM software. I've heard great things about VirtualBox (speed and less-overhead being two very nice features). I did not need to migrate a VM because I wanted a fresh install of Win2008 R2 Enterprise and MSSQL 2008 R2 64-bit. I've been using VirtualBox for a few months now and for the most part it's worked out great, but there were certain things I missed from VMWare desktop. The reasons aren't really that important (I have nothing against VirtualBox and still think it's pretty awesome), but I thought I'd just share how I converted it.

I did a lot of research on the web and found many tutorials and walkthroughs for earlier versions of VirtualBox, but when I went to use those lengthy methods, I found that they weren't possible anymore (at least not the same way). The old way (which is still possible, but with a different utility) also required another program called qemu-img. You actually can still use the old method of converting the VM to raw format and then convert it again to VMWare's vmdk format using Quem-img (each conversion can take a while depending on the size of the VM). However, as of VirtualBox 3.1+ you can now do it all in one command line (and only have to do one conversion).

I'm on a Mac, so the example below is for Mac (using VMWare Fusion). But the same command line should work for Windows (you just need to substitute the paths and point to the vboxmanage.exe file instead of the contents in the app file as seen below). Also, the source and destination paths are custom in this case (I'm currently storing mine on an external storage device).

In the following example I'm calling my virtual machine filename windows.vdi for simplicity (most likely your filename is long and has spaces like mine. Thus I suggest wrapping your file locations in quotes).

view plain print about
1/Applications/VirtualBox.app/Contents/MacOS/Vboxmanage clonehd "/Volumes/Drobo/Virtual Machines/windows.vdi" "/Volumes/Drobo/Virtual Machines/windows.vmdk" -format VMDK -variant standard -type normal -remember

Note: It is VERY important to have the full paths to the source and destination files otherwise you'll get an ambiguous error message as I found out the hard way (with some google searching I was able to figure it out though). I believe this effects Windows users as well (not positive on that).

I wish I could give credit to the forum post that I dug most of this up in (I believe it was somewhere in the VirtualBox forums). Sorry to whomever I'm not giving proper credit.

After the conversion is complete, open VMWare and create a new virtual machine. Choose the option to open an existing VM.

I converted the VM with VirtualBox v3.2.8 and then opened the new file in VMWare Fusion 3.1.1. VMWare said the vmdk file was an older format and needed to be updated (I agreed of course). A few seconds later the VM opened successfully. As expected, new drivers were auto-detected and added (I believe I had to reboot the VM OS twice) and then I installed the latest VMWare Tools (followed by another reboot - all expected).

In all the process took about 30-40 minutes on a 50GB VM (about 10 minutes was the auto-update for drivers and the VMWare Tools install and reboot).

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Eric's Gravatar This was extremely helpful... needed some slight mods to the newer VBox tools.

VBoxManage clonehd "***.vdi" "***.vmdk" --format VMDK --variant Split2G

I used the Split2G option because I'm convinced that the VM's are easily transferable when the 50g VM is split into 2G files, although you do get a slight performance hit.
#1 by Eric | 6/8/11 3:06 PM
michael's Gravatar i followed these instructions all went well but the applications/programs i installed on vm is gone?
#2 by michael | 8/7/12 11:23 PM



BlogCFC 5.9.8.007 by Raymond Camden | RSS | Contact Blog Owner