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

28

14

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

IT_07

Posted 2009-11-12T04:54:28.103

Reputation: 464

Answers

6

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)

DaveParillo

Posted 2009-11-12T04:54:28.103

Reputation: 13 402

2This is a horrible way of doing it, look at the posts below for a better way. – cc0 – 2010-12-22T08:31:53.053

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 – 2011-01-06T18:44:37.253

how would i convert the VMDK to VHD? – IT_07 – 2009-11-12T05:36:19.173

58

This function is built into VirtualBox:

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

Derek P

Posted 2009-11-12T04:54:28.103

Reputation: 581

what if that fails (silently) with %ERRORLEVEL% being -1073741819 ? – sylvainulg – 2019-09-03T09:23:20.053

11

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.

Eugenio Miró

Posted 2009-11-12T04:54:28.103

Reputation: 305

3

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

Dinesh

Posted 2009-11-12T04:54:28.103

Reputation: 31

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/

jumpjack

Posted 2009-11-12T04:54:28.103

Reputation: 288