How do I convert a VDI HDD to a VHD file?

This function is built into VirtualBox:

VBoxManage clonehd source.vdi target.vhd --format vhd

There is a new option now in VirtualBox 4.1 to copy a VDI with a new format (including VHD), which is equivalent to the command Derek P pointed out last year, but in a nice GUI.

  1. Open Virtual Box and select Files > Virtual Media Manager.
  2. Select an existing disk file on the Hard Disks tab and click the Copy button.
  3. Complete the steps in the wizard. Select VHD when prompted for the file type.

The best way is to use VBoxmanage as explained by Derek P. If you have an old VirtualBox, either upgrade, or:

You convert VDI to VMDK, then convert VMDK to VHD in one of several ways:

  1. VMWare VCenter Converter Standalone Client
  2. vmToolkits VMDK to VHD converter
  3. WinImage (shareware)