22 July, 2018

ACPI SLIC in VirtualBox

SLIC table in VirtualBox


Having the need to run a few Windows applications in my Lenovo Carbon X1 - but unwillingly to dual-boot or in other ways run Windows natively, I decided to give VirtualBox a go.

My laptop came with Windows pre-installed, and is using the SLIC table as identification for activation of Windows.

  • Host OS: Ubuntu (Usually following the LTS releases)
  • Guest OS: Windows 10.

Getting SLIC information


In any recent Linux distribution, it is fairly easy to retrieve such information from the DMI tables.
This can be done using the dmidecode utility.

Getting product key from MSDM ACPI table

The SLIC table is used for identification when activation Windows in combination with a a product-key and a SLIC certificate. As with my Lenovo laptop, this product-key was embedded in the MSDM table - and can easily be extracted under Linux.

# Get product key from MSDM table ###########################
productKey=$(sudo hexdump -s 56 -e '/29 "%s\n"' /sys/firmware/acpi/tables/MSDM)
[ -z "$productKey" ] && errorHandle "Error fetching product key from acpi table MSDM"
echo "Your product key is: $productKey"
$zenity --info --height=70 --width=400 --text "Your product key is: $productKey"
############################################################


Setting SLIC information

In VirtualBox, this can be done using "vboxmanage setextradata" to configure "VBoxInternal/Devices/pcbios/0/Config"

Activating Windows

To use the SLIC and productkey table for activation, we need a SLIC certificate. If you already have Windows installed, there is ways to retrieve the same information - including the certificate using a SLIC_ToolKit.

As alternative, dumps of the certificates can be found for most hardware manufactures.

Start cmd.exe as administrator, and issue
  1. slmgr -ilc <path xrn.ms file>
  2. slmgr -ipk <your product key>


Putting it all together

A simple bash script should do the trick - and can easily be shared with people in the same situation as me.
The script setslic.sh can be downloaded from my github repository.
The basic idea of the script is modify the required "pcibios" for a selected VM, with the acquired information from dmidecode.

The steps are:
  1. Configure a VM in VirtualBox, and attach your Windows ISO
  2. Run this script to modify pcibios on the VM (The script will print your productkey - write it down)
  3. Start the VM, and install Windows (Choose "I do not have product key" when installing)
  4. When Windows is loaded, install the certificate and activate using the productkey

3 comments:

  1. Hello, if the installer asks for a product key, then the config is wrong, something is missing! I have successfully activated a vm with slp key but I did not use vbox.

    ReplyDelete
    Replies
    1. No, just choose "I do not have product key" when installing.
      And then use slmgr to apply the registration later.

      Delete
  2. Any idea how to do this in Hyper V on Windows 10?

    ReplyDelete

Danish PC keyboard layout on MacOS

As I am primarily a GNU/Linux user, and mostly just using MacOS at work - I do not own (or want to own) a MacOS specific keyboard at home. ...