About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
Convert the disk with qemu-img convert -p -f vmdk -O vhdx, which QEMU's documentation describes as converting a disk image to another format, and check the result before building a VM around it. Hyper-V's own Convert-VHD cmdlet cannot do this job, because it works only between .vhdx and .vhd files. After the conversion, the disk boots only if the Hyper-V VM's generation matches how the guest was installed and the guest has drivers for Hyper-V's virtual devices.
What the tool converts and what it does not
QEMU's qemu-img manual says convert will "Convert the disk image FILENAME or a snapshot SNAPSHOT_PARAM to disk image OUTPUT_FILENAME using format OUTPUT_FMT." It handles the disk image only, so the Hyper-V VM, with its own CPU, memory, network adapter and firmware settings, is created separately.
The format pages describe VMDK as "VMware 3 and 4 compatible image format" with subformats monolithicSparse (the default), monolithicFlat, twoGbMaxExtentSparse, twoGbMaxExtentFlat and streamOptimized. They describe VHDX as "Hyper-V compatible image format (VHDX)", with the subformats dynamic (the default) and fixed.
Microsoft's Convert-VHD reference says "The format is determined by the file name extension of the specified files, either .vhdx or .vhd." and "Conversion is an offline operation; the virtual hard disk must not be attached when the operation is started."
Two facts about Hyper-V shape everything after the conversion. Microsoft says "The virtual machine generation is a property of the virtual machine, not a property of the virtual hard disk", and "You can't change a virtual machine's generation once it's created."
Before you convert
NetLeverage runs VMware vCenter, vSphere and ESXi. The checks below only read, and run on the machine that holds the VMDK. Keep every file that belongs to the VMDK together in one folder; the QEMU documentation lists flat and multi-extent VMDK subformats (monolithicFlat, twoGbMaxExtentSparse, twoGbMaxExtentFlat), so a VMDK may consist of more than one file. The info command below must succeed on the file you name before you go on.
- Read the source disk. If the source VM has snapshots, its VMDK does not hold the whole disk; do not delete or consolidate snapshots as part of this job, and ask the VM's owner for a clean state. The qemu-img manual says
infoshows "backing file" details for an image, and--backing-chainenumerates a chain.
qemu-img info web01.vmdk
A good result for this job shows the file format vmdk, the virtual size you expect and no backing file. The manual says info also reports how much space the file takes ("disk size"), which can differ from the virtual size.
- Work out the destination size. The manual says
measurewill "Calculate the file size required for a new image", for an existing file, as if converting it:
qemu-img measure -f vmdk -O vhdx web01.vmdk
Compare "required size" and "fully allocated size" with the free space on the destination volume.
- Note whether the source guest boots with BIOS or UEFI, from the firmware setting of the source VM in vSphere (Microsoft's Generation 1 or 2 page does not describe how to read it). Microsoft lists "an existing, prebuilt virtual hard drive (VHD or VHDX files), which isn't compatible with UEFI" as a reason to choose Generation 1; a UEFI-installed disk belongs in a Generation 2 VM.
- Note the disk size against the boot-volume limit. Microsoft gives the Generation 1 maximum boot volume as 2 TB for a .VHDX; Generation 2 allows 64 TB.
- Write down the guest's static address, gateway and DNS settings. On a Windows guest,
ipconfig /all > ipconfig-before-web01.txtsaves them (run it in the guest before it is shut down). - Plan drivers. Microsoft says Linux integration services "are generally provided through the Linux kernel", and that Windows guests keep integration services up to date "by default if they are set up to get important updates from Windows Update". A guest that has never run on Hyper-V needs those drivers to be available before the first boot; that is where the disk controller faults below come from.
Convert
Shut the source VM down
First write down the source VM's power state and its snapshot list in vSphere Client, and save the disk details:
qemu-img info web01.vmdk > web01-vmdk-info-before.txt
Disruptive step: the next step shuts the source VM down, which stops its service until it is powered on again. Run it only if the snapshot list is empty.
In vSphere Client, shut down the guest of the source VM, so the VMDK is no longer written to.
To undo it: power the source VM on in vSphere Client. This works until the new Hyper-V VM has first started; after that the two copies diverge.
Write the VHDX
First save the details of the source (the file from the previous step already holds them):
qemu-img info web01.vmdk > web01-vmdk-info-before.txt
Risk: the next command reads the whole source VMDK and writes a new VHDX file, which uses disk space and I/O on the machine that runs it. Choose an output path that does not exist yet, so no earlier file is overwritten.
Convert, with a progress bar (-p is documented for compare, convert and rebase), explicit formats and the default dynamic subformat:
qemu-img convert -p -f vmdk -O vhdx -o subformat=dynamic web01.vmdk web01.vhdx
QEMU's VHDX notes say of block_state_zero: "Do not set to off when using qemu-img convert with subformat=dynamic." Leave that option alone. Then check the result against the source:
qemu-img info web01.vhdx
qemu-img compare -f vmdk -F vhdx web01.vmdk web01.vhdx
The manual says compare will "Check if two images have the same content", exits with 0 when the images are equal, and exits 1 when they differ. A good result is exit code 0 and the same virtual size in both info outputs.
To undo it: the conversion reads the source and writes the new file. To remove the new file, and only before any VM uses it, list it first:
ls -l web01.vhdx
Delete the file only if the listing shows the file you made, with today's time and the size you expect:
rm web01.vhdx
Create the Hyper-V VM and start it
First save the Hyper-V host's current VM list:
Get-VM | Select-Object Name, State > hyperv-vms-before-web01.txt
Risk: the next steps put the converted disk on the Hyper-V host and create a new VM that uses it. Once the VM starts, the guest writes to that VHDX, so keep the original VMDK untouched as your way back.
Copy web01.vhdx to the Hyper-V host's VM folder. Then create the VM with the generation that matches the guest (2 for UEFI, 1 for BIOS). -VHDPath attaches an existing disk, as Microsoft's New-VM example shows; LAN is a switch name that must already exist on the host:
New-VM -Name web01 -MemoryStartupBytes 4GB -Generation 2 -VHDPath D:\VMs\web01\web01.vhdx -SwitchName LAN
To undo it, only before the first start: Microsoft's Remove-VM reference says it "does not delete any virtual hard drives", so removing the VM leaves the VHDX in place.
Risk: the next command removes the web01 VM and its settings from the Hyper-V host (it prompts for confirmation); the disk file stays.
Remove-VM -Name web01
First print the VM's current state, which should be Off:
Get-VM -Name web01 | Select-Object Name, State
Disruptive step: the next command starts web01 on Hyper-V. If the source VMware VM is still powered on, the two guests share one network identity, so power the source off first.
Start-VM -Name web01
To undo it: shut the guest down. The VM then stays off. Once the guest has run, its disk holds new writes, so going back to VMware means converting again from the untouched VMDK.
Risk: the next command asks the guest to shut down, which ends service on web01. Only if the guest does not respond, Stop-VM -Name web01 -TurnOff powers it off without a clean shutdown, and anything not yet written to disk is lost.
Stop-VM -Name web01
What breaks at first start and how to tell
| Cause | What you see | How to confirm |
|---|---|---|
| Generation does not match how the guest was installed | No boot device, or a boot failure. Microsoft: a bootable VHDX from a Generation 2 VM attached to a Generation 1 VM fails to boot | The VM's generation against the source's BIOS or UEFI setting |
| Disk controller driver missing in the guest | As described in VM Will Not Boot After a Disk Controller Change: Diagnosis (Windows INACCESSIBLE_BOOT_DEVICE, or a Linux guest dropping to an initramfs shell); Microsoft's Generation and integration services pages do not describe these signs | That article's read-only checks |
| Secure Boot template on a Linux Generation 2 VM | Firmware refuses the boot loader, as described in Hyper-V Generation 2 Linux VM will not boot: Secure Boot blocks the boot loader | That article's checks |
| Network adapter changed | As described in Static IP Lost After a VM Restore or Virtual NIC Change: guest on DHCP or no network, static address lost | ipconfig /all against ipconfig-before-web01.txt |
| Source disk was a snapshot child | Missing recent data or an old state | qemu-img info on the source showed a backing file |
| Boot volume larger than 2 TB on Generation 1 | Boot problems on a large disk | Microsoft's Generation 1 limit for .VHDX is 2 TB |
| VMware Tools still installed | Leftover services and drivers in the guest | Installed programs list in the guest |
Example (illustrative): web01 is a UEFI Windows VM with one 100 GB disk. qemu-img info web01.vmdk shows format vmdk and no backing file. qemu-img measure -f vmdk -O vhdx web01.vmdk reports a required size well under the fully allocated size, and the destination has room for the fully allocated figure. The engineer converts, qemu-img compare exits 0, and a Generation 2 VM is created on hv01 with a switch named LAN. It boots; the network adapter is new, so the engineer re-enters the static address 192.0.2.20 recorded before the move.
Confirm the move
qemu-img compareexited 0 and both virtual sizes match.Get-VMshows the VM Running, and its generation matches the source's boot method.- Services start and the guest sees its disks and network.
- Keep the VMware VM powered off and unchanged until the application owner accepts the Hyper-V VM.
Read next
Related articles you may want next.
- CloudESXi to Proxmox VE: disk import, drivers, networking and what does not carry overMove VMs from ESXi to Proxmox VE: choose an import method, keep Windows bootable through the VirtIO switch, fix networking, rebuild what does not carry over.Read article
- TroubleshootingVM Will Not Boot After a Disk Controller Change: DiagnosisWhy a VM stops at INACCESSIBLE_BOOT_DEVICE or a dracut shell after a disk controller change, how to prove it read-only, and which vendor procedure applies.Read article
- CloudMoving ESXi VMs to Nutanix AHV with Move: Prerequisites, Cutover and Guest ChangesHow Nutanix Move copies ESXi VMs to AHV: the checks that stop a plan, what changes in the guest, what happens at cutover, and the clean-up steps.Read article
Risks and limits
- These commands have not been run or lab-tested.
- The qemu-img documentation is for QEMU's current master branch and shows no date; check
qemu-img --helpand your installed version's manual. - QEMU's notes say it recommends converting images to raw or qcow2 for running VMs; VHDX support in qemu-img is mainly for conversion.
- Microsoft's pages do not describe converting a VMDK; the Hyper-V steps follow its Generation and New-VM pages.
- Licences tied to hardware identity may need the software vendor's guidance after a move between hypervisors.
Sources
- qemu-img – QEMU disk image utility — QEMU documentation (master), no date shown, accessed 1 December 2026
- Disk Images — QEMU documentation (master), no date shown, accessed 1 December 2026
- Should I create a generation 1 or 2 virtual machine in Hyper-V? — Microsoft Learn, last updated 2025-06-18, accessed 1 December 2026
- Manage Hyper-V Integration Services — Microsoft Learn, last updated 2025-02-21, accessed 1 December 2026
- Convert-VHD — Microsoft Learn, no date shown, accessed 1 December 2026
- New-VM — Microsoft Learn, no date shown, accessed 1 December 2026
- Remove-VM — Microsoft Learn, no date shown, accessed 1 December 2026
- Start-VM — Microsoft Learn, no date shown, accessed 1 December 2026
- Stop-VM — Microsoft Learn, no date shown, accessed 1 December 2026
This article was originally published on .