Skip to content

Instantly share code, notes, and snippets.

@Informatic
Last active April 15, 2026 22:13
Show Gist options
  • Select an option

  • Save Informatic/49bd034d43e054bd1d8d4fec38c305ec to your computer and use it in GitHub Desktop.

Select an option

Save Informatic/49bd034d43e054bd1d8d4fec38c305ec to your computer and use it in GitHub Desktop.
How to use Windows 10 OEM license in libvirt VM (<smbios mode='host' /> does not work as Windows seems to verify UUID; apparmor/security configuration changes may be needed)
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<!-- ... -->
<qemu:commandline>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/slic.bin'/>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/msdm.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='file=/some/path/smbios_type_0.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='file=/some/path/smbios_type_1.bin'/>
</qemu:commandline>
</domain>
#!/bin/bash
set -e
cat /sys/firmware/acpi/tables/SLIC > slic.bin
cat /sys/firmware/acpi/tables/MSDM > msdm.bin
dmidecode -t 0 -u | grep $'^\t\t[^"]' | xargs -n1 | perl -lne 'printf "%c", hex($_)' > smbios_type_0.bin
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
@sun-jiao

sun-jiao commented Dec 4, 2023

Copy link
Copy Markdown

@sun-jiao it depends on the hardware how it is implemented. It is also probably different for different OS versions (depending what OS the OEM licence is for). Technically all that is required for OEM licence to work is a machine unique ID (which is then used to activate over the internet), but some computers also have a digital signature that can be verified by the Microsoft cert.

Thanks. I am wondering if it's possible to write a SLIC file manually based on the infos displayed in UEFI.

@juresaht2

Copy link
Copy Markdown

Thanks. I am wondering if it's possible to write a SLIC file manually based on the infos displayed in UEFI.

Why? If your licence is activated and the file does not exist then it is not used.

@sun-jiao

sun-jiao commented Dec 4, 2023

Copy link
Copy Markdown

Thanks. I am wondering if it's possible to write a SLIC file manually based on the infos displayed in UEFI.

Why? If your licence is activated and the file does not exist then it is not used.

OK, I have understood now.

@xrobau

xrobau commented Feb 25, 2024

Copy link
Copy Markdown

Note that this is a much better (and doesn't accidentally corrupt) way to generate the smbios extracts:

dmidecode -t 0 -u | awk '/^\t\t[0-9A-F][0-9A-F]( |$)/' | xxd -r -p > smbios_type_0.bin
dmidecode -t 1 -u | awk '/^\t\t[0-9A-F][0-9A-F]( |$)/' | xxd -r -p > smbios_type_1.bin

@xrobau

xrobau commented Apr 7, 2024

Copy link
Copy Markdown

@JL2210

JL2210 commented Aug 23, 2024

Copy link
Copy Markdown

slic doesn't exist for me, do I just remove it or is there an alternative?

@juresaht2

Copy link
Copy Markdown

slic doesn't exist for me, do I just remove it or is there an alternative?

This is expected for newer windows versions. Just skip it and use what you have.

@aarmea

aarmea commented Feb 7, 2026

Copy link
Copy Markdown

If you're using virt-manager and the configuration is not applying, or if you then drop down to virsh and it fails with:

$ virsh -c qemu:///system edit win11
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
Element domain has extra content: qemu:commandline

Failed. Try again? [y,n,i,f,?]: 

keep in mind that the xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0' at the root of the configuration is not fluff and is likely missing from yours. After I added this manually and booted the VM, Windows 11 activated for me.

@shazrin

shazrin commented Mar 14, 2026

Copy link
Copy Markdown

I'm getting some errors when try to dump the smbios_type_1.bin table. My laptop is a Dell G5 5590.

dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
Wide character in printf at -e line 1, <> line 58.
Wide character in printf at -e line 1, <> line 64.

Is it really needed? Is any workaround?

Using perl's catch-all -CSDA approach works for me..
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | perl -CSDA -lne 'printf "%c", hex($_)' > smbios_type_1.bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment