Stuck with Amazon EC2 instance windows activation failure? We can help you.
Often our customers report to us that they get a “Windows activation failed” message on their Amazon EC2 Windows instance.
Here at Bobcares, we handle requests from our customers to fix similar issues as a part of our Server Management Services.
Today let’s see how our Support Engineers fix this for our customers.
How to fix Amazon EC2 instance windows activation failure
Windows instances use Microsoft Key Management Service (KMS) on AWS for activation.
We may end up with this Windows activation error when the instance can’t reach the KMS server. Also, if there is an issue with the KMS client configuration we will get this error.
Methods to fix this error
Following are two methods that can help us fix this issue:
Activate Windows using a Systems Manager Automation document
The Automation document activates an Amazon EC2 Windows instance with a license provided by Amazon. Also, it checks the current status of Windows for the instance and then activates Windows if the status is inactive.
1. Firstly we have to open the AWS Systems Manager console.
Note: We must ensure to select the same Region as the EC2 Windows instance that requires activation.
2. Then choose Automation, click on Execute automation.
3. After that search for ActivateWindowsWithAmazonLicense.
4. And click on AWSSupport-ActivateWindowsWithAmazonLicense Automation document, then choose Next.
5. Next, for Execute automation document, we must select Simple execution.
6. Then for Input parameters, we must turn on Show interactive instance picker.
7. After that we can select our EC2 instance.
Note: If we can’t find the instance in the list, then it isn’t enabled for Systems Manager.
If we don’t want to enable Systems Manager, or if the instance isn’t available in Input parameters, we can turn off Show interactive instance picker.
For InstanceID, we can enter the ID for our impaired instance. For AllowOffline, we can choose True.
8. Now, select Execute.
9. To monitor the execution progress, we can open the Systems Manager console, and then choose Automation from the navigation pane.
Activate Windows manually
1. Firstly, we must update EC2Config, or run the EC2Launch initialization script.
Windows Server 2012 R2 and earlier:
We must update EC2Config, and then restart the instance.
Windows Server 2016 and later:
We can run the following command to set the correct route to the KMS server:
PS C:>Import-Module "C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Ec2Launch.psd1" PS C:>Add-Routes PS C:>Set-ActivationSettings PS C:>slmgr /ato
If Windows still isn’t activated, we can proceed with step 2.
2. Since KMS runs on port 1688 as TCP traffic we must ensure to add an exception to allow KMS traffic on any firewall or security software that controls outbound connections from our instance.
3. To set up the Windows KMS setup key we can run the following command as administrator:
slmgr.vbs /ipk <KMSSetupKey>
5. Then to set our Windows KMS machine IP address we can run the following command as administrator:
slmgr.vbs /skms 169.254.169.250:1688
5. Finally to activate Windows we can run the following command as administrator:
[Need assistance? We can help you]
To conclude, we saw the steps that our Support Techs follow to fix Amazon EC2 instance windows activation failure.