How to Convert a VMWare VMDK to Hyper-V VHD

A customer, who is a VMWare shop, gave me a VMDK file of one of their VMs for development purposes. I don’t have VMWare, but I do have Hyper-V on my dev boxes, so I needed to convert the VMDK virtual disk to a format I could connect to a Hyper-V VM.

Microsoft offers a VMWare VM conversion kit: https://www.microsoft.com/en-us/download/details.aspx?id=42497

The link above has a System Requirements section, please ensure your environment meets them before using the kit.

The kit has several pieces to help you convert a VMWare disk to a Hyper-V (or an Azure IaaS) VM compatible VHD format. There is a nice GUI wizard that will connect to the VMWare host, connect to a Hyper-V host, and convert the machine right across live.

In my case though, I just had the VMDK given to me by the customer. For this type of task, the kit has a whole set of PowerShell commands in a module. To get access to the commands in a PowerShell session, you need to import the module that defines them. Assuming the default kit install directory, you can use this command to import the module from a PowerShell command prompt:

Import-Module 'C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1'

With the module imported, several PowerShell commands are made available to perform all kinds of conversion tasks. I used the below command to convert the VMWare VMDK files to VHD. Note that you’ll need to use your own directories and file names for the –SourceLiteralPath and –Destination arguments.

ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath d:\scratch\vmx\VM-disk1.vmdk -VhdType DynamicHardDisk -VhdFormat vhdx -destination c:\vm-disk1

Something to keep in your back pocket should you ever hit this situation.
I have also heard good reports about this tool from Starwind

Comments

  • Anonymous
    August 15, 2015
    wow, thank's for that! That's i was looking for... very cool

  • Anonymous
    August 26, 2015
    Thanks for this. It is exactly what I needed.

  • Anonymous
    September 09, 2015
    I had an old vmdk from VMware Server 2.0 that needed to be rescued, no budget to upgrade VMware, but available Hyper-V slots on a Windows 2008 R2 server. This Powershell call appears to be handling the conversion. Thanks!

  • Anonymous
    September 19, 2015
    Thanks for this.  Had all but given up on getting an Esxi working with my old hardware, but HyperV likes my network cards just fine.  Now I can run the VM on it too.

  • Anonymous
    October 04, 2015
    The comment has been removed

  • Anonymous
    October 06, 2015
    Super cool and very easy guide to follow for success. Just what i needed and I found that the -vhdtype actually could be vhd and not only vhdx which is not supported if using Azure. Thx.

  • Anonymous
    November 04, 2015
    Lots of time saved.

  • Anonymous
    November 12, 2015
    The comment has been removed

    • Anonymous
      April 06, 2016
      I was getting the "... is not a supported disk database entry for the descriptor" errors too. I found that this conversion tool would only successfully convert fixed VMDK disks but not dynamically expanding ones.
    • Anonymous
      July 22, 2016
      I had a similar issue but was able to solve it by modifying the descriptor. See http://stackoverflow.com/a/37482233/463041
  • Anonymous
    November 12, 2015
    Michael, I had the same issue, but then realized that there were two vmdk files, one tiny and one huge. Pointing to the tiny one worked. Counter-intuitive, but true...

  • Anonymous
    November 12, 2015
    Oh and Tim, thanks for the post, it saved me hours!

  • Anonymous
    November 25, 2015
    thanks a lot, this is exactly what i was looking for.

  • Anonymous
    December 20, 2015
    Thank you sir!

  • Anonymous
    January 01, 2016
    The comment has been removed

  • Anonymous
    January 18, 2016
    The comment has been removed

    • Anonymous
      November 02, 2016
      You are using powershell 2.0
  • Anonymous
    February 03, 2016
    Or you could just use this FREE simple V2V tool from Starwind: www.starwindsoftware.com/converter Hasn't failed me yet.

    • Anonymous
      June 08, 2016
      I didn't see that the MS tool cost anything other than FREE
  • Anonymous
    February 22, 2016
    The comment has been removed

  • Anonymous
    May 16, 2016
    Thanks. This was exactly what I was looking for. And straight to the point.

  • Anonymous
    July 07, 2016
    Thanks Tim! This has saved me hours of time!

  • Anonymous
    July 27, 2016
    just starting to use the instruction attached and found after some digging that you need powershell v3 or yourll get a error about root module when trying to import.

  • Anonymous
    August 07, 2016
    You are the real mvp.

  • Anonymous
    October 08, 2016
    Thank you. Worked for me :-)