Advertisements

Convert VirtualBox (vdi) hard drive image to VMWare (vmdk) format

I’ve been using VirtualBox for my Windows XP VM when I’m in linux to get a handle on those Windows apps that I absolutely need, and to sometimes address a piece of hardware that otherwise won’t work. One of the biggest issues I’ve had is a distinct lack of VirtualBox to address my BlackBerry — I absolutely must use my Windows hard drive to do it.

VMWare Workstation seems to overcome whatever shortfall exists in VirtualBox to address it, and I’m happy to say, it works quite well. However, now I have this VirtualBox hard drive image with all my software already installed, and I want to boot it in VMWare. How to convert it?

Fortunately, the VBoxManage utility of VirtualBox can actually convert a VirtualBox vdi image to the vmdk format used by VMWare. It can do it rather easily, as well.

The command format is:

VBoxManage clonehd          | 
                            [--format VDI|VMDK|VHD|RAW|]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--existing]

Example (Windows):

"c:Program FilesOracleVirtualBoxVBoxManage.exe" clonehd "Win XP.vdi" xp.vmdk  --format vmdk --variant standard

Absolute path to VBoxManage is necessary unless it’s in the Windows $PATH.

Example (Linux):

VBoxManage clonehd "Win XP.vdi" xp.vmdk  --format vmdk --variant standard

Successful run gets this output:

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'vmdk'. UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Next, open VMWare and select Create a new virtual machine

Select “I will install the operating system later”

Make your OS selection about the OS that’s currently on the vmdk you will be using. (The guest OS, not the host OS).

Later on, you will have the option to use an existing vmdk image as your virtual hard drive. Do so.

You should now be able to finish setup and boot your converted disk image.

Note that creating a new machine and using an existing hard drive image is not a feature of VMWare Player. Workstation or another product is required. However, JoVa has shared a great workaround:

Since my tip for VMWare Player is not very clear on what to do exactly, I have the following, easy steps that you can follow, right after you started VMWare Player.
1) Select: Create new Virtual Machine
2) Select Guest Operating OS “Microsoft Windows” and select the version you have (for example “Windows XP Professional”)
3) Click “Next” and give a the virtual machine a name, for example “XP-pro”.
4) Click “Next” set the maximum disk size to the size of your actual virtual machine (important!)
5) Click “Next”and click “Finish”. The VM is created
6) Copy your VM (the .vmdk file) over the created (empty) .vmdk (e.g. xp-pro.vmdk)
7) Play the virtual machine

Questions, comments, or feedback is appreciated, as always.

Advertisements

, , , ,

  1. #1 by JoVa on May 6, 2011 - 7:40 am

    Hi, thanks for the tip.

    You actually don’t need VMWare Workstation. You can create a new (empty) VM with VMWare Player first (without installing it), then add your converted XP-drive as e second drive, and in the same session, remove the first (empty) harddisk. The result is a Virtual machine that only contains the converted harddisk.

    • #2 by Mike on May 6, 2011 - 7:43 am

      Thanks for sharing. That’s a great tip for those who use VMware player :)

    • #3 by JoVa on May 7, 2011 - 6:09 am

      Since my tip for VMWare Player is not very clear on what to do exactly, I have the following, easy steps that you can follow, right after you started VMWare Player.

      1) Select: Create new Virtual Machine
      2) Select Guest Operating OS “Microsoft Windows” and select the version you have (for example “Windows XP Professional”)
      3) Click “Next” and give a the virtual machine a name, for example “XP-pro”.
      4) Click “Next” set the maximum disk size to the size of your actual virtual machine (important!)
      5) Click “Next”and click “Finish”. The VM is created
      6) Copy your VM (the .vmdk file) over the created (empty) .vmdk (e.g. xp-pro.vmdk)
      7) Play the virtual machine

      • #4 by Mike on May 7, 2011 - 9:47 am

        Fantastic guide, JoVa! I’ve included it in the main guide with a link to your comment.

        Thanks for sharing!

  2. #5 by Lee Studley on August 6, 2011 - 3:44 pm

    This advice rocked!!! Otherwise I was using VMwares OVFTool2.0 which didn’t like Vboxes haphazard use of the virtual PC spec and fails miserably. save me from having to recreat my machines. You Rock!!!!

    • #6 by Mike on August 6, 2011 - 5:53 pm

      Thank you :) Glad it helped!

    • #7 by Lee Studley on August 6, 2011 - 6:08 pm

      My spelling is getting like the GenXers :-( sorry ;-)

      • #8 by Mike on August 6, 2011 - 6:17 pm

        No worries :) No grammar police here.. (I hope…) ;)

  3. #9 by Roger Waters on September 10, 2012 - 3:24 pm

    Very nice article. I searched a long time for a way to convert a VirtualBox vmdk to working vhd. This is the solution.

    Thanks

  4. #10 by Marko (dericy) on February 24, 2013 - 6:28 am

    Thanks for that great tip!!!

  5. #11 by Romina on May 14, 2013 - 12:12 pm

    Hi,

    I tryed but my machine doesn’t start. I think is a disk dimension problem. I have to set the vmware disk to the maximum disk size of virtual box machine or to the real phisical size of the machine?

    Thanks a lot
    Any suggest will be appreciated