How to Convert VHD to VHDX Format In Hyper-V or PowerShell?

In recent times, with the deliverance of Windows Server 2012, many Virtualization developments occurred. Amongst these, one major improvement was the joining of the VHDX file format. It is very necessary to note that Windows Server 2012 supports the new file format, and at the same time allows Hyper-V admins to make the proper usage of the old VHD format. So on this technical page, we will be going to know the reasons and easy methods to convert VHD to VHDX in Hyper-V.

How do a VHD format and a VHDX format differ?

In common, a virtual machine is a nonrepresentational computer. In this case, the items that involved a real computer’s hard drive(s) are minor files, and for Hyper-V, these files are in the VHD/VHDX format. Now, if we try to make a correlation between VHD and VHDX, these are some major variations:

  • Adaptability: VHD is supported by the 2008 and 2012 versions of Windows Server. However, VHDX is supported by Windows Server 2012 only.
  • Storage Capacity: With the old VHD file format, the storage limit is restricted to 2TB; but with the new VHDX format, it is 64TB.
  • Coherent Sectors: The new VHDX format supports 4K logical sector size which is a nice performance boost.
  • Data Protection: What is more special about the new VHDX format is the security it provides against file corruption from any other forms of sudden IO failure (by tracking metadata).
  • File resizing: Live resizing is achievable for VHDX files, whereas it is not possible for VHD files.

Now let’s have a look at diverse storage types with VHDX. Hyper-V lets you create two primary hard disk storage types – fixed and dynamic. The excellent features of dynamic size are essential for minimum primary space. And the size grows proportionately as one uses the space. On the other hand with the fixed storage type, the size of your storage is fixed. In terms of performance, fixed storage is effectively differentiated from the dynamic one.

Need to convert VHD to VHDX in Hyper-V

A person must Keep in mind that this new VHDX format cannot be used with Microsoft Server 2008/2008R2 and hence in a matter, you are planning to place your virtual machine on a Microsoft Server 2008/2008R2 Hyper-V then make assured you keep your files in a VHD format. Windows Server 2012 users are advised to upgrade VHD files to VHDX in order to make the best utilization of the advantages of the new format. One can transform VHD to VHDX format from Hyper-V – V Manager (Windows Server 2012) using the Edit Virtual Hard Disk Wizard (Actions > Edit Disk).

 More reasons to migrate from VHD to VHDX format:

  • VHDX is compatible with virtual hard disks larger than 2TB and up to 64 TB.
  • VHDX gives more high-grade performance of dynamic and different files through new larger block sizes.
  • Virtual VHDX is an enhanced alignment of the virtual hard disk on large sector disks.

Convert VHD to VHDX Using Hyper-V Manager

Several users already have a virtual foundation based on Microsoft Hyper-V and would need to update all their existing VHDs to take benefit of all the new features and capabilities. Luckily, The Hyper-V team has taken that into the study and implemented a very simple way to convert VHD into VHDX in hyper-v. Here’s how to do it:

  1. Start Hyper-V manager and from the right side Action panel select Edit Disk.
  2. In the Hyper-V Manager, click on Edit Disk from the right-side Actions menu.
  3. Browse to locate the VHD file you want to convert.
  • Select Convert and click Next.
  • Choose the VHDX file format and click Next.
    Select the disk type: Fixed Size or Dynamically Expanding.
  • Choose the destination folder and complete the wizard.

Convert VHD to VHDX Using PowerShell

  1. Open PowerShell as Administrator: Press Win + X and select Windows PowerShell (Admin).
  2. Run the Conversion Command: Use the Convert-VHD cmdlet to convert the file.
    Syntax:
    powershellCopyEditConvert-VHD -Path "C:\Path\to\source.vhd" -DestinationPath "C:\Path\to\destination.vhdx" -VHDType <Fixed | Dynamic>
    Example:
    powershellCopyEditConvert-VHD -Path "C:\VMs\mydisk.vhd" -DestinationPath "C:\VMs\mydisk.vhdx" -VHDType Dynamic
    Replace “C:\Path\to\source.vhd” and “C:\Path\to\destination.vhdx” with the actual file paths.
    Use Dynamic or Fixed for the -VHDType parameter.
  3. Verify the Conversion: After completion, verify the newly created VHDX file.

How to Convert A Damaged or Corrupt VHD files into VHDX?

This is the situation where the user generally gets confused, sometimes the VHD file gets infected or prone to corruption due to certain reasons. So here you can extract the VHD data from the corrupt VHD file and save it to your computer. And for doing this I recommend using VHD File Recovery Software. This standalone tool is able to repair and restore VHD data from damaged VHD files. It is designed with a user-friendly GUI which allows both technical and non-technical users to access the tool with ease. Download the free demo version to evaluate the VHD recovery software.

Download Now

Learn how to use VHD File Recovery Tool here.

Final Verdict

This VHD conversion method makes an exact copy of your existing VHD file, except now it’s in the new VHDX format. Should the need arise, you can always use the identical process to convert from VHDX back to VHD. But if the VHD file is not well then no need to worry as you can repair the VHD files before performing the process to convert VHD to VHDX in Hyper-V. 

Leave a Reply

Your email address will not be published. Required fields are marked *