惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
K
Kaspersky official blog
A
Arctic Wolf
Attack and Defense Labs
Attack and Defense Labs
L
LINUX DO - 热门话题
N
News | PayPal Newsroom
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
L
Lohrmann on Cybersecurity
PCI Perspectives
PCI Perspectives
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
The Last Watchdog
The Last Watchdog
B
Blog RSS Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
W
WeLiveSecurity
Know Your Adversary
Know Your Adversary
博客园 - Franky
T
Tenable Blog
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Help Net Security
Help Net Security
WordPress大学
WordPress大学
T
The Exploit Database - CXSecurity.com
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
D
Darknet – Hacking Tools, Hacker News & Cyber Security
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
S
Security Affairs
J
Java Code Geeks
小众软件
小众软件
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Apple Machine Learning Research
Apple Machine Learning Research
NISL@THU
NISL@THU
O
OpenAI News
The Cloudflare Blog
月光博客
月光博客
Google Online Security Blog
Google Online Security Blog
V
V2EX
罗磊的独立博客
美团技术团队
博客园 - 三生石上(FineUI控件)
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cyberwarzone
Cyberwarzone
L
LINUX DO - 最新话题
Hacker News - Newest:
Hacker News - Newest: "LLM"
大猫的无限游戏
大猫的无限游戏

czp's blog

Ubuntu 下使用 zsh · HonKit 使用 VNC 来远程管理服务器 · HonKit Linux 下无限试用 JetBrains · HonKit 为 KVM 中的 Windows 虚拟机启用 VirtIO · HonKit 在 Spring Boot 中处理 MissingKotlinParameterException · HonKit 用 Spring Native 拯救微服务 · HonKit 正确调试 PHP · HonKit Ubuntu 增加最大文件打开数量限制 · HonKit 将 Minecraft 服务端编译到 native · HonKit 用凝聚力购买 P 社游戏 DLC · HonKit 模拟超星网课 Android 客户端 · HonKit 模拟 Bilibili Android 客户端 · HonKit 模拟哔咔 Android 客户端 · HonKit 异步是什么 · HonKit GCP Pub/Sub push 至 IAP 保护的 Endpoint · HonKit 部署 Spring Native 到 GCP App Engine · HonKit 多个 Gradle SubProject 同时编译导致 CI/CD 内存耗尽 · HonKit Google Cloud Build 运行 DIND · HonKit 在 Google Storage 中部署 SPA · HonKit Terraform 不自动更新 CloudRun service · HonKit Telegram Bot 收不到普通群聊消息的问题 · HonKit 加密货币交易 · HonKit 挖掘以太坊 · HonKit 挖掘门罗币 · HonKit 小明学英语 · HonKit 卖程序的小女孩 · HonKit 一个测试工程师走进一家酒吧 · HonKit 我给你们讲个 TCP 笑话吧! · HonKit 我给你们讲个 UDP 笑话吧! · HonKit 格局打开 · HonKit c 语言常见未定义行为 · HonKit 在 Kotlin 使用 SpaceEngineers Remote API · HonKit Kotlin 协程 · HonKit 在 Spring Boot 中正确注册 Jackson Module · HonKit Spring Boot Jpa 使用 Google Cloud SQL · HonKit Spring Boot 中配置单页应用 · HonKit Spring Boot 无法加载 ClasspathResource 问题 · HonKit 正确打包 Spring Boot 到 war · HonKit czp's blog · HonKit 鸣谢列表 · HonKit 友链 · HonKit
使用 KMS 激活 Windows · HonKit
2026-04-11 · via czp's blog

在很多情况下, 出于不可抗力, 必须使用 Windows 系统, 于是如何激活就成了一个问题. 特别是在虚拟机中使用 Windows, 个人用户不可能为每个虚拟机都购买一次授权.

那么那些云服务商, 是怎么为用户激活 Windows 系统的呢, 很简单, 使用 KMS.

KMS 是微软提供的一种激活解决方案(不只是系统, 还包括 office 软件), 用于让购买了企业授权的公司能够批量激活自己公司内的计算机. 微软会给与购买了授权的企业一个程序, 企业将此程序部署在公司内网. 最终用户只需要接入此 KMS 服务器, 并输入对应操作系统版本的 KMS 专用的固定序列号(GVLK key), 就可以激活 Windows.

阿里云也正是那么做的, 阿里云内网的 KMS 服务器 kms.cloud.aliyuncs.com (指向 100.100.3.8).

当然, KMS 已经使用了那么多年, 自然也有第三方编写的模拟程序, 例如 https://github.com/SystemRage/py-kms

使用以下命令在一台 Linux 服务器上部署模拟程序

git clone https://github.com/SystemRage/py-kms
cd py-kms/py-kms
python pykms_Server.py

如果有防火墙, 则必须放行 1688 端口.

现在我们打开需要激活的 Windows, 使用管理员权限运行 Powershell

slmgr /upk
slmgr /skms kms.hiczp.com

第一条命令用于清空当前已设置的产品序列号(如果有的话), 第二条命令的最后一个参数是刚才部署的模拟程序地址.

接下去我们必须要知道自己的 Windows 版本, 使用如下命令来查看

DISM /online /Get-CurrentEdition

然后到 https://docs.microsoft.com/en-us/windows-server/get-started/kms-client-activation-keys 找到对应的 KMS 序列号. 一部分非 Server 系统在这个页面找不到, 请到这里找 https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/jj612867(v=ws.11)) 其他产品详见 https://py-kms.readthedocs.io/en/latest/Documentation.html#about-gvlk-keys

使用以下命令来设置对应的序列号

slmgr /ipk N69G4-B89J2-4G8F4-WWYCC-J464C

立即连接 KMS 服务器并激活

slmgr /ato

还可以使用命令来查看激活状态

slmgr /dli

如果使用的是评估版本 Windows Server, 则必须在清除原密钥并设定 KMS 服务器后首先进行版本转换, 使用以下命令来查看可以转换至的版本

DISM /online /Get-TargetEditions

例如可以转换至 ServerStandardServerDatacenter.

选择一个想要转换至的版本, 然后在刚才的页面上查找得到目标版本的 KMS 序列号, 键入如下命令

DISM /Online /Set-Edition:ServerStandard /ProductKey:N69G4-B89J2-4G8F4-WWYCC-J464C /AcceptEula

Set-Edition 的值为想要转换至的版本, ProductKey 为想要转换至的版本对应的 KMS 序列号.

转换完成后将提示重启计算机, 输入 y 立即重启. 重启之后将自动连接 KMS 服务器进行激活, 如果没有则手动使用命令

slmgr /ato

这样, Windows 就激活了.