Activating a KVM/QEMU Windows 10/11 Guest with a OEM Device License

Leduccc
3 min readNov 22, 2021

--

If you are like me and use your Windows Guest operating system for work, chances are that you may have to use Windows features that only work with a correctly activated system.

It used to be that simply having a Microsoft account with an active license was sufficient but Windows activation protocol has changed and now has trouble activating guest with OEM licenses.

Now you can get your license manually from your linux host using the dmidecode command and enter it into windows using the Activation GUI. This works but you may have to repeat those steps following configuration changes or a Windows Update. A better approach is to forward your host’s DMI/SMBios data to your guest machine using libvirt sysinfo tags.

Libvirt virsh command utility can translate your DMI data into sysinfo tag automatically so it’s as simple as running the command, copying the tags that you want and pasting them in your domain configuration.

$ sudo virsh sysinfo
<sysinfo type='smbios'>
<bios>
<entry name='vendor'>Dell Inc.</entry>
<entry name='version'>...</entry>
...
</bios>
<system>
...
</system>
...
</sysinfo>
## Link to complete output ##

However most of those tags are unnecessary for our purpose. Windows does extensive fingerprinting and we’re not going to provide necessary to perfectly mimic your host since Microsoft allows users to have a second activation on a virtual machine as part of its licensing term. All we need to do is provide a way for the activation software to link to your hardware license and for that only the VM uuid is necessary.

As such we will pass the following information:

  • bios — vendor, version, date, release
  • system —manufacturer, product, version, serial, uuid (Must match your VM uuid), sku, family
  • baseBoard— manufacturer, product, version, serial, asset, location
  • chassis— manufacturer, version, serial, asset, sku

Now completely fooling Windows activation into thinking its running on your host may be against Windows terms and requires you to dump some ACPI tables entries (See more details on that here). If you wanted to fully mimic your host you would also have to forward the following information:

  • Disk manufacturer, device id, model, serial (See this forum post)
  • RAM manufacturer, serial number, part number (Provided by virsh sysinfo)
  • SLIC ACPI Table entry (More info)
  • MSDM ACPI Table Entry (More info)

Guest domain

Note that you must set your domain’s os smbios tag mode to “sysinfo”, your domain uuid must match your sysinfo system uuid and your domain tag type and xmlsn:qemu attributes must match the only in the example below:

<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<uuid>YOUR-HARDWARE-UUID</uuid>
...
<sysinfo type='smbios'>
<bios>
<entry name='vendor'>....</entry>
...
</bios>
<system>
...
<entry name='uuid'>YOUR-HARDWARE-UUID</entry>
...
</system>
...
</sysinfo>
<os>
...
<smbios mode='sysinfo'/>
</os>
...
</domain>

Link to an example with ACPI SLIC and MSDM tables and disk ids forwarding

Final notes

Now it’s a shame that your VM internal uuid and its DMI representation must be matching because if you have multiple configurations for the same Windows installation then you won’t be able to run multiple VMs with the same uuid. Fortunately that doesn’t seem to be causing issue and if ever an activation problem arises you simply reactivate Windows by booting on your VM with the correct uuid.

Also, make sure your VM has a recognizable hostname as it will be listed in your Microsoft account if you choose to link it with your Windows installation.

Sources

--

--

Leduccc

I'm writing simple and accessible tutorials for all the aspiring computer scientists out there!