Migrating Virtual Machines from VMware to Hyper-V: Tools and Steps

VMDK–VHDX conversion, restore from backup, Generation 1/2 choice, the Linux initramfs issue, wave planning and post-migration checks when moving from VMware to Hyper-V.
Technical summary
Technology
VMware vSphere, Hyper-V, VHDX, qemu-img, PowerShell, Veeam
Topic
VM migration and conversion
Level
Intermediate–advanced
Prerequisites
  • A ready and verified Hyper-V host or cluster
  • Inventory of the VMs to be migrated
  • Current, tested backups
In this article8 sections

The platform decision is made; now you need to move dozens, sometimes hundreds, of virtual machines from VMware vSphere to Hyper-V without losing data and with acceptable downtime. What makes migration hard isn’t the conversion tool; it’s a skipped snapshot, a driver missing from the initramfs, an old network card left hidden. This guide covers conversion methods, the Generation 1/2 choice, common driver and network problems in Windows and Linux VMs, the wave plan and post-migration checks, in order.

Pre-migration inventory and dependency analysis

For each VM in the system infrastructure being migrated, collect the following in a single table. Both the wave plan and the rollback decision come from this table:

  • Operating system and version, firmware type (BIOS or EFI), disk partitioning scheme (MBR/GPT)
  • vCPU, memory, number and size of disks, thin/thick provisioning, existing snapshots
  • Number of network cards, VLANs, static IP, DNS and gateway; any license tied to a MAC address
  • Systems it depends on and that depend on it (database, application server, file share)
  • Special configurations such as RDM (Raw Device Mapping), USB passthrough, shared disks (MSCS/WSFC cluster)
  • Allowed downtime and the business owner

Most of this data comes out of a single PowerCLI script:

Get-VM | Select-Object Name, PowerState, NumCpu, MemoryGB,
  @{N='Firmware';E={$_.ExtensionData.Config.Firmware}},
  @{N='GuestOS';E={$_.ExtensionData.Config.GuestFullName}},
  @{N='DiskGB';E={($_ | Get-HardDisk | Measure-Object CapacityGB -Sum).Sum}},
  @{N='Snapshots';E={($_ | Get-Snapshot).Count}} |
  Export-Csv .\vm-inventory.csv -NoTypeInformation -Encoding UTF8

Consolidate snapshots of a VM before conversion. If you don’t, the disk you convert may be only part of the chain, and you’ll notice the missing data only when the application opens. VMs with RDM and shared disks need a separate design: their Hyper-V equivalents can be pass-through disks, a direct iSCSI connection from the guest, or shared VHDX/VHD Set. If the “special” column in the inventory isn’t empty, that VM doesn’t go into the pilot wave.

Comparison of conversion methods

Microsoft Virtual Machine Converter (MVMC) was retired years ago. The main methods used today are:

Method How it works When it fits
Cross-platform restore from backup The VMware backup is restored as a Hyper-V VM Most workloads, if the backup product supports it
Disk conversion tools The VMDK file is converted to VHDX and the VM is created manually A small number of VMs, when full control is wanted
Microsoft’s WAC VM Conversion extension Managed conversion from vCenter to Hyper-V If the support scope and release status are verified
Application-level migration A new VM is built and the role or data is moved Domain controllers, SQL Server, old operating systems

Restore from backup is the most practical route if your backup product supports it (e.g. Veeam Backup & Replication’s feature for restoring a VMware backup to Hyper-V). The backup is already being taken in the existing backup and disaster recovery setup, the disk format is converted during the restore, and the source VM isn’t touched. Verify in the vendor documentation that the feature is supported in your version and which guest operating systems it covers.

For disk conversion, the open-source qemu-img is widely used. Convert while the VM is powered off and on a consistent disk. The descriptor (vm.vmdk) and the data file (vm-flat.vmdk) must be in the same folder; copying only the flat file is a common mistake:

qemu-img convert -p -f vmdk -O vhdx -o subformat=dynamic vm.vmdk vm.vhdx

Check the integrity of the converted VHDX on the Hyper-V host:

Test-VHD -Path D:\VMs\app01\app01.vhdx
Get-VHD  -Path D:\VMs\app01\app01.vhdx | Select-Object VhdFormat, VhdType, Size, FileSize

Don’t convert a domain controller; build a new DC and move the roles. Having the converted copy and the source DC accidentally powered on at the same time, or taking the copy from a snapshot, can cause a USN rollback. Building a new DC closes off this risk from the start.

Generation 1 or Generation 2

A Generation 2 VM boots with UEFI, supports Secure Boot and vTPM, and its boot disk is on the SCSI controller. Generation 1 uses BIOS emulation and boots from the IDE controller. The source VM’s firmware determines the choice:

  • VM with EFI firmware and a GPT disk in VMware → Generation 2
  • VM with BIOS firmware and an MBR disk in VMware → Generation 1 (or convert to GPT first, then Generation 2)

On Windows, MBR2GPT.exe can be used to convert an MBR disk to GPT. Check the operating system versions the tool supports and its prerequisites (at most three partitions, a system partition, etc.) in advance, and do the operation on a backed-up copy. The generation can’t be changed after the VM is created. A wrong choice means a rebuild.

Windows VM migration steps

  1. Preparation on the source: Record the IP configuration (ipconfig /all output), finish pending updates, verify the local administrator password. Being stuck at the console without the password eats up the migration window.
  2. Remove VMware Tools on the source: Trying to remove it on Hyper-V can cause problems because the installer can’t find the VMware environment. Removal also takes the VMXNET3 driver with it, so the VM loses network connectivity; do this step from the vSphere console as the last step of the migration window, and add the reboot that follows to the time budget.
  3. Shut down and convert the VM (restore from backup or disk conversion).
  4. Create the VM in Hyper-V and attach the disk:
    New-VM -Name app01 -Generation 2 -MemoryStartupBytes 8GB `
      -VHDPath D:\VMs\app01\app01.vhdx -SwitchName vSwitch-Prod -Path D:\VMs
    Set-VMProcessor -VMName app01 -Count 4
    Set-VMNetworkAdapterVlan -VMName app01 -Access -VlanId 120
    Set-VMFirmware -VMName app01 -FirstBootDevice (Get-VMHardDiskDrive -VMName app01)
  5. First boot: Windows Server 2016 and later include the Hyper-V integration services components with the operating system. The network card will appear as a new device, so re-enter the static IP.
  6. Clean up the hidden old network card: Show hidden devices in Device Manager and remove the old VMXNET3 adapter. If you don’t, you’ll get a “used by another adapter” warning when assigning the same IP.
  7. Licensing and activation: Since the hardware changed, check Windows activation and application licenses tied to the MAC address. Assign a static MAC address to the VM if needed.

Things to watch in Linux VMs

Current Linux kernels include the Hyper-V drivers (hv_vmbus, hv_storvsc, hv_netvsc). The problem is usually not that the driver is missing but that it isn’t in the initramfs. If the initramfs built on VMware doesn’t contain the disk controller driver, the VM can’t find the root file system on Hyper-V and drops to the dracut emergency shell. If you see this screen on the console, this is most likely the reason. The fix is applied on the source, before migration:

# RHEL, Rocky, AlmaLinux
dracut -f --add-drivers "hv_vmbus hv_storvsc hv_netvsc"

# Debian, Ubuntu
printf "hv_vmbus\nhv_storvsc\nhv_netvsc\n" >> /etc/initramfs-tools/modules
update-initramfs -u

Other checkpoints:

  • fstab: Mount disks by UUID or label instead of /dev/sdX; device order can change when the controller changes.
  • Network interface name: Names like ens192 will be different on Hyper-V (usually eth0). Update the Netplan, NetworkManager or ifupdown configuration for the new name; otherwise the VM boots but doesn’t reach the network.
  • Remove the open-vm-tools package. For Hyper-V helper services, the hyperv-daemons package can be installed on the RHEL family and Debian, and linux-cloud-tools-virtual on Ubuntu.
  • Hyper-V support may be limited on old distributions; check Microsoft’s supported Linux and FreeBSD virtual machines for Hyper-V page.

Wave plan and migration window

Migrate in waves, not all at once:

  1. Pilot wave: One non-critical VM from each operating system. The goal is to validate the process and the tools.
  2. Independent workloads: Infrastructure servers with few dependencies, test environments.
  3. Application groups: Interdependent servers are moved together in the same window. A latency-sensitive application and its database shouldn’t stay on different platforms for long.
  4. Critical systems: A separate window, a separate rollback plan.

Measure the downtime for each VM with a pilot conversion; the time depends largely on disk size and storage/network speed. Don’t open a window based on guesswork. The rollback plan should be simple: the source VM isn’t deleted, only powered off and its network card disconnected; if a problem occurs, the Hyper-V VM is shut down and the source is powered back on. Source VMs are deleted after the agreed observation period.

Post-migration verification checklist

  • The VM boots, and there are no driver or disk errors in the (System) event log
  • Integration services status is correct: Get-VMIntegrationService -VMName app01
  • IP, DNS, gateway and VLAN are correct; the DNS record is current
  • Application services are running, and the business owner has done a functional test
  • Windows activation and application licenses are valid
  • The VM has been added to the backup job and the first backup completed successfully
  • The VM has been added to monitoring, and the old VMware entry removed from monitoring
  • If clustered, the high availability role was added and a live migration test was done

Take the first backup and do a test restore right after migration. A backup job showing “successful” isn’t enough. For a verified backup approach, see the 3-2-1-1-0 rule and restore testing article. If the live migration test fails, the Hyper-V live migration errors guide gives diagnostic steps by symptom. If the target platform isn’t settled yet, first read the platform choice after VMware article. We can work together on planning and migration within our virtualization and data management service.

Frequently asked questions

Should I remove VMware Tools before or after the migration?

If possible, before, in the source VMware environment. Trying to remove it on Hyper-V may fail because the installer can’t find the VMware environment, and it then needs manual cleanup.

Can I convert a Generation 1 VM to Generation 2 later?

No, in Hyper-V the generation can’t change after the VM is created. If you want Generation 2, convert the disk to GPT, create a new Generation 2 VM and attach the disk to it.

Why can’t a Linux VM find its root file system when booting on Hyper-V?

The most common cause is that the Hyper-V storage driver (hv_storvsc) isn’t in the initramfs. Rebuilding the initramfs with this driver on the source before migration and using UUIDs in fstab prevents the problem.

Is it safe to migrate a domain controller by converting it?

It isn’t recommended. Having the copy and the source powered on at the same time can cause a USN rollback. Build a new domain controller and wait for replication to complete, then remove the old DC properly.

Support

Contact us for support or a discovery session on this topic.

Contact form
[email protected]

Eretek System Support

Server installation, configuration, incident response and scheduled maintenance. Active Directory, virtualization and backup are managed with the same discipline.

Knowledge Center

Other articles