Moving a VM from VMware, VirtualBox or Hyper-V to KVM usually comes down to converting its disk. qemu-img reads all the common formats, so you can convert VMDK or VHDX to qcow2 and boot the same system on KVM or Proxmox VE.
Before you start
- A KVM host with
qemu-imgandvirt-install; see install KVM on Ubuntu. - The source VM shut down cleanly (not suspended) and any snapshots consolidated.
- Free disk space for the converted image, at least the source's used size.
- A backup of the original VM.
Prepare the source VM
- Linux guests: make sure VirtIO modules are in the initramfs (most modern distributions include them).
- Windows guests: install the virtio-win drivers before migrating, or plan to boot with an emulated SATA disk first. See VirtIO drivers.
- Uninstall VMware Tools or Hyper-V-specific agents if possible.
Export the disk
| Source | Disk format | Where to find it |
|---|---|---|
| VMware ESXi / Workstation | VMDK | Datastore browser or VM folder (copy the descriptor and -flat.vmdk) |
| VirtualBox | VDI or VMDK | VM folder under VirtualBox VMs |
| Hyper-V | VHDX or VHD | Hyper-V virtual hard disks folder |
Copy it to the KVM host with scp or rsync.
Convert the disk to qcow2
qemu-img convert -p -f vmdk -O qcow2 web01.vmdk /var/lib/libvirt/images/web01.qcow2For other formats change -f: vdi, vhdx or vpc (for legacy VHD). Inspect the result:
qemu-img info /var/lib/libvirt/images/web01.qcow2Import the VM
virt-install --name web01 --memory 4096 --vcpus 2 --disk /var/lib/libvirt/images/web01.qcow2,bus=virtio --import --os-variant ubuntu22.04 --network bridge=br0,model=virtio --graphics vnc,listen=127.0.0.1 --noautoconsole- If the source used UEFI, add
--boot uefi. - For Windows without VirtIO drivers yet, use
bus=sataandmodel=e1000efirst.
Proxmox users can run qm importdisk or use the ESXi import wizard in recent versions.
Fix things after first boot
- Network interface renamed (e.g.
ens160becomesenp1s0): update Netplan or NetworkManager config. See static IP with Netplan. - Windows: install virtio-win guest tools, then switch disk and NIC to VirtIO.
- Install
qemu-guest-agent.
Troubleshooting
- "No bootable device": BIOS/UEFI mismatch; match the source's firmware.
- Linux drops to emergency shell: missing VirtIO drivers in initramfs or fstab using old device names; boot with SATA, rebuild initramfs, use UUIDs.
- Windows INACCESSIBLE_BOOT_DEVICE: no storage driver for the new controller; boot with SATA first.
Frequently asked questions
Can I convert while the VM runs?
Not safely. Convert from a clean shutdown or an exported snapshot.
Should I convert to raw instead?
Use -O raw if you will place the disk on LVM or ZFS. See qcow2 vs raw.
Does virt-v2v help?
Yes. virt-v2v automates conversion and driver injection, especially for VMware and Windows sources.
