From 19d146543cffd14316b00ed5a71f8534b05d6ed8 Mon Sep 17 00:00:00 2001 From: Andrija Panic Date: Tue, 24 Nov 2026 20:24:15 +0100 Subject: [PATCH 1/2] VMware to KVM import: Windows Server 2025 requirements and an optional virt-v2v build Turn the Windows Server 2025 note into a warning that lists what such a guest needs after the import: UEFI boot with the q35 machine type, a host CPU model (SSE4.2 and POPCNT), and a virt-v2v whose first boot does not loop on a failing driver. Keep the existing smbus ISO workaround as option A. Describe an optional, community-maintained EL9 virt-v2v build with the upstream first-boot fixes as option B, with the signature checks, a version lock and the way back to the stock package. Related to apache/cloudstack#13241 --- .../importing_vmware_vms_into_kvm.rst | 107 +++++++++++++++--- 1 file changed, 93 insertions(+), 14 deletions(-) diff --git a/source/adminguide/virtual_machines/importing_vmware_vms_into_kvm.rst b/source/adminguide/virtual_machines/importing_vmware_vms_into_kvm.rst index bc40d2def2..4a783059c4 100644 --- a/source/adminguide/virtual_machines/importing_vmware_vms_into_kvm.rst +++ b/source/adminguide/virtual_machines/importing_vmware_vms_into_kvm.rst @@ -110,20 +110,40 @@ For Debian-based distributions (alien is needed for conversion of .rpm to .deb p curl -L -o /usr/share/virtio-win/virtio-win.iso https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso -.. note:: - Windows Server 2025 enforces a stricter driver-signature policy at runtime and, as of - virtio-win 0.1.285, rejects the optional ``smbus`` driver's certificate during the - first-boot driver installation. virt-v2v retries the failed installation on every - boot, which leaves the imported guest in a reboot loop. The driver is a non-essential - SMBus stub; the essential storage and network drivers install fine. - - This affects **Windows Server 2025 and newer only** - older Windows releases - (Windows Server 2016/2019/2022, Windows 10/11) accept the driver's signature and work - fine with the unmodified upstream ISO, so no action is needed for them. Until this is - resolved in the virtio-win project, rebuild the ISO on the conversion host without the - ``smbus`` files before converting Windows Server 2025 guests (virt-v2v reads the - drivers from ``/usr/share/virtio-win/virtio-win.iso``, so the ISO itself has to be - modified): +.. warning:: + **Windows Server 2025 guests** need three things to boot after the import and to finish + their first boot (see https://github.com/apache/cloudstack/issues/13241): + + 1. **UEFI boot with the q35 machine type.** A Windows Server 2025 guest that uses UEFI on + VMware must also boot with UEFI on KVM. If the imported Instance is created with BIOS + boot and the older i440fx machine type, it stops at "No bootable device". Before the + first start, set the Instance setting ``UEFI`` to ``LEGACY`` (or to ``SECURE`` for Secure + Boot). UEFI Instances use the q35 machine type. + + 2. **A host CPU model.** Windows Server 2025 requires CPU features (SSE4.2 and POPCNT) that + the default QEMU CPU model does not offer. On the KVM hosts, set + ``guest.cpu.mode=host-passthrough`` (or ``host-model``) in + ``/etc/cloudstack/agent/agent.properties`` and restart the CloudStack agent. + + 3. **A first boot that does not loop.** On its first boot, the converted guest runs a + script from virt-v2v that installs every virtio driver. As of virtio-win 0.1.285, + Windows Server 2025 rejects the optional ``smbus`` driver, because that driver is signed + with a certificate Windows does not trust. The virt-v2v shipped with EL9 + (``virt-v2v-2.7.1-19.el9_7`` at the time of writing) then retries the whole script on + every boot, so the guest restarts forever. The storage and network drivers are not + affected. This was fixed in upstream virt-v2v + (https://github.com/libguestfs/virt-v2v/pull/202 and + https://github.com/libguestfs/libguestfs-common/pull/54): a failing driver is reported, + and the first boot carries on. Until EL9 ships these fixes, use one of the two options + below on the conversion hosts. + + Older Windows releases (Windows Server 2016/2019/2022, Windows 10/11) accept the + ``smbus`` driver and are not affected by item 3. + +**Option A: remove the smbus driver from the virtio-win ISO** + +virt-v2v reads the drivers from ``/usr/share/virtio-win/virtio-win.iso``, so the ISO itself has +to be rebuilt without the ``smbus`` files before converting Windows Server 2025 guests: :: @@ -135,6 +155,65 @@ For Debian-based distributions (alien is needed for conversion of .rpm to .deb p xorriso -as mkisofs -o /usr/share/virtio-win/virtio-win.iso -J -R -V virtio-win /tmp/virtio-win-extracted rm -rf /tmp/virtio-win-extracted +This avoids the ``smbus`` failure only. Any other driver that fails on the first boot still +causes the same loop with the stock EL9 virt-v2v. + +**Option B (optional): a community-maintained virt-v2v build for EL9 hosts** + +A community-maintained rebuild of the stock EL9 ``virt-v2v-2.7.1-19.el9_7`` package is +published at https://github.com/v2kmigrate/virt-v2v-el9 (GPL-2.0+; source RPM included). It +adds the upstream fixes above and further first-boot fixes for Windows guests. It is a drop-in +replacement for the stock package on EL9 hosts: the CloudStack agent keeps calling +``virt-v2v`` as before. Each release lists its fixes and where each one comes from (upstream +pull request, or a downstream patch). This build is not provided, tested or supported by the +Apache CloudStack project; use it at your own discretion. + +To install it on an EL9 KVM host, take the latest release from +https://github.com/v2kmigrate/virt-v2v-el9/releases, then check its signature before +installing: + + :: + + VER=2.7.1-19.el9_7.v2k5 + URL=https://github.com/v2kmigrate/virt-v2v-el9/releases/download/v${VER} + + curl -LO ${URL}/RPM-GPG-KEY-v2kmigrate + curl -LO ${URL}/SHA256SUMS + curl -LO ${URL}/virt-v2v-${VER}.x86_64.rpm + + # expected key fingerprint: 7DD7 2D9D B1D8 3F05 0853 D6C8 B1A0 4AAE 39CA ECD0 + gpg --show-keys RPM-GPG-KEY-v2kmigrate + rpm --import RPM-GPG-KEY-v2kmigrate + sha256sum -c SHA256SUMS --ignore-missing + rpm -K virt-v2v-${VER}.x86_64.rpm + + dnf install -y ./virt-v2v-${VER}.x86_64.rpm + rpm -q virt-v2v + +``rpm -K`` must report ``digests signatures OK``. Restart the CloudStack agent afterwards, so the +host details show the new virt-v2v version: + + :: + + systemctl restart cloudstack-agent + +A later ``dnf update`` replaces this build with a newer stock ``virt-v2v`` from the +distribution, which may not contain the fixes yet. To prevent that, lock the package, and check +the repository for a matching new build when your distribution updates virt-v2v: + + :: + + dnf install -y python3-dnf-plugin-versionlock + dnf versionlock add virt-v2v + +To return to the stock package: + + :: + + dnf versionlock delete virt-v2v + dnf downgrade -y virt-v2v + systemctl restart cloudstack-agent + On some distros, the Windows helper binary "rhsrvany.exe", which is used for Windows-based VM firstboot scripts and some other actions, might be missing. To avoid virt-v2v error like ``virt-v2v: error: One of rhsrvany.exe or pvvxsvc.exe is missing in /usr/share/virt-tools`` - check if the file exists (it's actually a symbolic link): From 15d21d846b490589ebf0ce0a756847e60863775d Mon Sep 17 00:00:00 2001 From: Andrija Panic Date: Wed, 25 Nov 2026 03:43:13 +0100 Subject: [PATCH 2/2] VMware to KVM import: option B notes from a CloudStack-native test Tested option B through CloudStack's own VMware import of a Windows Server 2025 UEFI Secure Boot guest. Every command ran as written. Notes from that run: - The host details show only the upstream virt-v2v version, the same for the stock package and this build; check with rpm -q virt-v2v instead. - Installing the versionlock plugin may also update dnf-plugins-core. - Returning to the stock package leaves the imported signing key; say how to remove it. --- .../importing_vmware_vms_into_kvm.rst | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/adminguide/virtual_machines/importing_vmware_vms_into_kvm.rst b/source/adminguide/virtual_machines/importing_vmware_vms_into_kvm.rst index 4a783059c4..c8f362a1c7 100644 --- a/source/adminguide/virtual_machines/importing_vmware_vms_into_kvm.rst +++ b/source/adminguide/virtual_machines/importing_vmware_vms_into_kvm.rst @@ -190,13 +190,18 @@ installing: dnf install -y ./virt-v2v-${VER}.x86_64.rpm rpm -q virt-v2v -``rpm -K`` must report ``digests signatures OK``. Restart the CloudStack agent afterwards, so the -host details show the new virt-v2v version: +``rpm -K`` must report ``digests signatures OK``, and ``rpm -q virt-v2v`` must show the +``.v2k`` release that was installed. Restart the CloudStack agent afterwards, so that it reads +the virt-v2v version again: :: systemctl restart cloudstack-agent +The host details in CloudStack show only the upstream virt-v2v version (for example ``2.7.1``), +which is the same for the stock package and for this build. Use ``rpm -q virt-v2v`` on the host +to see which one is installed. + A later ``dnf update`` replaces this build with a newer stock ``virt-v2v`` from the distribution, which may not contain the fixes yet. To prevent that, lock the package, and check the repository for a matching new build when your distribution updates virt-v2v: @@ -206,6 +211,8 @@ the repository for a matching new build when your distribution updates virt-v2v: dnf install -y python3-dnf-plugin-versionlock dnf versionlock add virt-v2v +Installing the versionlock plugin may also update ``dnf-plugins-core`` from the distribution. + To return to the stock package: :: @@ -214,6 +221,9 @@ To return to the stock package: dnf downgrade -y virt-v2v systemctl restart cloudstack-agent +The imported signing key stays in the RPM database. If it is no longer needed, remove it with +``rpm -e gpg-pubkey-39caecd0``. + On some distros, the Windows helper binary "rhsrvany.exe", which is used for Windows-based VM firstboot scripts and some other actions, might be missing. To avoid virt-v2v error like ``virt-v2v: error: One of rhsrvany.exe or pvvxsvc.exe is missing in /usr/share/virt-tools`` - check if the file exists (it's actually a symbolic link):