Migrate from VMware VMs to Hyper-V Windows 8

In a previous post I described how to setup Hyper-V on your Windows 8 desktop. If you decided to install Hyper-V on your Windows 8 desktop, but you have VMware VMs you want to run on this same machine, you’ll be unable to import VMDK files into Hyper-V and you’ll also be unable to install VMware Workstation on this same computer. You’ll get this error:

image

If you had System Center Virtual Machine Manager, we could convert this file with that. But what if you don’t have that? What if you have a bunch of VMware VMs you want to convert to Hyper-V that you have customized and don’t want to rebuild from scratch? Don’t worry, we can get your VMware VMs into Hyper-V.

*Very Important – This process will not work on compressed files. Make sure that the VMDK you are working with is NOT compressed. Right click on the VMDK file > Properties, then click the Advanced button. Make sure that “Compress contents to save disk space” is NOT checked. If it is, uncheck this and wait for this to finish before proceeding. Further, it is important to remind everyone that you should always backup any data to another source before modifying or making these types of changes as a safeguard.

Here is what we will need to do:

– You need to convert your VMDK file(s) to a VHD
– Then convert the VHD file to VHDX.

There will be two scenarios for your VMDK file(s):

– Your VMDK is one single file
– Your VMDK was split into multiple files

In order to proceed with converting your VMDK to VHD format, we need to have your VMDK as one single file. If it is already in a single file, head on down to Convert VMDK to VHD further below.

If your VMDK is in multiple files we will need to convert it to one single file first. Head over to VMware’s site and download the VMware vSphere 5.0 Virtual Disk Development Kit. We need the vmware-vdiskmanager.

https://my.vmware.com/group/vmware/details?dlg=vddk50&baseCode=dHRAYnQlKnBiZHAlZA==

Once downloaded and installed, you will need access vmware-vdiskmanager utility which will be in this folder: C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin

Launch a command prompt as an Administrator. Navigate to the directory where where vmware-vdiskmanager executable is, then we’ll begin the conversion process to a single VMDK.

Here is the format:

vmware-vdiskmanager.exe /r “PATH TO SOURCE” –t 0 “PATH TO DESTINATION” in my example it looks like this:

vmware-vdiskmanager.exe /r “D:\VM\VMWare\Windows\TEST-SCCM01\TEST-SCCM01.vmdk” -t 0 “D:\VM\VMWare\Windows\TEST-SCCM01\TEST-SCCM01-SINGLE.vmdk”

image

The conversion process should begin immediately. Once finished, we’ll convert your VMDK in a single file now, to a VHD.

Convert VMDK to VHD

You need to download a VMDK to VHD converter named 2Tware Convert VHD 1.0.3. I picked this up on CNET. Install the software, run it, and enter the source and destination in these fields:

*Note – I have used Vmdk2Vhd in the past; however, I have ran into errors with the application saying the VMDK is invalid. The utility below, has worked on every try thus far for me.

image

Once that is done you should have the VHD file that you need now. Let’s get this working in Hyper-V.

Launch the Hyper-V console, instead of importing a virtual machine, we are going to create a new virtual machine and use an existing disk. Import function only works for Hyper-V VM configuration files.

Select New > Virtual Machine. Enter the name of the VM and place the virtual machine in the same directory as your VHD (you don’t HAVE to do that, but it is my recommendation to keep things clean).

image

Set memory as you would like, select your Network Connection, then on the Connect Virtual Hard Disk, “select Use and existing virtual hard disk” and point to your VHD file:

image

Finish out the wizard, then you will see your VM in the list of Hyper-V machines. Connect to the console of your server and power it on. We want to make sure it boots correctly, before upgrading it to a VHDX file.

Success!!!

image

Now, power off the VM. Once the VM is down, then select Edit Disk…

image

Then browse to the source VHD file:

image

Then select Convert:

image

Then select VHDX:

image

Then I recommend using Dynamically Expanding, then set the destination of the VHDX, and Finish the wizard.

image

It will being Editing the virtual disk…

image

This conversion will take some time to complete, depending on the size of your VHD file. This progress bar will close when completed and will not tell you its done. However, you can confirm by checking the directory you set in the conversion process, and you’ll see it worked.

Now edit your VM and change the VHD path by simply adding an “x” to the end of the Virtual hard disk path, click Apply and OK. Then Power On your VM.

image

Success again!!!

image

Now all that remains is to install Hyper-V Guest Additions and uninstall VMware tools. I’m guessing if you’ve been following this blog to this point, this is probably something you can handle from here Winking smile You can also delete the old VHD file and VMDK files once you are certain this process is complete and there are no outstanding issues.

We have successfully converted our VMware ESXi 5.0 Virtual Machine to a Windows 8 Hyper-V desktop host by:

– Converting our VMDK into a single file (as necessary)
– Converting our VMDK file to a VHD
– Converting our VHD file to a VHDX

  • Liam

    Great article! Thanx for sharing!

  • Chris

    Thanks for the awesome tutorial, I’ve been trying to figure this one out for a while.

    • Gabriel

      Thanks guys, I too spent a good while working on this. Glad my experience has been able to help others.

      • David

        Can we uninstall the vmware tools prior to convert to vhd?

        • Gabriel

          Hi David, that should be fine as the vm conversion happens when the VM is offline, so it really shouldn’t matter. Let me know if this does give you any issue.

  • Pingback: Lesezeichen vom 27.01.2013 | Doc-T @ BlackRealm()

  • ferd berple

    If your converted machine will not boot – you get a black screen with cursor frozen at the top left – do this:

    – boot VM into CMD prompt using windows recovery CD
    – from CMD prompt run:
    – bootrec /fixmbr
    – bootrec /fixboot
    – restart VM it should now boot correctly

    This problem happens mostly on win 7 machines

  • Great article and something I’ve been wanting to do with all my vm’s. Especially now that I need to install the wp8 sdk which uses a hyper v emulator. Does this also take into account your scsi disks in VMware needing to be converted to IDE?

    • Gabriel

      Hi Netbob, unfortunately I’ve not tested this scenario so I am unsure of the result. Thanks for reading, hopefully you’ve been able to get this to work. Take a backup and give it a shot, let me know if you were successful?


      Gabe

  • Pingback: Migrate from VMware VMs to Hyper-V Windows 8 | ObondO Labs()

  • Pingback: Convert VMware virtual hard disk to Hyper-V by Microsoft tool |()

  • rob

    Gabe, great tutorial! I found the MS tool to migrate VM’s does not work with Server 2012 R2. This was the only method that worked for me. I even tried the 5nines tool… that tool did the copy to my hyper-v box but during conversion it did not complete, just hanged.

  • Chris Mills

    Thanks Gabe, Very clear process, worked first time.

    • Gabe

      Excellent Chris! Glad this was able to help you out, thanks for the feedback.


      Gabe

  • Tosin

    I was getting an error while converting that the VM need repair. Incase some one having the same issue it can be resolved by running VMware-vdiskmanager.exe -R “vmname.vmdk” Replace the “vmname.vmdk” with the name of your original vm that needs to be repaired,
    Awesome tutorial Gabe

  • Tosin

    Awesome Helped fixed my Windows 2008 DC on the Lab

  • Darrell Tunnell

    Thanks, this is still useful today, 2 years after it was originally written :)

    • Very happy to read comments like this! Hope I was able to make this process easier for you and others. Cheers.

  • Chip Towle

    Yes. I agree with Darrell. Still works. For what it is worth 2Tware didn’t work for me and I had to use the VMDK2VHD program. Great details and very helpful.