Migrating a Virtual Machine from VMWare Workstation to Hyper-V

I recently started using Windows 8 as the primary OS on my Lenovo ThinkPad W530 mobile workstation. For the last couple of years I used virtual machines hosted by VMWare Workstation to do all of the development work since Hyper-V wasn’t supported on Windows 7 and have been waiting for Windows 8 to come out to play around with Hyper-V. I didn’t want to re-build all of my VMs from scratch in Hyper-V and decided to convert them from the VMWare format to Hyper-V. In this blog post I documented every step of the conversion process.

Step 0: Fully shut down the VM in VMWare Workstation

This is important – most developers that I know simply Suspend their VMs when they shut down or reboot the host machine. You need to Shut down the virtual machine in VMWare Workstation before you begin the conversion.

Step 1: Convert virtual hard disk from VMDK to VHD

The main part of the process is to convert the virtual hard disk format from VMDK to VHD. There’s a variety of conversion tools available for this task – I picked the WinImage utility since, ironically, I’ve used it in the past to convert VHD images to VMDK and found it to be very reliable.

If your VMDK virtual hard disk consists of multiple files, I recommend that you execute the following command to generate a single VMDK image:

vmware-vdiskmanager -r sourceDisk.vmdk -t 0 targetDisk.vmdk
  1. Download, install and start WinImage
  2. In the Disk menu, select Convert Virtual Hard Disk Image…
  3. In the Open file dialog, select VMWare VMDK (*.vmdk) as the file type and browse to your current VM location, select the file and press Open
  4. In the Convert Virtual Hard Disk Image dialog, pick Create Fixed Size Virtual Hard Disk Size to make your new VHD fixed-size or pick Create Dynamically Expanding Virtual Hard Disk to make it dynamic. I prefer the dynamically expanding option.
  5. In the Save As file dialog, browse to the location you’d like to save the VHD image and type in the File name and make sure the Save as type is set to Virtual Hard Disks (*.vhd), then press Save.

Step 2: Enable Hyper-V on your Windows 8 workstation

Obviously, the Hyper-V feature needs to be enabled on your workstation. It’s not enabled by default in Windows 8 so you’ll need to follow the steps below to enable it.

  1. Open Windows Control Panel
  2. Navigate to Programs > Programs and Features > Turn Windows features on or off
  3. Check the Hyper-V checkbox and press OK
  4. Follow the prompts to complete the installation

Step 3: Configure Hyper-V networking

If this is the first virtual machine on this Hyper-V host and you haven’t configured networking yet, follow the steps below to create a new virtual network:

  1. Start the Hyper-V Manager
  2. In the Action menu, select Virtual Switch Manager…
  3. Select External and press Create Virtual Switch
  4. Type in the Name, make sure that External network option is selected and pick the network card that provides Internet access in the dropdown, then press OK
  5. Press Yes on the Apply Networking Changes dialog

Step 4: Create a new virtual machine in the Hyper-V Manager

You are now ready to create a new Hyper-V virtual machine using the VHD image created earlier in Step 1.

  1. Open the Hyper-V Manager
  2. In the Action menu, select New > Virtual Machine… to launch the New Virtual Machine Wizard
  3. On the Before You Begin screen press Next
  4. On the Specify Name and Location screen type in the virtual machine Name and select the Location, then press Next
  5. On the Assign Memory screen enter the amount of Startup memory, then press Next
  6. On the Configure Networking screen select the External virtual network created earlier in Step 3, then press Next
  7. On the Connect Virtual Hard Disk screen select the Use an existing virtual hard disk option and browse to the location of the VHD created in Step 1
  8. On the Summary screen press Finish
  9. Select the newly created virtual machine in the Virtual Machines section, then bring up the Action > Settings… dialog for the VM
  10. Select the Processor node and increase the Number of virtual processors to the desired value, then press OK
  11. Make sure the VM is still selected in the Virtual Machines section, then use the Action > Start menu option to start the virtual machine
  12. In the Action menu, select Connect… to bring up the Virtual Machine Connection window
  13. Login to the VM
  14. Make sure that remote connections are allowed by going to Control Panel > Remote settings and making sure that one of the Allow connections options is selected

And that’s it! At this point you should be able to access the VM using either Hyper-V Virtual Machine Connection or Windows Remote Desktop Connection.