Call Us Today! 1.555.555.555|info@yourdomain.com
Back to Blog

Convert VHD to VHDX using Hyper-V Manager and Powershell

TL;DR: Converting VHD to VHDX improves disk performance, supports larger storage sizes, and enhances resilience in Hyper-V environments. You can perform the conversion using Hyper-V Manager or PowerShell. This guide...
Choose your BDRShield Management Console - Cloud or On-Premise:
Hybrid Storage (Local & Cloud)30-Day Free TrialFull-Feature Access
Not sure which console fits your needs? Request Demo ?
By Rajesh Radhakrishnan | August 7, 2023

TL;DR: Converting VHD to VHDX improves disk performance, supports larger storage sizes, and enhances resilience in Hyper-V environments. You can perform the conversion using Hyper-V Manager or PowerShell. This guide walks through both methods for efficient VM storage upgrades.

VHD and VHDX are virtual hard disk formats commonly used in virtualization environments. VHD (Virtual Hard Disk) is the older format, while VHDX (Hyper-V Virtual Hard Disk) is the newer and more advanced version. In this tutorial, we will explore how to convert VHD to VHDX using Hyper-V Manager and PowerShell, enabling users to benefit from the enhanced features and performance of the VHDX format.

Windows 8 Client Hyper-V and Windows Server 2012 Hyper-V onwards VHDX is the new and default format of the virtual hard disk (VDH). Till Hyper-V 2008, everyone was using VHD format and it has many limitations and once the VHDX was available it had many enhancements and everyone started upgrading to the next server version converting their VHD to VHDX.

In this article, we will look at the step by step procedure to convert VHD to VHDX.

Advantages of VHDX

First, let’s look at some of the advantages of VHDX:

  • Scalable up to 64 TB
  • 4 KB block size and better performance
  • Protection against data corruption during power outages
  • VHDX file can be resized online
  • Better snapshot handling

Methods to Convert a VHD to VHDX

There are two methods you can use to convert a VHD into a VHDX file:

  • Using Hyper-V Manager
  • Using PowerShell

Points to be noted before conversion

  • VHDX files cannot be used on versions of Hyper-V prior to Windows 8 or 2012
  • For upgrade scenario, first, upgrade Hyper-V to VHDX supported version then convert VHD
  • Conversion is performed offline
  • Do not attempt to convert a VHD to a VHDX if any of the following are true:
    • You have created a snapshot of the virtual machine
    • You are replicating the VHD using Hyper-V Replica
    • The VHD is the parent to one or more differential virtual hard disks

Convert VHD to VHDX using Hyper-V Manager

Microsoft Hyper-V team has provided a simple way to convert existing VHDs into VHDX using Hyper-V Manager

  1. Launch Hyper-V Manager, select and right-click on the virtual machine whose disk you want to convert from VHD to VHDX. Then, choose settings
  2. vhd-vs-vhdx

  3. From Edit Virtual Hard Disk Wizard, Select the disk you want to convert and Click Next
  4. Hyper-V disk conversion

  5. Click Next from Locate Disk Page
  6. convert VHD to VHDX PowerShell

  7. Select Convert and click Next
  8. Hyper-V Manager convert disk

  9. Select the VHDX format and click Next
  10. VHDX benefits

  11. Select the type of converted disk you need, either a dynamically expanding or fixed-size VHDX file and Click Next
  12. Hyper-V storage optimization

  13. From the Configure Disk option, provide a location to save and name for new converted VHDX file, Click Next
  14. convert virtual disk Hyper-V

  15. Click Finish to start the conversion on the Summary page
  16. Hyper-V disk performance tuning

  17. Conversion will take time that is based on the size of the disk and backend storage. Once completed, open the settings of the virtual machine and replace the VHD with the VHDX. To do that, open the source VHD file, click on browse and navigate to the location newly created VHDX disk
  18. Hyper-V backup solution

  19. Select the disk and Click open
  20. VM migration Hyper-V

  21. Click Ok and Start and test the virtual machine
  22. Hyper-V backup solution

    Once the converted disk is available in the virtual machine and it works fine, you may remove the old VHD file

    Convert VHD to VHDX using PowerShell

    Another method is, we can use to convert VHD to VHDX is PowerShell and this will avoid the time-consuming wizards used by the Hyper-V manager.

    Follow below command to convert a VHD to a VHDX

    Convert-VHD –Path “Source vhd file” –DestinationPath “Destination vhdx file”

    Example:

    Convert-VHD –Path d:\VM01\Disk0.vhd –DestinationPath d:\VM01\Disk0.vhdx

    This command is very useful when you want to use a script to automate lots of VHD conversions across many virtual machines.

    Change the Disk Physical Sector Size

    As I mentioned above VHDX will support 4K blocks, after conversion default block size 512 will not change. You have to manually change that, follow below commands to check the converted disk sector size and how to modify to 4K.

    Check the Disk Sector Size

    Get-vhd “VHDX File Name with Location”

    Hyper-V disk conversion

    Set the Disk Sector Size

    set-vhd “VHDX File Name with Location” -PhysicalSectorSizeBytes 4096

    Hyper-V backup solution

    Now you have a virtual machine that is using the best kind of virtual machine storage, the VHDX format virtual hard disk.

    FAQs

    1. What is the difference between VHD and VHDX?
    VHD is the older virtual disk format with a maximum size of 2 TB, while VHDX supports up to 64 TB and offers better performance, resilience, and protection against data corruption.

    2. How do you convert VHD to VHDX in Hyper-V?
    You can convert a VHD to VHDX using Hyper-V Manager by editing the virtual disk and selecting the convert option. Alternatively, use PowerShell with the Convert-VHD cmdlet to perform the conversion.

    3. Is it safe to convert VHD to VHDX?
    Yes, it is safe if the VM is powered off and the conversion process completes successfully. It is recommended to back up the virtual disk before starting the conversion to prevent data loss.

    4. Can you convert VHD to VHDX without downtime?
    Typically, the VM must be powered off to convert the disk using standard methods. Some advanced storage migration techniques may allow minimal downtime, but they are not common in basic setups.

    5. Why should you upgrade from VHD to VHDX?
    Upgrading to VHDX provides better performance, larger disk capacity, and improved protection against corruption during power failures. It is recommended for modern Hyper-V environments.

    Related Posts

    Beginners’ Guide for Microsoft Hyper-V: VHD vs VHDX Vs AVHD/AVHDX: Overview of Virtual Disk Formats – Part 22
    Hyper-V VHDX Optimizations and Resizing
    Beginners’ Guide for Microsoft Hyper-V: How to Import OVA into Hyper-V – Part 44

    Keep your important data safe with the magic of Hyper-V backup. It’s like a powerful shield protecting your valuable information. You can try it for free!

    Want to learn more? Discover the secrets of Hyper-V backup with BDRShield and see the magic for yourself!

    Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.

    5/5 - (2 votes)
    Avatar for Rajesh Radhakrishnan

    Rajesh Radhakrishnan

    Rajesh Radhakrishnan is a guest blogger for Vembu. He has been in IT industry for over 10+ years and works as a Technical Architect in various industries like Manufacturing & Hi-Tech, Hospitality, Banking. Rajesh is the VMUG Leader of UAE. He is an avid writer and shares his knowledge at vmarena.com.

Go to Top
Chat Icon