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

推荐订阅源

Spread Privacy
Spread Privacy
P
Palo Alto Networks Blog
P
Proofpoint News Feed
AI
AI
Help Net Security
Help Net Security
S
Securelist
T
Troy Hunt's Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
Cisco Blogs
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
Vercel News
Vercel News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
B
Blog
GbyAI
GbyAI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed
S
Security Affairs
Cisco Talos Blog
Cisco Talos Blog
AWS News Blog
AWS News Blog
T
Tenable Blog
H
Help Net Security
NISL@THU
NISL@THU
F
Fortinet All Blogs
博客园_首页
G
GRAHAM CLULEY
L
LINUX DO - 最新话题
P
Privacy International News Feed
G
Google Developers Blog
博客园 - Franky
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Security Archives - TechRepublic
Security Archives - TechRepublic
The Register - Security
The Register - Security
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
T
Tor Project blog
P
Privacy & Cybersecurity Law Blog
量子位
C
Cyber Attacks, Cyber Crime and Cyber Security
Forbes - Security
Forbes - Security
S
Secure Thoughts
Simon Willison's Weblog
Simon Willison's Weblog
D
Docker
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
L
Lohrmann on Cybersecurity
T
Tailwind CSS Blog

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 就激活了.