Issues Converting VHDX to VHD or VMDK to VHD

Niket Kumar Singh 365 Reputation points
2024-07-23T19:39:55.78+00:00

Hello,

I'm having trouble converting VHDX files to VHD files and also VMDK files to VHD files. Here's a detailed breakdown of my situation:

  1. VHDX to VHD Conversion:
  • I have a VHDX file located at C:\Users\azureadmin\Downloads\vhdx\Virtual Hard Disks\demovhdx.vhdx.
  • I need to convert this VHDX file to a VHD file.
    • I have tried using the Convert-VHD PowerShell cmdlet with the following command:
           Convert-VHD -Path "C:\Users\azureadmin\Downloads\vhdx\Virtual Hard Disks\demovhdx.vhdx" -DestinationPath "C:\Users\azureadmin\Downloads\vhdx\Virtual Hard Disks\demovhd.vhd" -VHDType Fixed
      
      • The conversion completes successfully, but the resulting VHD does not boot in Hyper-V.
  1. VMDK to VHD Conversion:
  • I have a VMDK file located at C:\Users\azureadmin\Downloads\demo.vmdk.
  • I need to convert this VMDK file to a VHD file.
    • I tried using qemu-img for this conversion with the following command:
           
           qemu-img convert -f vmdk "C:\Users\azureadmin\Downloads\demo.vmdk" -O vpc "C:\Users\azureadmin\Downloads\demovhd.vhd"
      
      • The conversion completes, but again, the resulting VHD does not boot in Hyper-V.

Troubleshooting Steps Taken:

  • Ensured that the VHD files are uncompressed and unencrypted.
  • Verified the boot order in Hyper-V settings.
  • Attached the VHD to a recovery VM and ran boot repair commands (bootrec /fixmbr, bootrec /fixboot, bootrec /scanos, bootrec /rebuildbcd).

Tools Considered:

  • StarWind V2V Converter: I have considered using this tool but would like confirmation if this is the best approach or if there are better alternatives.

I would appreciate any guidance or suggestions on how to successfully convert and boot these VHD files in Hyper-V.

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,055 questions
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,706 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,522 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Xue 36,751 Reputation points Microsoft Vendor
    2024-07-24T02:43:11.78+00:00

    Hi,

    Please try converting the virtual disk files in Hyper-V Manager.

    1. Open Hyper-V Manager as administrator.
    2. Select "Edit Disk..." from the Actions pane.
    3. Browse to the VHDX file you want to convert and select Convert.
    4. Choose the VHD format for the converted virtual hard disk and set the disk type to fixed size.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.