Convert a Hyper-V 2012’s vhdx to VMware’s vmdk

I have been searching for ways to convert a Hyper-V VM to VMware. I have not having good luck with this. We (at work) are not trying to migrate from Hyper-V to VMware… it is just that sometimes we have to send out one of our virtual servers to another datacenter who run VMware there.

Of course, there is a simple way to install a client and do a P2V kind of conversion which spits out a VMDK created out of a running VM. I was not interested in that type of conversion. I had a VHDX, lets just convert it to VMDK!

Here is what I have tried and does NOT work:

  • Using Hyper-V OVF export tool.

I blogged about it here.

  • Using VMware Converter standalone 5.1

It does not recognize .vhdx or .vhd files.

Here is what people in the ‘net are saying:

  • Use WinImage

A software called WinImage is reported to work but it is not free. It does have a 30 day trial.

  • Use XenConvert

I tried using XenConvert to convert the VHD to OVF. Then I tried to import it into VMware using the vSphere client. Alas, that did not work, the importer failed saying “Could not parse the document: ‘encoding specified in XML declaration is incorrect’. I guess the OVF XenConvert spat out is not compatible with VMware.

  • Use StarWind V2V Converter

I found people recommending StarWind V2V Converter. It is free, but does require (free) registration.

My approach to this conversion problem {this really works!}:

I downloaded StarWind V2V Converter. After installing it (yes, it needs to be installed), I used it to convert a VHD to VMDK. I chose the option IDE when it prompted me to choose what kind of disk do you want in the VMDK.

After the conversion finished, I created a new VM in vSphere with no hard disk. Then I uploaded the VMDK file to the datastore of the vSphere server. I added that vmdk to the settings of the VM. The VM booted up just fine. Just needed to add VMware tools and configure the IP address etc.

So the last option worked fine for me. To reiterate the steps I took to convert a .vhdx VM file on Hyper-V to a .vmdk file on VMware:

  1. Using VMM stop they Hyper-V VM
  2. Make a copy of the .vhdx file locally on the Hyper-V server
  3. Use Hyper-V manager to convert that .vhdx to vhd.
  4. Copy that .vhd to your workstation’s local HDD (or where ever you have StarWind converter installed.
  5. Use the StarWind converter to convert that .vhd to .vmdk. Make sure you choose the correct “Image Format”. For ESX server hosts (including free ones) the correct one is VMware ESX server image. The other ones do NOT work for ESX. I found that out the hard way, hoping to create a thin provisioned image.
  6. Using vCenter client, create a blank VM
  7. Upload that .vmdk to the datastore
  8. Link that vmdk to the VM
  9. Boot that VM
  10. Configure VM
  11. Enjoy!

Tip: if there is not enough space on the Hyper-V server itself to hold the converted vhd, you can use PowerShell cmdlet “Convert-VHD) to send the vhd to a UNC path. I have tried it and it works fine. In my case both the source and destination were on UNC paths and the conversion still worked fine. Note that you will have to run the cmdlet from the Hyper-V server itself OR any other workstation which has the Hyper-V 2012 role installed. I did not have any workstation which had Windows 8 + Hyper-V so I ran the cmdlet directly on one of my Hyper-V 2012 hosts (which have  no GUI installed). Worked like a charm Smile

Be Sociable, Share!
This entry was posted in Uncategorized by Rajeev. Bookmark the permalink.

14 thoughts on “Convert a Hyper-V 2012’s vhdx to VMware’s vmdk

  1. Hi, perhaps you can help me.
    I converted my vhdx to vhd and then to vmdk using your steps.
    Then i created a machine on vmware by selecting to install OS later.
    I chose to use a single file and then replaced the default vmdk file created when i created the machine with the one i converted.
    This was on a folder where othe files existed with different extension:
    vmxf, vmsd, nvram, log…
    then i started the machine but after a couple seconds of the windows logo it crashes showing a BSOD.

    thanks.

    • I think you may need to change the virtual hard disk settings inside VMware. I suspect that when the vHDD was used in Hyper-V it was configured as an IDE. When you put it in VMware it may need to ne configured as an IDE again (instead of a SCSI). Or it could be the other way around as well….so check the settings of the vHDD.

      Also , many times the BSOD tells you what went wrong. Look at the top left, there would be an error …google that error. I bet you can find what went wrong.

  2. Thanks for taking the time to post this information. I’m not sure why VMware doesn’t include this in it’s standalone converter! I’m with you, I wasn’t interested in converting my clients VM’s HOT as it never works out well. the best way is cold! or create a local network that only the vm and the converter/ESXI can talk on and move it that way.

    Anyways thanks for the info it worked perfectly.

    Jonathan R Young

  3. Thanks for this post. I followed it to convert hyper-v virtual machines to vmware workstation 10 vm’s . It only works if your virtual machine on Hyper-v is running IDE drives. If the virtual machines has a SCSI drive in Hyper-v , VMworkstation cannot find OS on drive.
    I tried both the options with startwind for disk allocation that is – expanding disk and pre allocated disk space , Does not work

    • yes, with the old Hyper-V 2012 (not the newer R2) the boot disk can only be IDE. I hear that the new R2 version allows booting from v SCSI disks….however the only OSes supported in that config are Win 8+ and Win 2012+ 🙁

  4. I just found another very useful way to turn a Hyper-V VHDX into a VMware virtual machine. I’m surprised it actually worked! I did need an existing Server 2012 R2 server, though.

    1. Log onto a pre-existing Windows 2012 R2 server (physical or virtual)
    2. Attach the VHDX you want to convert using the Disk Management console
    3. Use VMware Converter to perform a P2V or V2V, but exclude the servers pre-existing drives and just convert the attached VHDX drives.
    4. Configure your destination VM and turn it on.

    VMware Converter converted this perfectly and the server booted up without any manual intervention. You just need to ensure you attach the disks with read/write access so a VSS snapshot can be taken.

    Easy!

  5. Hi! Thanks for the solution. Followed all the steps correctly and tried to power on the VM but it gives “operating system not found” in VMware whereas the OS is present and booting fine on this VM in Hyper v. Please help.

Leave a Reply

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