If you are running virtual machines on both VMware ESXi/Workstation and Microsoft Hyper-V, in some cases you may need to convert a VMware virtual machine to Hyper-V format. You can use different V2V migration tools for this. However, it is much faster to simply convert the VMware virtual machine VMDK file to the VHDX format. In this article, we’ll look at several ways to convert VMDK to VHDX.
Convert VMDK to VHDX with StartWind Converter
A third-party StartWind Converter utility allows you to convert VMs from VMware ESXi to Hyper-V.
Download the StartWind Converter utility from https://www.starwindsoftware.com/starwind-v2v-converter (free registration required) and install the tool on your computer by running the startwind.exe file.
StartWind Converter allows you to remotely connect to VMware ESXi and perform an online conversion of a virtual machine and immediately import it to a Hyper-V server. To do this, select the Remote VMware ESXi Server option.
You can also convert a local VMDK file (for example, file of a VMware Workstation virtual machine) to VHDX format. To do this, select Local file > specify the source VMDK file and select destination image format VHD/VHDX (Microsoft Virtual Hard Drive).
Specify the target file.
Now you can attach the resulting VHDX disk to the Hyper-V virtual machine.
How to Convert VMDK to VHDX Disk using PowerShell?
You can use a special PowerShell module to convert VMware virtual disks (vmdk) to Hyper-V format (vhdx). Download and install the Microsoft Virtual Machine Converter module on your computer.
Open a PowerShell console as an administrator and import the MVMC module into your session:
Import-Module 'C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1'
To convert your VMDK file to VHDX format, run the command:
ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath "C:\SharedVMDK\shareddisk01.vmdk" -VhdType DynamicHardDisk -VhdFormat vhdx -destination C:\VHD
After executing the command, the shareddisk01.vhdx file will appear in the target directory. You can create a new Hyper-V virtual machine from it or add it to an existing VM.
In some cases, when converting a VMDK disk using ConvertTo-MvmcVirtualHardDisk, an error may appear:
ConvertTo-MvmcVirtualHardDisk : The entry 0000000-0000-0000-0000-00000000 is not a supported disk database entry for the descriptor.
The problem is that there was an entry in the VMDK file descriptor that Microsoft Converter could not recognize. To fix the error, you need to remove unrecognized entries from the disk image descriptor.
To do this, download the dsfok tool (https://web.archive.org/web/20190910101150/http://members.ozemail.com.au/%7Enulifetv/freezip/freeware/dsfok.zip).
Then extract the VMDK file descriptor with the command:
dsfo.exe "C:\SharedVMDK\shareddisk01.vmdk" 512 1024 "C:\SharedVMDK\ shareddisk01_descriptor.txt"
Open the shareddisk01_descriptor.txt file with Notepad++ and look for the lines that contain the entry listed in the ConvertTo-MvmcVirtualHardDisk error. In our example, we need to find lines with the entry 0000000-0000-0000-0000-00000000.
Comment out the lines with this value by adding a # sign at the beginning of the line. In this example, we commented out the lines:
# ddb.uuid.parent = "0000000-0000-0000-0000-00000000" # ddb.uuid.parentmodification = "0000000-0000-0000-0000-00000000"
Apply the new descriptor to the VMDK file:
dsfi.exe "C:\SharedVMDK\shareddisk01.vmdk" 512 1024 "C:\SharedVMDK\ shareddisk01_descriptor.txt"
Try running the ConvertTo-MvmcVirtualHardDisk command again. If the error The entry xxx is not a supported disk database entry for the descriptor appears again, you need to extract the descriptor again and comment out the lines with the problematic entries. Repeat the steps several times until ConvertTo-MvmcVirtualHardDisk completes the VMDK to VHDX conversion without errors.