Here I'm Going to demonstrate the installation and the use of KMS role which is in the Windows Server.
First of all you need to setup the Windows 2012 Server and then can go in to
Manage > Add Roles and Features > Role-based or feature-based installation > "Select the Server" where you want to install the role > Add Roles and Features Wizard > Select "Volume Activation Services" > Then install the additional features
Then you will get the Volume Activation Services wizard. There you can find a description about the VAS.
Note: The Volume Activation Services (VAS) role is not required to configure a KMS Server. To do the management, it is highly recommended to install this role.
Note. If all Windows OSs activated on this KMS server belong to one and the same Active Directory domain, you can use a special KMS extension — Active Directory Based Activation.
Select the computer name which you want to activate. (The computer need to be in the domain.)
Now you can copy paste the KMS key which you can get from the Microsoft Volume Licensing portal
Once that done you will get the below window. Here you can select the Review configuration and click next to proceed.
If you have not added the firewall exceptions, you will get the below window. You can add the firewall exceptions as mentioned below. And then run the setup again.
But for the initial run, disable the Windows firewall and run the activation. This way you will have a way to understand that KMS is not giving any errors. Later give the exceptions in the firewall and enable the destination PC firewall.
If the firewall enabled, you will get the below error.
Go in to Windows firewall and click on New Inbound rule Wizard.
Then add a TCP port 1688.
Click allow connection.
Here you can select the Domain as the selected network. But I prefer to go with the Domain and the Private networks.
Give a name for the newly created rule and apply the changes.
Now you will be able to use your KMS server to activate Domain joined computers.