How to convert OVA to VHDX for Hyper-V

If you have found yourself in a scenario where you would like to use Hyper-V as a test environment for your virtual machines, but you are using VMware ESXi Server,Citrix XenServer or VirtualBox then this tutorial is for you.

Required software

  • Microsoft Virtual Machine Converter 3.0 available here.
  • WinRar (or any tool you prefer to extract .tar files)
  • Your OVA export unzipped into a folder.

Preparations

  • Download and install Microsoft Virtual Machine Converter 3.0.

An OVA file is simply a tar archive file containing the OVF directory. First you rename the .ova file to a .tar extension. Now you can use WinRAR and extract the .vmdk files within to get the virtual machines disks. VMDK is an open format used by VMware and other vendors.

Convert The Image

Next we will need to convert our VMware Image in order for Hyper-V to run it. This can be done using Powershell:

# First import the Microsoft Converter Powershell Module
Import-Module "C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1"
# Step 2, let's convert the VMware .vmdk to a Hyper-V .vhdx
ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath "C:\<folder>CentOs.vmdk" -DestinationLiteralPath "C:\<folder>CentOs8.vhdx" -VhdType DynamicHardDisk -VhdFormat Vhdx

Copy you .VHDX to the folder containing you Hyper-V virtual machine.  When creating your new virtual machine, you must ensure you select “Generation 1” when choosing the generation of the virtual machine :

3 Comments

  1. Works really good, thanks! Can make my work much more easy.

    1. Author

      Thank you Jarno 🙂

Leave a Reply to osssmanCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.