How To Convert VMWare Image (.vmdk) to VirtualBox Image (.vdi)

By | 2009/03/22

I’ve found more and more people are switching to Virtualbox these days and I keep running into the same question.  “How can I convert my VMware images to Virtualbox images?”  Well, breath easy because it is possible and not very difficult!

There are two methods that I am aware of that will allow you to use your VMware images on Virtualbox.  The first method I’ll outline uses the graphical Virtualbox interface and the second uses the command line. Each method should be equally as stable, it simple depends on your preference.

Method 1

Start Virtualbox
Inside the Virtualbox Menu click: File > Virtual Media Manager
Click on the “Add” button.
Locate and select the VMware .vmdk file you’d like to convert.
Click Open.
Verify your disk image has been added to the list of images and that the virtual and actual sizes appear accurate.
Click OK
Create a new virtual machine profile, selecting your imported image for the storage.
Boot your new virtual machine.

Method 2
To use the second method we’ll need an addition command-line tool called qemu.

sudo aptitude install qemu

You’ll new be able to convert a .vmdk (VMware image) to a .bin format, which can then be converted to a Virtualbox native .vdi format.

qemu-img convert /path/to/original.vmdk converted.bin

You’ll then need to use the VBoxManage utility that comes with Virtualbox to convert the .bin to a native .vdi format:

VBoxManage convertdd converted.bin converted.vdi

You can now create your new Virtualbox machine profile, using this new .vdi file as your disk image.

Two methods for converting VMware images to Virtualbox images.  Are there any other methods that you can suggest, or have you had better experience with one or the other?  Let us know!

30 thoughts on “How To Convert VMWare Image (.vmdk) to VirtualBox Image (.vdi)

  1. Tobias

    What’s wrong with

    VBoxManage clonehd clone.vmdk clone.vdi -format VDI

  2. JRobbo

    Nice writeup Christer

    Just an extra tip before people start down this road. If your VM is running Linux, this will probably work as is, however is your VM is running a flavour of Windows, then it can be quite difficult to get going, depending on how your VM was built in the first place.

    VMWare has virtual support for things like AGP video, IEEE1394, multiprocessors, and quite a few other things that VirtualBox does not. If your Windows installation contains any of these things, then Windows will BSOD when you try to boot. The only option is to go to the recovery disk and manually disable the affected services manually until it works.

    This happened to me, I originally had native Windows XP installed on my Hard Drive, and I converted it to a VM using VMWare Converter and run that using VMWare server for a while, and it all worked fine. When I tried to convert it to a VirtualBox image however, well that’s when the fun began. It took me ages to find our which services I had to disable. Once I had it done though, the VM ran without fault.

    Have Fun!

    JRobbo

    1. Roman

      Yeah I went to these instructions: http://www.virtualbox.org/wiki/Migrate_Windows
      booted off of an install disk image and ran the repair installation option and that did fix it. Now it boots up. Still, that was a lot of trouble to go through and Windows even insists on immediate "activation". There's probably a better way.

  3. IanP

    Although every Linux virtual machine I have converted runs ok, I have never managed to get a windows machine to run after conversion, presumably due to the different hardware architecture involved.

  4. dietrich

    More than one way to skin a cat.

    You can use Knoppix. How?

    You have two VMs–one for VMware one for VB.

    Essentially you point the virtual CD drives in each to an iso copy of Knoppix, so that when you start each VM, it will boot the respective copy of Knoppix into each VM’s environment. On the target VM start up your sshd server.

    Then, you use ‘dd’ to copy the drive image from one machine to the other–over ssh!

    Example dd copy from Virtual box to VMware over ssh:

    dd if=/dev/hda bs=15M conv=sync,noerror | ssh -o TCPKeepAlive=yes root@vmware_host_ip

    That’s it.

  5. Fabian Rodriguez

    I used method #1 to start up an old VMWare WinXP Home image (converted from a baremetal install), I didn’ t have any trouble at all. Initially it complained about VGA and ” main system ” drivers not being found, then about reactivating the Windows license.

    I ignored the drivers warnings, and reactivated the license, everything else went well. Thanks for the tip.

    Cheers!

  6. Santanna

    I created my Virtual Machine Vmware (Windows 7) with Win XP. It created a folder named MY Virtual Machines(Principal). Inside this folder there are another Folder named Windows 7 and an archive named Windows 7.vmdk.
    Inside the Folder Windows 7 there is another Windows 7.vmdk with size different from the other outside.
    Wich one I have to use to transform to Virtualbox????
    Thank you for help.
    best Regards
    Santanna

  7. Florian

    Make sure, that you deinstall the vmware-tools before you start. On my pc, the vmware-tools cant be removed when the machine is not running under vmware.
    And the vmware-tools keep a hand on the virutal network cards, even when running in VirtualBox.

  8. Rune

    I found your article useful, though I have one remark; QEmu is not just a command-line tool but a complete virtualisation environment like vmware and virtualbox.

  9. dolphin

    I faced some issues with the step 1 which read as ‘cannot register the hard disk ‘id’ because a cd/dvd image ‘id’ already exists in the media registry

    but i found https://wiki.ubuntu.com/UbuntuMagazine/HowTo/Switching_From_VMWare_To_VirtualBox:_.vmdk_To_.vdi_Using_Qemu_+_VdiTool which has similar steps as in step 2 and created .vdi file. now I tried running xp on virtualbox but the system hangs. status shows as ‘windowsxp running’ but my mouse hangs and could only return when i pressed the power button.

    can you help to run xp on virtualbox?

    thanks.

  10. Jackie Chan

    How do you merge multiple 2gb vmdks and snapshots before converting to virtualbox? The above 2 methods do not work if you have multiple ‘vmdk’ virtual disks – failed to boot even thought the machine is running.

  11. Jackie Chan

    Jackie Chan :
    How do you merge multiple 2gb vmdks and snapshots before converting to virtualbox? The above 2 methods do not work if you have multiple ‘vmdk’ virtual disks – failed to boot even thought the machine is running.

    00Rate This

    PDRTJS_settings_1180493_comm_10864 = {
    “id” : “1180493”,
    “unique_id” : “wp-comment-10864”,
    “title” : “How+do+you+merge+multiple+2gb+vmdks+and+snapshots+before+converting+to+virtualbox%3F+The+above+2+methods+do+not+work+if+you+have+multiple+%27vmdk%27+virtual+disks+-+failed+to+boot+even+though+the+mach…”,
    “item_id” : “_comm_10864”,
    “permalink” : “http%3A%2F%2Fubuntu-tutorials.com%2F2009%2F03%2F22%2Fhow-to-convert-vmware-image-vmdk-to-virtualbox-image-vdi%2F%23comment-10864”
    }

  12. Jason

    Method 1 doesn’t do a conversion. You’re just adding the VMDK file to your VM. It’s still a VMDK.

  13. Johan

    If you need qemu-img on OS X, download the Q-app from http://www.kju-app.org/, drag to Applications and you will the tool here /Applications/Q.app/Contents/MacOS/qemu-img

  14. deuce

    Vladimir :Can anybody tell me how convert VirtualBox image to VMware image?

    I’m also interested in doing this but reversed…anybody know how?

  15. Bob

    Excellent! The 2nd method worked fine for me with VirtualBox OSE 4.0.4 on Ubuntu 11.04.

    This 1st method didn’t work, cause I haven’t found the mentioned “Add”-Button.

  16. Matthew

    Sorry for asking, but what is QEMU and does anyone have a link to download it?

  17. Graphics

    I have an alternate distro called Bodhi, which I would like to convert. I’ll try out using your tut, see if I can convert existing system for use in Virtualbox. Thank you.

  18. nino

    Under windows system you can use this:
    VBoxManage clonehd source.vmdk output.vdi –format VDI

  19. Twistout

    Eu consigo converter a VM de VirtualBox para VMware?
    Brasil

  20. Pratt G

    I tried to convert .vmdk to .img using VBoxManage command but I am getting an error while booting it on KVM hypervisor

    Command :
    VBoxManage internalcommands converttoraw -format RAW source.vmdk target.img

    ERROR:No bootable device
    source.vmdk is Ubuntu 11.10
    VirtualBox 4.1.2

Comments are closed.