January 29, 2017

VMDK to VHDX Disk Conversion VMware to Microsoft Hyper-V

Cross Platform


Why not just use VMware Workstation or ESXi? In this use case it was 50% laziness,  as I had just reinstalled the laptop and would need to install VMware Workstation and 50% just to play with Hyper-V. This wasn't something production. I just wanted a quick WordPress lab environment that I could wipe out when I was done. I didn't want to install VMware Workstation, spin up a VM, and install & configure WordPress. Enter the laziness part. Enter Bitnami.


Cloud hosting for applications and virtual machines. Their virtual machines are also downloadable to give you a quick preconfigured environment for what ever you need.



So I quickly clicked on the Wordpress Blog link. You have options to deploy to a cloud provider, a container, or download for local install. Below the download link there is a link to download the virtual machine image.


The instructions are for VMware and VirtualBox deployments and the download is an OVA file, which is just Zipped up OVF and disks.


So being entirely to lazy to search and look around for a Wordpress Hyper-V image. I decide to search and look around for a way to convert the VM to Hyper-V. First I extracted the OVA with 7-Zip.



Besides this being an acronym fest, turns out that I needed Microsoft Virtual Machine Converter 3.0. Last updated in 2014, I held little hope this would work with any modern created VM, but in this instance, it did!


I found a great reference post at the OpenIT Integrated Business Solutions blogOpenIT Integrated Business Solutions blog will walk you through all the steps. Great article guys! Their Powershell code below worked great.

# Import the Converter Powershell Module

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

# Convert the VMware .vmdk to a Hyper-V .vhdx

ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath "D:\Debian8\Debian8-disk1.vmdk" -DestinationLiteralPath "D:\Debian8.vhdx" -VhdType DynamicHardDisk -VhdFormat Vhdx


After it successfully converting the disk, I created a Gen1 VM in Hyper-V and pointed it to the converted disk. Up and running with little fuss.

I had to document this down. I've needed it before and I'm sure I'll need it again.