Moving Virtual Machines from VMware to KVM and KubeVirt: virt-v2v, virtio Drivers, Renamed Devices and First Boot Pitfalls
Copying the disk is the easy part. The preparation on the source side, the difference between virt-v2v and raw conversion, and the typical failures that show up on first boot when a VM lands on new hardware.
After the change in VMware licensing, many teams started moving their virtual machines to a KVM based platform: plain libvirt, Proxmox, OpenStack, or KubeVirt on Kubernetes. Whatever the target, the hard part sits in the same place. Copying the disk file is easy. Getting the operating system on that disk to boot on new hardware, find its network and keep serving traffic is not. When a migrated machine fails its first boot, the cause is almost never the disk format. It is drivers, device names and configuration tied to the old hardware.
Three approaches
Raw disk conversion. Convert the VMDK to qcow2 or raw with qemu-img convert and attach it to a new VM. It is fast and needs no extra tooling, but it only moves bytes. It does not touch the guest: no virtio drivers, no removal of VMware Tools, no rebuilt boot image. You have to do all of that yourself, before or after.
virt-v2v. It edits the guest while reading the disk. On Linux guests it regenerates the initramfs with virtio modules; on Windows guests it installs virtio drivers and sets up the boot disk controller to match. It can read from vCenter, ESXi, OVA or VMX files and write to a local disk, libvirt or OpenStack.
Bulk migration tooling. On the KubeVirt side, Forklift (shipped by Red Hat as Migration Toolkit for Virtualization) connects to vCenter, moves machines as a plan and uses virt-v2v underneath. Warm migration uses VMware Changed Block Tracking to copy the disk while the VM is still running, so downtime shrinks to the final delta transfer.
If you want a recommendation: virt-v2v for a handful of machines, a bulk tool that drives virt-v2v for dozens. Choose the raw qemu-img path only if your team knows exactly what has to change inside the guest and can repeat it reliably on every machine. Migrations that start with "the disk is copied, we will fix the rest later" lose most of their time on first boot failures.
Preparation on the source side
Before moving anything, do this on the VMware side:
- Consolidate snapshots. A VM with snapshots has a base disk plus a chain of delta files. Copy only the base VMDK and you roll the machine back to the moment the snapshot was taken, which often goes unnoticed on day one.
- Record the firmware. BIOS or UEFI, Secure Boot on or off. If the target firmware does not match, the bootloader is not found even though the disk is intact.
- Record network identity. MAC address of each interface, static IP, gateway, VLAN. The MAC may change on the new platform, and DHCP reservations, MAC bound licences and firewall rules will trip on it.
- Add virtio modules to the Linux initramfs. This step is a lifesaver on the raw conversion path.
On RHEL and derivatives, with dracut:
dracut -f --add-drivers "virtio_blk virtio_scsi virtio_net virtio_pci"
On Debian and Ubuntu, list the modules in /etc/initramfs-tools/modules and regenerate:
printf '%s\n' virtio_blk virtio_scsi virtio_net virtio_pci >> /etc/initramfs-tools/modules
update-initramfs -u
On Windows, mount the virtio-win ISO and preinstall the storage driver so the boot disk is found on the new controller:
pnputil /add-driver D:\viostor\2k19\amd64\*.inf /install
The folder name depends on the Windows version; check the directories on the ISO and pick the right one.
Moving a single VM with virt-v2v
The basic command that reads from vCenter and writes qcow2 to a local directory:
virt-v2v \
-ic 'vpx://[email protected]/Datacenter/esxi01.example.com?no_verify=1' \
app-vm01 \
-o local -os /var/tmp/migration -of qcow2
This pulls the disk over HTTPS through vCenter, which is slow for large disks. If you have VMware's VDDK library, hand the transfer to it with -it vddk and the time drops noticeably; pass the library directory and the ESXi host certificate thumbprint with -io vddk-libdir= and -io vddk-thumbprint=. VDDK is downloaded separately from VMware under its own licence terms and is not shipped by distributions.
For Windows guests, virt-v2v needs the virtio-win package installed or the VIRTIO_WIN environment variable pointing at the ISO. If it cannot find the drivers, conversion ends with a warning and the VM runs on an IDE or SATA controller, slowly.
Pitfalls
The boot disk is not found. Dropping to the dracut emergency shell on Linux and the INACCESSIBLE_BOOT_DEVICE blue screen on Windows have the same root cause: the kernel cannot see the boot disk on the new controller. Usually it is a hostonly initramfs built for the old hardware or a missing storage driver. The quickest recovery is to attach the disk temporarily on a SATA controller, boot, install the driver, then switch to virtio.
Disk names change. VMware paravirtual SCSI disks show up as /dev/sda on Linux; the same disk on virtio-blk becomes /dev/vda. If /etc/fstab or the bootloader refers to device names, the boot stops halfway. Switch mounts to UUIDs or labels before migrating. With virtio-scsi the names stay sd, which is a good reason to prefer virtio-scsi for VMs with many disks.
The network interface is renamed. Predictable interface names are derived from the PCI location. An interface called ens192 on VMware becomes something like enp1s0 on KVM. If Netplan, NetworkManager or ifcfg files reference the old name, the VM boots but has no network. Without console access that is worse than a VM that does not boot. Bind the configuration to the MAC address or fix the mapping with a post migration script.
The hidden old NIC on Windows. The static IP stays on the old VMware adapter and the new virtio adapter falls back to DHCP. Assign the same IP to the new adapter and Windows complains it is already in use, because the old adapter still exists as a hidden device in Device Manager. Show hidden devices and remove it.
Clock drift. Windows reads the hardware clock as local time, Linux usually as UTC. With the wrong setting on the target, a Windows VM boots off by the time zone offset and time sensitive authentication such as Kerberos breaks. In libvirt, Windows guests use <clock offset='localtime'/>.
Leftover guest tools. VMware Tools left behind throws errors at boot and sometimes conflicts with the network driver. Install the QEMU guest agent instead; you need it for clean shutdown, reporting IP addresses to the platform and consistent snapshots.
Disks grow. Converting a thick provisioned VMDK can write out the empty space too. If you want thin provisioning on the target, confirm the conversion writes sparse output and check the real allocated size with qemu-img info afterwards.
Licence reactivation. The hardware identity changes, so Windows and some commercial software ask for reactivation. Have licence keys ready so it fits inside the maintenance window.
Verification order
Run the same checks on every migrated VM: boot time and console errors, all disks mounted, interface name and IP, default route and DNS, clock, guest agent responding, and the application's own health check. Do not delete the source VM until this list passes cleanly; keep it powered off. The rollback plan should be as simple as "power the old VM back on".
When not to migrate
Not every VM deserves to be migrated. Machines built by configuration management that hold no state are often faster to rebuild from scratch on the new platform than to convert, and rebuilding leaves years of manual drift behind. Migration is for machines whose build is undocumented or that carry state.
Some workloads are not ready to move at all: systems that rely on VMware specific fault tolerance features, commercial software whose support terms name a specific hypervisor, and clusters bound to shared physical disks or special hardware. For those, first establish what the equivalent is on the target platform. Plan around the hardest ten percent of machines rather than the machine count, and the schedule will be realistic.