- In the host (real hardware), obtain the data to pass through:
function DMI { # Get DMI value and XML-escape it sudo sed \ 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g' \ "/sys/class/dmi/id/$1" } cat <<EOF && unset -f DMI <qemu:commandline> <qemu:arg value="-smbios"/> <qemu:arg value="type=1,manufacturer=$(DMI sys_vendor),product=$(DMI product_name),\ version=$(DMI product_version),serial=$(DMI product_serial),uuid=$(DMI product_uuid),\ sku=$(DMI product_sku),family=$(DMI product_family)"/> </qemu:commandline> EOF
- Open Virtual Machine Manager, go to Edit ➔ Preferences ➔ General and ensure Enable XML editing is ON
- Shut down the VM
- Go to the VM Details view (where you can add or remove hardware)
- Open the XML tab, and add the following
qemu
XML namespace to<domain>
(if not already present):<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm"> <!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ add this if not present -->
- Somewhere inside
<domain>
, paste the output generated at STEP 1, for example:<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm"> <name>VM_NAME</name> <uuid>VM_UUID</uuid> <qemu:commandline> <qemu:arg value="-smbios"/> <qemu:arg value="type=1,manufacturer=XXXXXXXX,product=XXXXXXXX,version=XXXXXXXX,serial=XXXXXXXX,uuid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,sku=XXXXXXXX,family=XXXXXXXX"/> </qemu:commandline> <!-- Rest of the values [...] --> </domain>
- Click Apply and make sure the
<qemu:commandline>
element isn't deleted (in my case it was moved to the end of the XML) - Power on the VM again
Last active
June 11, 2025 13:48
-
-
Save franferrax/bfd5d047be56a8b4acf033de10295a6b to your computer and use it in GitHub Desktop.
Passthrough the host BIOS DMI info to a QEMU VM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment