Automatic Virtual Machine Activation with Windows Server 2012 R2

Previously, I have posted articles on updates released for KMS host to allow you to volume activate Windows 8.1 and Windows Server 2012 R2 and Windows 8 and Windows Server 2012. These have been two of my most popular posts so volume licensing and activation is clearly something people need and want to know about.

To help celebrate Valentines Day, I thought I would share some more licensing love with you all and introduce a new feature in Windows Server 2012 R2 called Automatic Virtual Machine Activation (AVMA). This new feature allows customers using Windows Server 2012 R2 Hyper-V virtualization and Windows Server 2012 R2 guest operating systems running as Hyper-V virtual machines to activate their guest operating systems not with a KMS host as normal but instead, by using the Hypervisor.

In essence, your Hyper-V server becomes your KMS host for your virtual machines. This allows you to keep, track and record all of your virtual machine licensing in your virtual environment. This is also great for hosters or companies running internal private clouds where you may have an infrastructure network consisting of an Active Directory Domain Services domain and KMS host for your servers but not for your customer servers, virtual guests on the Hyper-V servers which have no access to your hosting infrastructure.

The requirements for AVMA to work are as follows:

  • Windows Server 2012 R2 Server with the Hyper-V role installed
  • Windows Server Datacenter license applied to the Hyper-V host (either by a network KMS host or a MAK key)
  • Windows Server 2012 R2 guest operating system
  • Data Exchange Integration Service is enabled for the virtual guest

License the Hyper-V Host Server

If your environment is licensed using a Windows KMS host, you can enter the command cscript slmgr.vbs -ipk W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9 to install the Windows Server 2012 R2 Datacenter KMS client key on the Hyper-V host. If you are using MAK keys for single activations then use the command cscript slmgr.vbs -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX and replace the X’s with your MAK key for Windows Server 2012 R2 Datacenter. If you use KMS licensing, please bear in mind that this KMS activation needs to be renewed quite frequently so the KMS host needs to remain on the network and online.

To verify the license status of the Hyper-V host server, you can use the command cscript slmgr.vbs -dlv to display the current license type and the activation status.

License the Virtual Guest Server

Manual Virtual Guest Activation

Once your host server is activated, you can start doing guest activations from the Hyper-V host server. To do this manually, enter the command cscript slmgr.vbs -ipk YYYYY-YYYYY-YYYYY-YYYYY-YYYYY and replace the Y’s with one of the follows AVMA client keys according to your guest operating system edition.

Windows Server 2012 R2 Datacenter Y4TGP-NPTV9-HTC2H-7MGQ3-DV4TV
Windows Server 2012 R2 Standard DBGBW-NPF86-BJVTX-K3WKJ-MTB6V
Windows Server 2012 R2 Essentials K2XGM-NMBT3-2R6Q8-WF2FK-P36R2

Once this is done, entering the command cscript slmgr.vbs -dlv will show you that the description for the licensing activation is Windows(R) Operating System, VIRTUAL_MACHINE_ACTIVATION and the Hyper-V hostname which performed the activation for the guest will be displayed further down the output.

Automated New Virtual Guest Activation

If you are in a new build greenfield environment then you can use the AVMA client keys shown above as part of your operating system build and deployment process. You can do this in a number of way such as manually as part of a GUI driven Windows Server 2012 R2 installation, via an unattend.xml file incorporated on your installation media be it manual, via Windows Deployment Services (WDS), System Center Configuration Manager (SCCM) Operating System Deployment or using the AVMA client key on a sysprep virtual machine template. If you are maximizing your investment in Hyper-V and Windows Server, you can use this license key in your System Center Virtual Machine Manager (SCVMM) VM Templates and Guest OS Profiles.

Automated Existing Virtual Guest Activation

If you’ve got existing virtual machines running Windows Server 2012 R2 that you want to move from KMS or MAK to AVMA licensing but you don’t want to do it manually either because you have too many systems to touch or because you want it done in a consistent and automated fashion then my colleague Craig Taylor has written a post on how he used the Windows Task Scheduler to deliver a single run task onto all of the virtual machines in a VMM managed environment to update the key and activate the machines. You can read Craig’s post over on his blog at Remote activation of Windows Server Licensing via PowerShell (sort of).

Unknown VMBUS Devices in Device Manager

If you deploy AVMA licensing into your environment, you may want to have a look at this post by Aidan Finn who has come across an issue whereby Unknown Device (VMBUS) appears in the Device Manager for some Windows Server 2012 R2 machines. There’s nothing to worry about as this is a byproduct of the AVMA process but something you will probably want to be aware of. His post is at KB2925727 – Unknown Device (VMBUS) In Device Manager In Virtual Machine For WS2012 R2 AVMA.

KMS Activating Windows Server 2012 and Windows 8

In our environment, we have a Windows Server 2008 R2 virtual guest serving as our KMS host. With the recent RTM releases of Windows Server 2012 and Windows 8, we wanted to be able to activate our hosts and guests using KMS. If you try to activate one of these new Windows editions using a Windows Server 2008 R2 KMS host, then you will likely encounter the following error:

Error: 0xC004F050 The Software Licensing Service reported that the product key is invalid.

Luckily, Microsoft have released an update for the Windows Server 2008 R2 KMS host services to support the application of new KMS keys and to accept the KMS activation requests from these operating systems. You can download the update from and register to receive the hotfix.

Something you should note which I ran into which is not explicitly defined in the article is that this update only applies to Windows Server 2008 R2 with Service Pack 1. Trying to apply this update to the RTM release of Windows Server 2008 R2 produces an Windows Update error that this update is not applicable to this system.

After applying the SP1 update to the KMS host, I was able to install the update, and after a reboot, we were nearly ready to start activating. The final step is to update the KMS key, which is something not terribly well explained on the web either. You will have a KMS host key if you are a Microsoft Volume License customer, and you will have a Windows 8 or a Windows Server 2012 KMS key if you subscribe to Software Assurance for the products.

If you subscribe to Software Assurance for Windows 7 client operating systems, but not for Windows Server 2008 or 2008 R2, then you will receive a Windows 8 KMS key via your Volume License Servicing Center, but not a Windows Server 2012 KMS key. If you subscribe to Software Assurance for Windows Server 2008 or 2008 R2 then you will receive a Windows Server 2012 KMS key via your Volume License Servicing Center. One thing you need to be aware of regarding KMS is how the down-level clients are licensed.

On a KMS host, you can only apply one license key. If you install a Windows 8 KMS key, then you will be able to activate Windows Vista, 7 and 8 clients, but will not be able to activate any edition of any server operating system. In you install a Windows Server 2012 KMS key, then you will be able to activate any combination of Windows Server 2012, Windows Server 2008 R2, Windows Server 2008, Windows Vista, 7 and 8.

In my scenario, our VLSC site showed a KMS key for Windows Server 2012 and Windows 8, so I used the Windows Server 2012 key. On the KMS host, first uninstall the old KMS key using the following command:

cscript slmgr.vbs -upk

You will receive a message that the key was successfully uninstalled, after which you can enter the new key.

cscript slmgr.vbs -ipk XYZXY-XYZXY-XYZXY-XYZXY-XYZXY

You should now receive a notification that the key was successfully installed onto the server. Lastly, you need to activate the key which requires going out to the Microsoft activation service, so if you use a proxy server for internet access, be sure that you allow this user and host combination to do that.

cscript slmgr.vbs -ato

Once all the above was complete, I entered the KMS client key for Windows 8 onto my Windows 8 Enterprise desktop and it successfully activated, as did a Windows Server 2012 Datacenter virtual machine which I deployed a couple of days ago. If you need the KMS client keys to get you back to a KMS state after you may have MAK activated your machines to get you up and running, you can get them from the TechNet page at