How to convert a virtual hard disk file (VHDX to VHD)

Hard Disk

If you have the Hyper-V role installed you can convert a virtual hard disk file using PowerShell or the GUI.

Why would you do this?

  1. You are moving to a new server which requires the old format
  2. You use software to read / write / mount files and it only has VHD support. For example, VirtualBox, supports read only VHDX files.

It’s important to note that while VHDX files are superior to VHD files, VHDX files are not compatible with Windows Server 2008. Additionally, Generation virtual machines can use VHD or VHDX files but Generation 2 virtual machines can only use VHDX files.

Compatibility: VHD files are supported by Windows Server 2008 and Windows Server 2012. VHDX format is supported by Windows Server 2012 only.

Capacity: The storage limit for VHD files is restricted to 2TB; but with the new VHDX format, it is 64TB.

Logical Sectors: The new VHDX format supports 4K logical sector size which is nice performance boost.

Data Protection: VHDX files provide protection against file corruption from any other forms of unexpected IO failure (by tracking metadata).

Resizing: Live resizing is possible for VHDX files, whereas it is not possible for VHD files.

Convert a VHD / VHDX file using the Hyper-V Manager

  1. Right click on the virtual machine and select “Settings”.
  2. Select the hard drive.
  3. Click edit and select “Convert” from the “Choose Action” section of the wizard.
Hyper-V Manager convert VHD / VHDX files
Hyper-V Manager convert VHD / VHDX files

Convert a VHD / VHDX file using PowerShell

The Convert-VHD  cmdlet converts a virtual hard disk file by copying the data from a source virtual hard disk file to a new virtual hard disk file of a specified format and version type. The format is determined by the file name extension of the specified files, either .vhdx or .vhd. Conversion is an offline operation.

Run the following from an elevated PowerShell prompt:

Convert-VHD -Path C:\Hyper_V\MyDataFile.vhd -DestinationPath C:\Hyper_V\MyDataFileVHDX.vhdx


You May Also Like