39

I made an image with disk2vhd and unfortunately I chose VHDX instead of VHD. I didn't see any information about what to choose.

Anyway, now that file is all I have, the original PC is trashed. So I need to know how to run it as a Virtual Machine in Windows 7.

VirtualBox doesn't have an option to open VHDX and WM Converter doesn't have an option to open VHDX (or to convert to VHD).

6 Answers 6

50

You can do that conversion with VirtualBox :

VBoxManage.exe clonemedium "input_file.vhdx" "output_file.vhd" --format VHD

Default Path to VBoxManage.exe

C:\Program Files\Oracle\VirtualBox\
3
  • 3
    It looks like this is broken in VirtualBox 5.0. The report is labeled as "critical", but hasn't been modified in 7 months, so not very optimistic.
    – Wasabi Fan
    Feb 3, 2016 at 2:07
  • 2
    @WasabiFan - it works again in 5.1.4 (I just used it). Sep 10, 2016 at 22:23
  • Also, one can encounter the VHDX: Image has a non empty log which is not supported (VERR_NOT_SUPPORTED) error message.
    – Bass
    Dec 25, 2017 at 13:12
12

Before anything, make a backup of the original .VHDX, just in case.

You said you have Windows 7. In that case, you can easily convert VHDX to VHD with PowerShell.

Go to "Run..." (Windows + R) and type Powershell.

Then, in the PowerShell command line, type the command PS C:\> Convert-VHD –Path YOUR VHDX PATH –DestinationPath YOUR DESTINATION PATH

It should be converted then.

You can find additional information about the Convert-VHD command here.

6
  • 2
    Ok, I give it a try. But it says >> Applies To: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2
    – Bjorn
    May 10, 2014 at 16:01
  • @Bjorn - Powershell 4 will work on Windows 7.
    – Ramhound
    May 10, 2014 at 16:03
  • 10
    this is a cmdlet which only works in Win8/Server 2012 when Hyper-V is activated. May 10, 2014 at 17:50
  • 1
    Hyper-V is not available in Home editions. Sep 27, 2014 at 18:58
  • 1
    Even after upgrading to PowerShell 4.0 I just get The term 'Convert-VHD' is not recognized as the name of a cmdlet, function, script file, or operable program. on Windows 7
    – James EJ
    Mar 15, 2016 at 13:55
5

To convert vhdx to vhd use the free StarWind V2V Image Converter

1
  • Just tried it, only works on Win8 or above.
    – Simon Hova
    Mar 23, 2016 at 5:29
5

I made the same mistake, when creating the Virtual disk from the physical with Disk2VHD, there is a check box at the top right (second down) that is ticked by default to create a vhdx, Remove this check and it will create a vhd instead.

1

I managed to extract files from a Windows 10 VMDH "Windows Image Backup" and to write them to a Windows 7 machine: I installed Windows Server 2012 (free 180 days evaluation) in a virtual machine and connected it to my local hard disk via a network share. This way I could "mount" the VMDH backup and write the important files back to my local drive.

0
  1. Open CMD as Admin, and type the following command to switch to VirtualBox folder:
cd "C:\Program Files\Oracle\VirtualBox"
  1. Then type this command to convert from VHDX to VHD:
VBoxManage convertfromraw "C:\Full-Path-To\image.VHDX" "C:\Full-Path-To\new-image.VHD" --format VHD

After that, I would prefer giving the result VHD image a new UUID by using this command:

VBoxManage internalcommands sethduuid "C:\Full-Path-To\new-image.VHD"

Extra step I usually do when converting/cloning images in VirtualBox as it tends to show many errors when it finds 2 images with the same UUID. Unlike Hyper-V doesn't care for that.

Note: These commands mentioned above are case sensitive! (convertfromraw - internalcommands - sethduuid)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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