I believe in Hyper-V!

Convert single .VMDK to .VHDX with Microsoft Virtual Machine Converter 2.0 (MVMC)

Hi there,

In the last couple of weeks I was on a vacation and can tell you this vacation was the best in the last ten years :) Now I’m ready for the new challenges!

In this blog post I would like to show how to convert single VMware virtual disk (.VMDK) to Hyper-V (.VHDX) with free tool, Microsoft Virtual Machine Converter 2.0 (MVMC) which you can download from here. Few months ago I wrote blog post on similar topic, but this is a new version of MVMC with lots of new features.

What is Microsoft Virtual Machine Converter (MVMC)?
Microsoft® Virtual Machine Converter (MVMC) is a Microsoft-supported, stand-alone solution for the information technology (IT) pro or solution provider who want to convert virtual machines and disks from VMware hosts to Hyper-V® hosts and Windows Azure™.
New Features in MVMC 2.0
MVMC 2.0 release of MVMC includes the following new features:

  • Converts virtual disks that are attached to a VMware virtual machine to virtual hard disks (VHDs) that can be uploaded to Windows Azure.
  • Provides native Windows PowerShell capability that enables scripting and integration into IT automation workflows.
    Note The command-line interface (CLI) in MVMC 1.0 has been replaced by Windows PowerShell in MVMC 2.0.
  • Supports conversion and provisioning of Linux-based guest operating systems from VMware hosts to Hyper-V hosts.
  • Supports conversion of offline virtual machines.
  • Supports the new virtual hard disk format (VHDX) when converting and provisioning in Hyper-V in Windows Server® 2012 R2 and Windows Server 2012.
  • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.1, and VMware vSphere 4.1 hosts Hyper-V virtual machines.
  • Supports Windows Server® 2012 R2, Windows Server® 2012, and Windows® 8 as guest operating systems that you can select for conversion.

6

As you noticed, with Microsoft Virtual Machine Converter we can convert / migrate to Azure and to Hyper-V but only based VMs only if have vCenter server or ESXi server, but what if I have VMware Workstation based VMs.. cannot convert with MVMC. On that way can convert only .vmdk to .vhdx and then create new Hyper-V VM with converted virtual disk.
So, how to do it?

With PowerShell, of course :) In the previous version of MVMC we could do with CLI.

I know, I know… most of you will tell me; you have lots of free tools for conversion but I want use only Microsoft tools! ;)

Here is short explanation how to…

Install MVMC 2.0 (2.1 ;) ), open PowerShell as administrator and write
get-command -Module mvmccmdlet

Here you can see MVMC modules
1

If you don’t see modules, need to create user profile and to import modules

Create user profile

PS C:\Windows\system32> $env:psmodulepath -split ';'
C:\Users\rm\Documents\WindowsPowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PS C:\Windows\system32> $profile
C:\Users\rm\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
PS C:\Windows\system32>

Now we can convert .vmdk to .vhdx through PowerShell. Open PowerShell as administrator and…

ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath “D:\VMwareConvert\Windows8x64VMware\Windows8x64
.vmdk” -DestinationLiteralPath “D:\VMwareConvert\Windows8x64Hyper-V” -VhdType DynamicHardDisk -VhdFormat Vhdx

3

For a 17GB virtual drive I needed 6 minutes on SSD

4

At the end we can create Hyper-V virtual machine with converted virtual disk.

5

I’d like to thanks my great friend Aleksandar “The PowerShell Guru” Nikolic for the big help.

Also, I must mention a new book “System Center 2012 R2 Virtual Machine Manager Cookbook – Second Edition” from my Hyper-V MVP fellow Alessandro Cardoso.

Hope to see you soon ;)

Cheers,

Romeo

23 Responses to “Convert single .VMDK to .VHDX with Microsoft Virtual Machine Converter 2.0 (MVMC)

  1. Adrian P

    MVMC 3.0 is what’s available now. I’m not getting those commands list. I followed the Create User profile instructions, but I don’t see “C:\Program Files\WindowsPowerShell\Modules” and also it didn’t work anyways.

    • Mita

      I had the same problem as You with MVMC 3.1 and installing MVMC cmdlet solved it:
      Import-Module “C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1”

      After this conversion finished successfully.

  2. Colin

    Where can we download Microsoft Virtual Machine Converter 2.0 from now..?, everywhere points you to v3..

    Any help would be much appreciated…

  3. r1ch35

    Hi Romeo, odd request, but do you happen to have the mvmc_setup.exe for MVMC 2.1 available yet? Microsoft has removed it from their download site and I’m unable to locate it.

    We’ve run into an issue with MVMC 3.0 where it cannot convert VMware to Hyper-V VM’s with more than 1 disk (most of ours). Appears to be some sort of bug.

    Thanks in advance,

  4. Sanjay

    Great tutorial. worked very well

  5. r1ch35

    Hi Romeo, did you have any luck in finding MVMC 2.1 install? Much appreciated.

  6. u10arne

    Hi there, I converted the vmdk file to vhdx but now the Hyper V VM does not boot… Any solution?

  7. Tim J

    Can you comment on MVMC 3.0’s compatibility with ESXi 6.0?

  8. Robert T

    I have used this command line in PowerShell and the problem I have come across is a 6.8gb VMDK file was converting however at approximately 2.88gb of creation the process seems to have stalled. I have been waiting for about 15-20 minutes and it hasn’t progressed. Also the PowerShell line is still at the blinking cursor “_” under the command I ran.. so it looks like it is still going however nothing seems to be happening. Any suggestions? Thanks!

  9. sha

    Hi,

    Romeo,

    I am trying to convert mac osx vmdk to vhdx,
    am getting following error, pls suggest.

    Regards,
    Sha
    —————————————————————

    PS C:\windows\system32> ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath “C:\sw\OS X 10.10 Yosemite Image – Copy\OSXYose
    mite.vmdk” -DestinationLiteralPath “C:\Yosmite” -VhdType DynamicHardDisk -VhdFormat Vhdx
    ConvertTo-MvmcVirtualHardDisk : The entry b7305c4a-25b7-4e6a-975f-4b028f7330d5 is not a supported disk database entry
    for the descriptor.
    At line:1 char:1
    + ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath “C:\sw\OS X 10.10 Yosemite Imag …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : WriteError: (Microsoft.Accel…nversionService:DriveConversionService) [ConvertTo-MvmcVi
    rtualHardDisk], VmdkDescriptorParseException
    + FullyQualifiedErrorId : DiskConversion,Microsoft.Accelerators.Mvmc.Cmdlet.Commands.ConvertToMvmcVirtualHardDiskC
    ommand

    ConvertTo-MvmcVirtualHardDisk : One or more errors occurred.
    At line:1 char:1
    + ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath “C:\sw\OS X 10.10 Yosemite Imag …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : WriteError: (Microsoft.Accel…nversionService:DriveConversionService) [ConvertTo-MvmcVi
    rtualHardDisk], AggregateException
    + FullyQualifiedErrorId : DiskConversion,Microsoft.Accelerators.Mvmc.Cmdlet.Commands.ConvertToMvmcVirtualHardDiskC
    ommand

    • Antonio Herrera

      Can you solve your problem? I have the same problem, but I don’t find any solution, thank you in advance

  10. Mark

    Note that if you have Windows Server 2012 R2 installed, you need to install the feature .NET Framwork 3.5 Features first, else the Powershell commands even in MVMC 3.0 will not work.

  11. Mario Nikic

    Very nice post. I just stumbled upon your blog and wished to say that I’ve really enjoyed browsing your blog posts.
    After all I’ll be subscribing to your rss feed and I hope you write again soon!

Leave a Reply

Your email address will not be published. Required fields are marked *