Link to home
Start Free TrialLog in
Avatar of roy_batty
roy_battyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How to windows activate server 2012 VM

I have a Windows Server 2012 R2 Standard running as a hypervisor. Which then has one guest VM running Server 2012 R2 Standard. I have now created a second VM, also running Server 2012 R2 Standard.

I used a iso from my vlc. I know that the host OS licence covers the two guest VMs too.

The new VM will not activate, When I click to activate I get ask for a licence key. I didnt install hyper V server myself and dont have any licence key documentation.

How can I get this machine activated?
Avatar of Cliff Galiher
Cliff Galiher
Flag of United States of America image

If you have a volume license, the key is in the VL portal. While a standard license does indeed cover two VMs, you still need to use keys in the portal to activate the VMs. The host does not do so automatically on standard.
Avatar of roy_batty

ASKER

OK I only used the VLSC to download the media. The key I have is for someone else.

So I used this https://nedimmehic.org/2017/02/17/how-to-find-windows-product-key-allversions-of-windows/ 

to get the licence key used on the hyper-v server. When I tried to use that on teh new VM it says that it didnt work.

Any suggestions?
If you have legal licenses  you have legal keys documented somewhere. Nobody here can tell you where that is. And I don't recommend using key extracters or other random keys. That's legally and ethically pretty much a stretch for me. My only advice is find your legally issued key(s.)

I don't even recommend using VL media to install the OS if it is an OEM license. That's called reimaging and is also illegal  as that is not an OEM right.
SOLUTION
Avatar of Mahesh
Mahesh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you may use below code and save it in vbs extension and run on host server to find out key
run it from elevated command prompt
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))

Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
Do
Cur = Cur * 256
Cur = Key(x + KeyOffset) + Cur
Key(x + KeyOffset) = (Cur \ 24) And 255
Cur = Cur Mod 24
x = x -1
Loop While x >= 0
i = i -1
KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
If (((29 - i) Mod 6) = 0) And (i <> -1) Then
i = i -1
KeyOutput = "-" & KeyOutput
End If
Loop While i >= 0
ConvertToKey = KeyOutput
End Function

Open in new window

original source:
https://www.howtogeek.com/206329/how-to-find-your-lost-windows-or-office-product-keys/
OK done that. Mahesh's script gave me same key I had found myself earlier.

Tried using this key via the Slmgr commands mentioned above. I get as far as applying the code and it fails with an error 0XC004F050 The software licensing service reported that the product key is invalid.

Is this happening because I used volume licence media to install the VM when originally the hyper-v host server was an OEM licence?
Then try to activate host with OEM key
Replace VL key with OEM and then try same procedure with guest VMs
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My solution is what actually worked in the end