How do I resolve a Windows activation fail message on my Amazon EC2 Windows instance?
I want to resolve a Windows activation fail message on my Amazon Elastic Compute Cloud (Amazon EC2) Windows instance.
Short description
Windows instances use Microsoft Key Management Service (Microsoft KMS) on AWS for activation. If your instance can't reach the Microsoft KMS server, then you might receive a Windows activation error message. For more Information, see Understanding KMS on the Microsoft Learn website.
Resolution
To resolve a Windows activation failure on an Amazon EC2 instance, complete one of the following:
- Use an AWS Systems Manager Automation document to activate Windows.
- Manually activate Windows.
- Troubleshoot an "Unable to Activate Windows" error.
Use an AWS Systems Manager Automation document to activate Windows
The AWSSupport-ActivateWindowsWithAmazonLicense automation document activates an Amazon EC2 Windows instance with an Amazon-provided license. The automation checks the current status of Windows for your instance, and then activates Windows if its status is inactive.
Note: You can't use the AWSSupport-ActivateWindowsWithAmazonLicense automation document to activate Bring Your Own License (BYOL) Windows instances. To use your own license, see Microsoft licensing on AWS.
To use an AWS Systems Manager Automation document to activate Windows, complete the following steps:
- Open the AWS Systems Manager console. Be sure to select the same AWS Region as the Amazon EC2 Windows instance that needs to be activated.
- In the navigation pane, choose Automation, and then choose Execute automation.
- In the search field, enter ActivateWindowsWithAmazonLicense.
- Select the AWSSupport-ActivateWindowsWithAmazonLicense Automation document, and then choose Next.
- For Execute automation document, choose Simple execution.
- For Input parameters, turn on Show interactive instance picker.
- Choose your Amazon EC2 instance, and then proceed to step 9. If you don't see your instance in the list, then proceed to step 8.
- Configure AWS Systems Manager for your Amazon EC2 instance.
-or-
If you can't configure AWS Systems Manager or if the instance isn't available for Input parameters, then turn off Show interactive instance picker.
For InstanceID, enter the ID for your Amazon EC2 instance.
For AllowOffline, choose True.
Note: If you set AllowOffline to True, then your Amazon EC2 will stop and then restart. After Amazon EC2 restarts, the data in your instance store volumes will be deleted. Also, if you don't use an Elastic IP address, then your public IP address will change. - Choose Execute.
To monitor AWS Systems Manager's progress, complete the following:
- Open the AWS Systems Manger console.
- From the navigation pane, choose Automation.
- Choose the running automation, and then choose Executed steps.
- To view the automation's output, choose Outputs.
Manually activate Windows
Complete the following based on the version of Windows Server that your instance uses and the Amazon EC2 configuration tool that's installed:
Windows Server 2016 or 2019
-
Verify that the latest version of EC2Launch v1 is installed.
-
Open PowerShell as an administrator.
-
Import the EC2Launch module:
Import-Module "C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Ec2Launch.psd1"
-
Add the routes:
Add-Routes
-
Set the activation settings:
Set-ActivationSettings
-
Activate Windows:
slmgr /ato
Windows Server 2022 or instances with EC2Launch v2 installed
-
Verify that the latest version of EC2Launch v2 is installed.
Note: EC2Launch v2 is installed by default on instances that use Windows Server 2022. -
Open PowerShell as an administrator.
-
Restart EC2Launch v2:
Net Restart "Amazon EC2Launch"
Note: When EC2Launch v2 restarts, it automatically resets the OS-level routes.
-
If Windows doesn't activate, then check the network communication from the instance to the Microsoft KMS server.
-
Perform telnet from your Amazon EC2 instance to the Microsoft KMS servers , and then open PowerShell.
-
Run the following commands:
Test-netconnection 169.254.169.250 -Port 1688 Test-netconnection 169.254.169.251 -Port 1688
-
Confirm that the connection status output is TcpTestSuccessed=True. If the connection status output is False, then verify that the following registry keys have the correct Microsoft KMS values:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform KeyManagementServiceName - 169.254.169.250 KeyManagementServicePort - 1688
Note: You can also enter 169.254.169.251 as the KeyManagementServiceName value.
-
Repeat step 6. If the connection status output is False, then check the Amazon Time Sync Service on your Amazon EC2 instance.
Troubleshoot an "Unable to Activate Windows" error
If you launch a Windows instance from an Amazon Elastic Block Store (Amazon EBS) snapshot, then you might receive the error "A problem occurred when Windows tried to activate. Error Code 0xC004F074". To troubleshoot this error, see "Unable to activate Windows".
Note: Amazon EBS snapshots are supported only for Linux instances.
Related information
Upgrade PV drivers on EC2 Windows instances
How do I troubleshoot time issues with my EC2 Windows instance?
Relevant content
- asked 7 months agolg...
- asked 4 months agolg...
- asked 2 years agolg...
- asked a year agolg...
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago