Google IT Solutions: How to Migrate Virtual machine from VMWare to Hyper-V

Wednesday, 28 May 2014

How to Migrate Virtual machine from VMWare to Hyper-V

Please follow below steps;

Step 1: Shut down the VM

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 2: 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:
Then use below method to convert in single disk.

Step 3:  Consolidating Multiple VMware VMDK Disk Files into One

In command prompt, navigate to where you have VMWare installed.  For me it was
C:\Program Files (x86)\VMware\VMware Workstation
In that folder you can use the vmware-vdiskmanager.exe program to perform this operation
vmware-vdiskmanager -r MyVirtualMachineDisk.vmdk -t 0 SingleDiskFile.vmdk
Replace MyVirtualMachineDisk.vmdk with the full path and file name of the first file of your split VMware disk set.

The “-t 0” means to turn it into a “single growable virtual disk“.  If you would rather pre-allocate all the storage for the disk, use “-t 2” instead, which means “preallocated virtual disk.
You can view more command line options by running the vmware-vdiskmanager.exe with no parameters.

DownLoad WinImage Utility
  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 4: 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 5: 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
Enjoy :) 


1 comment: