convert .vhd (virtualpc) file to .vdi (virtualbox) format

From .vhd to .vdi

When I tried to run xp vhd, provided from microsoft, to test websites on multiple versions of IE (cf. How to test your website on IE6 & IE7 thanks to virtualization), it occurs that each .vhd file has been generated with the same UUID, preventing them from being loaded at the same time in VirtualBox (v2.2).

Although VirtualBox can now transparently handle .vhd natively, I chose to convert these .vhd files into .vdi format so that they have each a unique uuid and can be loaded at the same time in VirtualBox.

Below are the steps:

To do this, I proceeded as follow:

  1. install qemu package (sudo apt-get install qemu)
  2. convert .vhd file: qemu-img convert -O raw myfile.vhd myfile.bin
  3. once the file has been converted, we convert it to .vdi format using VBoxManage: VBoxManage convertfromraw myfile.bin myfile.vdi –variant standard
    note1: “variant” is specified to ensure we have an expandable vdi file (.bin file is 17Gb, .vdi file will be only 1.5Gb)
    note2: in previous version, “convertfromraw” command was called “convertdd”

That’s it.

Simply load your vdi file within VirtualBox, do it for all three xp .vhd files and you can now use all these VM more easily.

sources

12 Responses to “convert .vhd (virtualpc) file to .vdi (virtualbox) format”

  1. [...] To do this, please read this post: convert .vhd (virtualpc) file to .vdi (virtualbox) format [...]

  2. [...] steps are explained in this post: convert .vhd (virtualpc) file to .vdi (virtualbox) format It assumes a .vhd format as source, but process is almost identical when source file is in .vmdk [...]

  3. [...] convert .vhd (virtualpc) file to .vdi (virtualbox) format …By remy How to test your website on IE6 & IE7 thanks to virtualization), it occurs that each .vhd file has been generated with the same UUID, preventing them from being loaded at the same time in VirtualBox(v2.2). Although VirtualBox can now …Willing wheels – http://www.qc4blog.com/ [...]

  4. good job … thanks for sharing

    more virtualbox stories http://www.geeksww.com/news/virtualization/virtualbox/

  5. Phil Brown says:

    As of VirtualBox 2.2.4, you can use the VBoxManage internalcommand “sethduuid” to modify the UUID of VHD files, eg

    VBoxManage internalcommands sethduuid XPSP3withIE62008Dec.vhd

    The VHD files don’t even need to registered with the Virtual Media Manager.

    See http://www.virtualbox.org/ticket/3443

  6. remy says:

    great news! no need to convert any vhd file then => makes the entire process easier. Thx

  7. [...] [UPDATE]: now virtualbox natively support .vhd files => you might be interested in reading this post: convert .vhd (virtualpc) file to .vdi (virtualbox) format [...]

  8. [...] as that. Thanks to Willing Wheels for these instructions, worked [...]

  9. Yesevil says:

    nice work, well done &

    thankyou

  10. [...] su linux ubuntu seguire questi passaggi, devo ancora testare, click qui Articoli con qualche attinenza.XP Mode su Windows 7Una svolta con Seven è venire incontro, ha chi [...]

  11. Lars Nielsen says:

    In the latest version of Virtual Box (v 3.2.4) you can use the clonehd command in vboxmanage to do this in one step. Just use the command like this:

    vboxmanage clonehd myVHDimage.vhd newVDIimage.vdi -format vdi

    This will create a new file, newVDIimage.vdi

Leave a Reply