Key Management Service on Ubuntu 20.04

Getting started


  • Ubuntu 20.04 Server


sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install build-essential  git -y
cd /opt

Change to root

kms@svrkms:~$ sudo -s

Set your time zone

root@svrkvm:# date
Sat 11 Jan 21:22:53 GMT 2020
root@svrkvm:# sudo dpkg-reconfigure tzdata

Current default time zone: 'Europe/Paris'
Local time is now:      Sat Jan 11 22:24:07 CET 2020.
Universal Time is now:  Sat Jan 11 21:24:07 UTC 2020.

root@svrkvm:# date
Sat 11 Jan 22:24:16 CET 2020

Installing the KMS server

The KMS server is available as binaries or source code that needs to be compiled. Let us use the source code.

root@svrkvm:# sudo apt-get install build-essential  git -y

git clone the KMS server source code:

administrator@kms:~$ git clone

Create user:

administrator@kms:~$ useradd -s /usr/sbin/nologin -r -M vlmcsd

Compile the source code:

root@svrkvm:# cd /opt/linux-kms-server/vlmcsd/
root@svrkvm:~/vlmcsd# make

Create a service:

root@svrkvm:# vim /lib/systemd/system/vlmcsd.service

Description=vlmcsd KMS emulator service 

ExecStart=/opt/linux-kms-server/vlmcsd/vlmcsd -l /var/log/vlmcsd/vlmcsd.log 


Create and chown log folder:

root@svrkvm:# mkdir /var/log/vlmcsd
root@svrkvm:#chown vlmcsd:vlmcsd /var/log/vlmcsd

Start the KMS

root@svrkvm:# systemctl start vlmcsd
root@svrkvm:# systemctl enable vlmcsd

Open port 1688:

root@svrkvm:# ufw allow 1688/tcp

Using netstat you’ll see that vlmcd is listening on 1688:

administrator@kms:~/vlmcsd/bin$ netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0  *               LISTEN  

Test with KMS client

Test the KMS server by running the KMS client:

administrator@kms:~/vlmcsd/bin$ ./vlmcs
Connecting to ... successful
Sending activation request (KMS V6) 1 of 1  -> 1111-12201-369-033755-01-5079-11213.0010-0032021 (4A1DD49C13BB0079)

Use status to see a brief status report as seen below:

administrator@kms:/etc/systemd/system$ sudo systemctl status kms@administrator.service 
● kms@administrator.service - KMS
   Loaded: loaded (/etc/systemd/system/kms@administrator.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Mon 2020-02-03 14:31:21 UTC; 1s ago
  Process: 6491 ExecStart=/home/administrator/vlmcsd/bin/vlmcsd (code=exited, status=0/SUCCESS)
 Main PID: 6491 (code=exited, status=0/SUCCESS)

Feb 03 14:31:21 kms systemd[1]: Started KMS.
administrator@kms:/etc/systemd/system$ ps -ef | grep vlmcsd
adminis+  6363  5391  0 14:29 pts/0    00:00:00 grep --color=auto vlmcsd

Get licence key:

Windows configuration

Open up cmd.exe as Administrator:

C:\Windows\system32\>slmgr /upk
C:\Windows\system32\> slmgr /ipk [KMS Client Product Key]
C:\Windows\system32\> slmgr /skms [IP_KMS_Server]:1688
C:\Windows\system32\> slmgr /ato


CD \Program Files\Microsoft Office\Office16 OR CD \Program Files (x86)\Microsoft Office\Office16
cscript ospp.vbs /sethst:YOUR_IP_OR_HOSTNAME
cscript ospp.vbs /inpkey:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
cscript ospp.vbs /act
cscript ospp.vbs /dstatusall

Check the Status of Windows ActivationOptionally, you can display information about the Windows activation status:

C:\Program Files\Microsoft Office\Office15>cscript ospp.vbs /dstatusallslmgr.vbs /dli

windows kms

As you can see, the utility returned the following useful info:

  • Name — the OS version;
  • Description — distribution channel VOLUME_KMSCLIENT channel;
  • License status — licensed;
  • Volume activation expirations — 180 days;
  • KMS server IP address and DNS name (Registered KMS machine name).

  • Office:
    C:\Program Files\Microsoft Office\Office15>cscript ospp.vbs /dstatusall

Post a Comment

Previous Post Next Post