Sometimes it may happen that a Windows Server fails with the Windows activation when this virtual machine runs on AWS. I’ve stumbled across this issue from time to time, and with some research and trial & error, I was able to fix it. I haven’t been able to figure out what is causing this problem yet. But at least there is a solution that works. The solution is to activate Windows manually, and maybe “force it to its luck”. The following steps should help you to solve such a Windows activation issue.
Activate Windows manually
NOTICE: This guide is for Windows Server 2016 and later.
Reset Windows Activation
- Start the Windows Registry Editor as administrator (right-click → run as administrator)
- Navigate to the following location:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform
- Go to the right panel and right-click on SkipRearm
- Select the Modify option and a dialogue box Edit DWORD 32-bit folder should appear
- Here set the Value Data to 1 and click the Ok option
- Restart the server now
It is important to restart the server at this step. Otherwise, the next steps will not work.
Reset Windows Activation timers
- Now go to the Start menu, and search for Powershell
- Select the run as an Administrator option
- Type the following command and press Enter:
slmgr.vbs /rearm
- Restart the server now
It is important to restart the server at this step. Otherwise, the next steps will not work.
Finally activate Windows
- Now go to the Start menu, and search for Powershell
- Select the run as an Administrator option
- Run the following commands:
- Press enter after each command
Import-Module "C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Ec2Launch.psd1" Add-Routes Set-ActivationSettings slmgr /ato
- Press enter after each command
- It might be needed to add a Generic Volume License Keys (GVLK) here. To get the key for the correct operating system, you may visit this Microsoft article.
- Enter the following command and press Enter
slmgr.vbs /ipk N69G4-B89J2-4G8F4-WWYCC-J464C
- Set the KMS server to the AWS KMS server with the following command:
slmgr.vbs /skms 169.254.169.250:1688
- Run the next command to activate Windows:
slmgr /ato
Information sources
The following guides and articles have been used to write this troubleshooting guide.