This topic describes the causes of and solutions to the issue that the Windows operating system on an Elastic Compute Service (ECS) instance fails to be activated.
Causes
By default, an activation script is configured for a Windows ECS instance. The instance runs the activation script and communicates with the Key Management Service (KMS) activation server to activate the operating system. The failure to activate the Windows operating system may occur due to the following reasons:
Software protection exceptions
Problem description
When you run the slmgr -ato
command to activate a Windows operating system, the following error message appears:
Run 'slui.exe 0x2a 0x80070002' to display the error text.
Cause
The Software Protection service is not started.
Solution
Before you modify the registry, make sure that you are familiar with the Windows operating system. To prevent system issues or data loss caused by accidental registry operations, we recommend that you create snapshots for the system disk and data disks on the instance before you modify the registry. For more information, see Create a snapshot for a disk.
Connect to a Windows ECS instance.
For more information, see Connect to a Windows instance by using a username and password.
In the lower-left corner of the system desktop, click the Server Manager icon. In the upper-right corner, choose Tools > Services. Find and double-click Software Protection.
In the dialog box that appears, click Start.
NoteIf the Software Protection service does not start as expected or is missing during system startup, perform the following steps to rebuild the service:
Run the
regedit
command to open the registry file, find and right-click theHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sppsvc
key, and then select Export to export the content to theC:\sppsvc_bak.reg
file for backup.Repeat the preceding step on a healthy ECS instance that runs the same Windows version as the faulty ECS instance to export the content of the
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sppsvc
file into the sppsvc_good.reg file.Copy and paste the preceding sppsvc_good.reg file to the faulty instance, and then double-click the file. Click Yes to confirm the file import. A success message is displayed, which indicates that the registry is imported. Start the Software Protection service and reactivate the Windows operating system.
If the issue persists, re-import the
C:\sppsvc_bak.reg
file that is backed up into the system.
Network exceptions
Problem description
The "Windows is not genuine" message appears in the lower-right corner of the system desktop. The following error message appears when you activate the Windows operating system of an ECS instance in a virtual private cloud (VPC) by following the procedure described in the How do I use KMS domain names to activate a Windows instance in a VPC? topic.
0xC004F074 The Software Licensing Service reported that the computer could not be activated. No Key Management Service (KMS) could be contacted.
Cause
A network issue occurs between the Windows ECS instance and the KMS activation server. As a result, the instance fails to communicate with the KMS activation server. The network issue may occur because the communication between the instance and the KMS activation server is blocked by the system firewall, an IP security policy, or other network security management software on the instance.
The KMS activation server uses the kms.cloud.aliyuncs.com domain name, TCP protocol, and port 1688.
Solution
Add <IP address of the KMS activation server> kms.cloud.aliyuncs.com to the C:\Windows\System32\drivers\etc\hosts file to allow the system to resolve the IP address of the KMS activation server.
NoteYou can run the
ping kms.cloud.aliyuncs.com
command to obtain the IP address of the KMS activation server.Check whether the system firewall blocks TCP port 1688 that is mapped to the kms.cloud.aliyuncs.com domain name. If the system firewall has an inbound or outbound rule that blocks TCP port 1688, right-click the corresponding rule, and then select Delete.
For information about how to view inbound and outbound rules, see the Add port rules section in the How to configure a firewall for remote connection to a Windows instance topic.
Check whether an IP security policy is configured to block access to the IP address that is mapped to the kms.cloud.aliyuncs.com domain name. If the policy exists, delete the policy.
For information about how to view IP security policies, see the Check whether IP security policies are set section in the When you ping the internet address of a Windows instance, the system prompts "general fault" topic.
Check whether other security software blocks access to TCP port 1688 that is mapped to the kms.cloud.aliyuncs.com domain name.
Run the
route print
command to check whether the internal routes on the instance are reachable. If an internal route is missing, add the route.After you complete the preceding troubleshooting, run the
telnet kms.cloud.aliyuncs.com
command on the instance and then reactivate the operating system.
Server clock asynchronization
Problem description
When you run the slmgr -ato
command to activate the Windows operating system, an error message appears, which indicates that activation fails.
Cause
The clock of the operating system on the instance must be synchronized with the clock on the KMS activation server. Clock asynchronization between the instance and the KMS activation server may cause a failure to activate the operating system.
Solution
Check whether the current system time is correct by clicking the clock icon in the lower-right corner of the system desktop. If the system time is significantly different, you can manually modify the system time configuration in the lower-right corner of the system desktop. You can also run the following commands to synchronize the clock, wait for clock synchronization to complete, and then activate the Windows operating system:
net start W32Time
w32tm /resync
A command output similar to the following one is displayed.
Exhausted disk space
Problem description
The "product key not found" error message appears when you activate the Windows operating system of an ECS instance.
Cause
The system disk of the instance may be exhausted. The space for system activation is insufficient.
Solution
Clean up the C disk to free disk space and then activate the Windows operating system.
Incorrect activation code
Problem description
The C004F015 error code appears during system activation.
Cause
The activation code does not match the version of the Windows operating system. The mismatch may occur during manual activation or modification.
Solution
Use the correct activation code based on the version of the Windows operating system that runs on the ECS instance. For information about activation codes provided by Microsoft, see KMS Client Setup Keys.
Run the
slmgr /ipk <$Setup_Key>
command to specify the correct activation code. Then, run theslmgr -ato
command to activate the Windows operating system.NoteReplace <$Setup_Key> with the system activation code.