8

I just bought a new laptop. The first thing I did was take out the unbooted OEM Windows-10 hard disk and put in my pre-existing Linux hard disk from my last laptop. So far so good.

The OEM drive is now attached to my (new) laptop via USB, and I see 5 partitions:

/dev/sdb1        2048     534527     532480   260M EF00 EFI System
/dev/sdb2      534528     567295      32768    16M 0C01 Microsoft reserved
/dev/sdb3      567296 1918849023 1918281728 914.7G 0700 Microsoft basic data
/dev/sdb4  1918849024 1920856063    2007040   980M 2700 Windows recovery environment
/dev/sdb5  1920856064 1953511423   32655360  15.6G 0700nMicrosoft basic data

What I'd like to do is take that hard disk and import the image(s) somehow into VirtualBox 5.2.8 (in a dynamic-sized vdi, because I don't have 1TB to spare) as though I had booted the laptop for the first time the way Microsoft expected me to. Ideally, this would leave the actual hard drive in its current pristine and unbooted condition. Unfortunately, between VirtualBox, UEFI, and the lack of installation CD, I don't know how Windows gets installed anymore.

Is it possible to do what I'm trying to do, and if so, can somebody guide me?

(At this time, I'm not looking at licensing issues. I'll jump off that bridge when I come to it. Right now, I just want to install.)

hymie
  • 1,276

1 Answers1

15

You can activate Windows 10 using the product key for your hardware which is embedded in the BIOS in an ACPI table called MSDM (Microsoft Data Management). You can get it like this (from Linux, of course!):

$ sudo tail -c +56 /sys/firmware/acpi/tables/MSDM
ABA2D-TEFJ4-D97PT-9B42Y-H3U5E

You can apply the OEM Windows license to a VirtualBox guest like this (from the Linux host - assuming VM is called win10):

$ sudo cat /sys/firmware/acpi/tables/MSDM > ~/VirtualBox\ VMs/win10/msdm.bin
$ VBoxManage setextradata win10 \
               "VBoxInternal/Devices/acpi/0/Config/CustomTable" \
               ~/VirtualBox\ VMs/win10/msdm.bin

With that in place, Windows will not ask for a product key during installation, it will activate automatically. If you want to verify that it does indeed use the correct key you can use a tool like ShowKeyPlus to check it. You can read about ShowKeyPlus on TenForums or download it here.

This method of activation works fine with the official download ISO that you can download for free from Microsoft. Because you can use your OEM license with a clean install, I wonder whether migrating is worth the bother.

The other way to do it which also works is to get the key as shown above and then type it in when Windows asks for it. I used this method with KVM/QEMU because I haven't (yet) worked out how to apply the MSDM table to it.

On the subject of licensing... The Windows OEM license (which, as I write, was last updated July 2017) suggests that it is allowed:

Applicability. This agreement applies to the Windows software that is preinstalled on your device...

and, in particular, section 2.d.iv:

Use in a virtualized environment. This license allows you to install only one instance of the software for use on one device, whether that device is physical or virtual. If you want to use the software on more than one virtual device, you must obtain a separate license for each instance.

So you can install one instance of the Windows software that is preinstalled on your device for use on one device, whether that device is physical or virtual .

Also see this Microsoft community question which explains how to activate.

I will update this answer with further information when I have any

PS. There is another similar question here on SuperUser, and another one over on ServerFault.


The product key in the example is not real!

starfry
  • 1,697