Q
Manage Learn to apply best practices and optimize your operations.

How do I convert VMDK to VHDX using PowerShell commands?

Download and install Microsoft Virtual Machine Converter to gain access to several PowerShell commands that enable VMware VMDK to Hyper-V VHDX conversions.

The GUI wizard offered by Microsoft Virtual Machine Converter can easily perform conversions, but the tool also...

provides the necessary PowerShell cmdlets to perform VMDK to VHDX conversions from the command line.

There are several reasons you might want to convert a VMware VM to a Hyper-V VM. One of the most common reasons is if you're in the process of migrating your whole environment from VMware vSphere to Microsoft Hyper-V. Or you might have opted to use Azure cloud services and now you want to move VMware workloads to the Azure IaaS cloud.

VMware VMs aren't supported by Azure, so you must convert VMDK to VHDX files. Follow the steps below to convert them.

Step 1: Download Microsoft Virtual Machine Converter (MVMC) 3.0, then install it.

Step 2: Open a PowerShell window and change the directory to C:\Program Files\Microsoft Virtual Machine Converter. Next, import the PowerShell module that ships with MVMC by executing the command below:

Import-Module MvmcCmdlet.Psd1

Once you import the module, you have several PowerShell cmdlets that can perform all kinds of conversions, including changing the generation of the converted VMDK files.

VMware VMs aren't supported by Azure, so you must convert VMDK to VHDX files.

Step 3: Now that you have imported the MVMC PowerShell module, execute the ConvertTo-MvmcVirtualHardDisk PowerShell cmdlet.

Let's assume you have a VMDK file that needs to be converted to be usable with Hyper-V, and the VMDK resides in C:\Temp\VMX folder. To convert the VMDK to VHDX, use the PowerShell command below:

ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath C:\Temp\VMX\OSDisk.VMDK -VHDType DynamicHardDisk -VHDFormat VHDX -Destination C:\Temp\VHDX\OSDisk

As you can see, you're telling the command that the VMDK file needs to be converted to VHDX by adding the -VHDFormat parameter. The resulting file is saved under C:\Temp\VHDX as OSDisk.VHDX. There is no need to add the .VHDX extension after the new file name.

VM conversion might fail due to several issues. MVMC generates a log file by the name of MVMC.LOG that is available under the C:\Temp folder. If the conversion fails, open the log file and look for error or warning strings.

This was last published in May 2018

Dig Deeper on P2V, V2V and V2P migration

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation

1 comment

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

What are your best practices for troubleshooting failed VMDK to VHDX conversions?
Cancel

-ADS BY GOOGLE

SearchVMware

SearchWindowsServer

SearchCloudComputing

SearchVirtualDesktop

SearchDataCenter

Close