# Testing Converted RHEL 10 qcow2 on Fedora (GUI, UEFI)
Before migrating this platform, ensure:
This guide describes how to validate a converted RHEL 10 qcow2 image using KVM + libvirt on Fedora, booting directly into graphical (GUI) mode with UEFI (OVMF).
This is intended as a post-conversion smoke test after migrating a VMware VMDK to qcow2 and applying offline fixes (fstab, GRUB/BLS, initramfs, etc.).
Install required virtualization tools:
sudo dnf install -y \
libvirt \
qemu-kvm \
qemu-img \
virt-viewer \
libguestfs-tools \
edk2-ovmf
Enable libvirt and ensure the default network is active:
sudo systemctl enable --now libvirtd
sudo virsh net-start default 2>/dev/null || true
/home/ssahani/by-path/out/rhel10-fixed.qcow2
Assumptions:
UEFI guests use two firmware blobs:
OVMF_CODE.fd (read-only firmware code)OVMF_VARS.fd (mutable per-VM NVRAM “vars store”)Libvirt must know a master VARS template so it can create a per-VM NVRAM file. On your host, the available firmware pairs are:
/usr/share/edk2/ovmf/OVMF_CODE.fd/usr/share/edk2/ovmf/OVMF_VARS.fdCopy the image into the standard libvirt images directory:
sudo install -o qemu -g qemu -m 0640 \
/home/ssahani/by-path/out/rhel10-fixed.qcow2 \
/var/lib/libvirt/images/rhel10-fixed.qcow2
or
sudo cp /home/ssahani/by-path/out/rhel10-fixed.qcow2 \
/var/lib/libvirt/images/
sudo chown qemu:qemu /var/lib/libvirt/images/rhel10-fixed.qcow2
Create the NVRAM directory (safe even if it already exists):
sudo mkdir -p /var/lib/libvirt/qemu/nvram
This XML is a conservative, reliable UEFI configuration:
cat >/tmp/rhel10-uefi-gui.xml <<'EOF'
<domain type='kvm'>
<name>rhel10-fixed-uefi-gui</name>
<memory unit='MiB'>4096</memory>
<currentMemory unit='MiB'>4096</currentMemory>
<vcpu placement='static'>2</vcpu>
<os>
<type arch='x86_64' machine='q35'>hvm</type>
<!-- UEFI firmware (non-secureboot) -->
<loader readonly='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.fd</loader>
<!-- Per-VM NVRAM file, copied from template on first boot -->
<nvram template='/usr/share/edk2/ovmf/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/rhel10-fixed-uefi-gui_VARS.fd</nvram>
<!-- Optional: enable temporarily for deep boot debugging -->
<!-- <cmdline>rd.debug rd.shell loglevel=7 systemd.log_level=debug systemd.log_target=console</cmdline> -->
</os>
<features>
<acpi/>
<apic/>
<vmport state='off'/>
</features>
<cpu mode='host-passthrough' check='none'/>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<timer name='hpet' present='no'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<!-- USB controller (tablet input) -->
<controller type='usb' index='0' model='qemu-xhci'/>
<!-- Root disk -->
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none' io='native' discard='unmap'/>
<source file='/var/lib/libvirt/images/rhel10-fixed.qcow2'/>
<target dev='vda' bus='virtio'/>
<boot order='1'/>
</disk>
<!-- Network -->
<interface type='network'>
<source network='default'/>
<model type='virtio'/>
</interface>
<!-- Serial console -->
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<!-- Guest agent channel (install qemu-guest-agent inside guest) -->
<channel type='unix'>
<source mode='bind'/>
<target type='virtio' name='org.qemu.guest_agent.0'/>
</channel>
<!-- Graphics: SPICE + virtio GPU -->
<graphics type='spice' autoport='yes' listen='127.0.0.1'/>
<video>
<model type='virtio' heads='1'/>
</video>
<input type='tablet' bus='usb'/>
<!-- RNG helps early boot -->
<rng model='virtio'>
<backend model='random'>/dev/urandom</backend>
</rng>
<memballoon model='virtio'/>
</devices>
</domain>
EOF
If a domain with the same name already exists, remove it first:
sudo virsh destroy rhel10-fixed-uefi-gui 2>/dev/null || true
sudo virsh undefine rhel10-fixed-uefi-gui --nvram 2>/dev/null || sudo virsh undefine rhel10-fixed-uefi-gui 2>/dev/null || true
Define and start the VM:
sudo virsh define /tmp/rhel10-uefi-gui.xml
sudo virsh start rhel10-fixed-uefi-gui
virt-viewer rhel10-fixed-uefi-gui
sudo virsh domdisplay rhel10-fixed-uefi-gui
A successful boot should show:
If this sequence completes, the image is boot-validated.
Your XML is missing the VARS template link. Confirm these lines exist:
<loader readonly='yes' type='pflash'>/usr/share/edk2/ovmf/OVMF_CODE.fd</loader>
<nvram template='/usr/share/edk2/ovmf/OVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/NAME_VARS.fd</nvram>
Keep the qcow2 under /var/lib/libvirt/images/ with qemu:qemu ownership:
sudo chown qemu:qemu /var/lib/libvirt/images/rhel10-fixed.qcow2
sudo chmod 0640 /var/lib/libvirt/images/rhel10-fixed.qcow2
Try a simpler video model:
<video><model type='qxl'/></video>
or even:
<video><model type='vga'/></video>
Usually the EFI boot entry/NVRAM is missing or wrong. Two common fixes:
1) Ensure you’re using UEFI (OVMF) and the guest actually has an EFI System Partition. 2) From the guest’s GRUB, confirm BLS/root is correct and regenerate if needed.
Attach the serial console:
sudo virsh console rhel10-fixed-uefi-gui
Optionally enable debug kernel args in the XML <cmdline> (commented in the XML).
Status: Verified working for RHEL 10 qcow2 (UEFI, GUI)
After migrating this platform: