In this article, we will see how to configure KVM to allow the transfer of SMBIOS information, such as UUID and serial numbers, to the Windows subsystem. This process is essential to ensure that the virtualized operating system can access the correct hardware information and perform operations that depend on this data.
Before starting, make sure you have:
OVMF package installed to enable UEFI support.First, we need to create a copy of the UEFI variable file specific to the VM. This avoids conflicts between VMs and allows you to retain personalized UEFI settings.
sudo cp /usr/share/OVMF/OVMF_VARS_4M.fd /var/lib/libvirt/qemu/nvram/MNGMT_VARS.fd
sudo chmod 644 /var/lib/libvirt/qemu/nvram/MNGMT_VARS.fd
Edit the XML configuration of your virtual machine using the command virsh edit VM_NAME. Add or modify the <os> section as follows:
<os>
<type arch="x86_64" machine="pc-q35-8.2">hvm</type>
<loader readonly="yes" type="pflash">/usr/share/OVMF/OVMF_CODE_4M.fd</loader>
<nvram>/var/lib/libvirt/qemu/nvram/MNGMT_VARS.fd</nvram>
<smbios mode="sysinfo"/>
</os>
Ensure that the boot disk is correctly configured in the XML file:
<disk type="file" device="disk">
<driver name="qemu" type="raw"/>
<source file="/SDD4TB/vm/MNGMT.img"/>
<target dev="sda" bus="sata"/>
<boot order="1"/>
</disk>
Access the VM BIOS during startup and check that the boot order is correct.
After making the changes, restart the libvirt service:
sudo systemctl restart libvirtd
Start the virtual machine with the following command:
sudo virsh start MNGMT
If the VM does not boot the operating system, follow these steps for troubleshooting:
After properly configuring the VM, boot into Windows and verify the transfer of SMBIOS information by running the following commands:
wmic csproduct get UUID
wmic bios get serialnumber
By following these steps, you can enable the transfer of SMBIOS information from your KVM virtual machine to the Windows operating system. This is essential to ensure that applications and services that rely on this information function correctly within the VM.