31

Is there a way to convert a VDI HDD to a VHD?

7

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)
4
  • how would i convert the VMDK to VHD? – IT_07 Nov 12 '09 at 5:36
  • 2
    This is a horrible way of doing it, look at the posts below for a better way. – cc0 Dec 22 '10 at 8:31
  • 3
    @cc0, you're right. Back when I wrote this though, VBoxManage didn't support vdi to vhd, just the other way around. Derek P's answer is better. – DaveParillo Jan 6 '11 at 18:44
  • And vmtoolkit.com is up for sale. – jamie Jan 12 at 16:40
67

This function is built into VirtualBox:

VBoxManage clonehd source.vdi target.vhd --format vhd
1
  • what if that fails (silently) with %ERRORLEVEL% being -1073741819 ? – sylvainulg Sep 3 '19 at 9:23
12

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.
4

Yes, as Derek said, builtin tool with VirtualBox works well under Windows OS without any third party software. Converted OS is booting without any troubles, for more information with example steps check this post,

VDI to VHD – Convert VirtualBox Virtual Machines to Virtual PC

1

Without downloading and installing VirtualBox, you can use qemu-img from QEMU package:

qemu-img.exe convert source.img -O vhdx -o subformat=dynamic dest.vhdx

Download for windows: https://cloudbase.it/qemu-img-windows/

Not the answer you're looking for? Browse other questions tagged or ask your own question.