Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Linux / Installing an Open Source KMS Server (Vlmcsd) on Linux

March 16, 2022 LinuxMS OfficeWindows 10Windows Server 2019

Installing an Open Source KMS Server (Vlmcsd) on Linux

There is an interesting open-source project on GitHub called vlmcsd (https://github.com/Wind4/vlmcsd) to emulate Microsoft’s KMS activation server. You can use it to deploy your own KMS server on platforms other than Windows Server (thus, you can save on a Windows Server license if you don’t use it). You can install such a KMS server on Linux, Android, FreeBSD, macOS, etc. In this article, we’ll show you how to install vlmcsd-based KMS on a Linux host and use it to activate computers running desktop Windows editions, Windows Server, and Microsoft Office on your local network.

Disclaimer. This article is provided for educational/lab purposes only and does not suppose using the product to illegally activate Windows or Office. The WindowsOSHub Project reminds you not to use unlicensed (pirated) software in any form.

Before you start, we recommend that you familiarize yourself with Microsoft KMS Volume Activation technology. Almost all the necessary information can be found in the Microsoft KMS Volume Activation FAQ.

In this example, we are using Red Hat Enterprise Linux 8 (RHEL) to deploy the KMS host, but you can use any other OSs, such as Ubuntu, Debian, CentOS, Rocky Linux. or even your NAS device (there are some examples of successful installation to a Synology NAS server).

Connect to your Linux server and use the yum (dnf) package manager to install the git and gcc packages:

# dnf update
# dnf install git gcc

Then clone and install the vlmcsd package:

# git clone https://github.com/Wind4/vlmcsd

Install vlmcsd on Linux

# cd vlmcsd
# make

Linux build KMS server

Change to the bin directory:

# cd bin

Run the KMS server:

# ./vlmcsd

Running KMS server emulator on Linux

You will see the following message:

Connecting to 127.0.0.1:1688 ... successful
Sending activation request (KMS V6) 1 of 1 -> 55041-00206-559-475403-03-1076-6002.0000-1482020 (3A1C049600B60076)

It means that you have successfully compiled and run the KMS server on Linux.

By default, vlmcsd listens on a default KMS port TCP/1688. So, you have to open the port in your Linux firewall to allow clients to connect to it. For firewalld, run the commands below:

# firewall-cmd --zone=public --permanent --add-port=1688/tcp
# firewall-cmd –reload

Make sure that port 1688 is open:

# firewall-cmd --list-port
# netstat -ntlp | grep LISTEN

open port 1688 kms server

To run vlmcsd automatically, you can create your own daemon and manage it using systemd.

# cp vlmcs /usr/bin
# touch /etc/systemd/system/kms-script.service
# chmod 664 /etc/systemd/system/kms-script.service
# nano /etc/systemd/system/kms-script.service

Add the following service description to the file:

[Unit]
Description=MSFT KMS Server Emulator
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/bin/vlmcsd
RemainAfterExit=yes
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target

Then run the KMS service and add it to startup:

# systemctl daemon-reload
# systemctl start kms-script.service
# systemctl status kms-script.service
# systemctl enable kms-script.service

run your own KMS server on LInux to activate Windows and Office

You can set advanced KMS server options through the vlmcsd.ini (there is a sample file in ../vlmcsd/etc/). There you can also set a path to the KMS server log file (vlmcsd.log). You can set file paths in the vlmcsd startup options using the following options:

-i /etc/vlmcsd.ini
-l /var/log/vlmcsd.log

You can also run the KMS server in a docker container:
sudo docker pull mikolatero/vlmcsd
sudo docker run -d -p 1688:1688 --restart=always --name kms_server mikolatero/vlmcsd /vlmcsd -D -d -t 3 -e -v -R172800 -A10080

If you are using Microsoft DNS, you can create a _VLMCS record that will allow Windows clients to automatically find a KMS server in the domain. To create a DNS SRV record, use the following PowerShell command:

Add-DnsServerResourceRecord -Srv -Name "_VLMCS._tcp" -ZoneName "woshub.com" -DomainName "192.168.14.147" -Priority 0 -Weight 0 -Port 1688

where 192.168.14.147 is an IP address of your Linux host KMS service is running on.

Then all Windows (and Office) hosts in your domain will be automatically activated on your KMS server if they have a public GVLK installed on them. A complete list of GVLK (Generic Volume License Keys) to activate all available Windows versions is published on the Microsoft website: https://docs.microsoft.com/en-us/windows-server/get-started/kms-client-activation-keys.

For example, find GVLK to activate Windows Server 2022 Standard (VDYBN-27WPP-V4HQT-9VMD4-VMK7H) and Windows 10 Pro (W269N-WFGWX-YVC9B-4J6C9-T83GX) on this page.

To activate Windows manually, set the GVLK for your Windows version, the IP address of your KMS activation host, and run the activation command. The following commands are used (for example, for Windows Server 2022 Standard):

slmgr.vbs -ipk VDYBN-27WPP-V4HQT-9VMD4-VMK7H
slmgr.vbs -skms 192.168.14.147
slmgr.vbs -ato

After you run the last command, you will see the message: Product activated successfully. This means that your Windows copy has been successfully activated.

activate windows on KMS host

You can check the Windows activation status using the command:

slmgr.vbs -dlv

In my example, an error occurred while activating Windows Server:

Error: 0xC004F069 On a computer running Microsoft Windows non-core edition, run 'slui.exe 0x2a 0xC004F069' to display the error text.

The reason is that I have an evaluation version of Windows Server 2022 installed. First, you need to convert it to a Standard version according to this article:

dism /online /set-edition:serverstandard /productkey:VDYBN-27WPP-V4HQT-9VMD4-VMK7H /accepteula

Then I can activate my Windows instance on the KMS host.

In the same way, you can activate volume versions of Microsoft Office 2019/2016/2013 on your KMS host. The following commands are used:

cd C:\Program Files\Microsoft Office\Office16
cscript ospp.vbs /sethst: 192.168.14.147
cscript ospp.vbs /act

To check Office activation status:

cscript ospp.vbs /dstatusall

Learn more about Microsoft Office KMS activation.

So we have shown how to deploy a KMS server on Linux and activate all Windows versions including the latest Windows Server 2022 and Windows 11.

4 comments
4
Facebook Twitter Google + Pinterest
previous post
Managing Hyper-V Virtual Machines with PowerShell
next post
How to Install Windows 11 on a Hyper-V Virtual Machine?

Related Reading

Configuring Event Viewer Log Size on Windows

May 24, 2023

How to Detect Who Changed the File/Folder NTFS...

May 24, 2023

Enable Single Sign-On (SSO) Authentication on RDS Windows...

May 23, 2023

Allow Non-admin Users RDP Access to Windows Server

May 22, 2023

How to Create, Change, and Remove Local Users...

May 17, 2023

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Configuring Event Viewer Log Size on Windows

    May 24, 2023
  • How to Detect Who Changed the File/Folder NTFS Permissions on Windows?

    May 24, 2023
  • Enable Single Sign-On (SSO) Authentication on RDS Windows Server

    May 23, 2023
  • Allow Non-admin Users RDP Access to Windows Server

    May 22, 2023
  • How to Create, Change, and Remove Local Users or Groups with PowerShell?

    May 17, 2023
  • Fix: BSOD Error 0x0000007B (INACCESSABLE_BOOT_DEVICE) on Windows

    May 16, 2023
  • View Success and Failed Local Logon Attempts on Windows

    May 2, 2023
  • Fix: “Something Went Wrong” Error When Installing Teams

    May 2, 2023
  • Querying Windows Event Logs with PowerShell

    May 2, 2023
  • Configure Windows LAPS (Local Administrator Passwords Solution) in AD

    April 25, 2023

Follow us

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Access VMFS Datastore from Linux, Windows, or ESXi?
  • Using iPerf to Test Network Speed and Bandwidth
  • How to Enable Two-Factor Authentication (2FA) for SSH on Linux?
  • Install and Configure SNMP on RHEL/CentOS/Fedor
  • How to Fix the ‘Too Many Open Files’ Error in Linux?
  • Installing PowerShell Core on Linux Distros
  • Adding Trusted Root Certificates on Linux
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top