Hyper-V PowerShell Windows Server 2012 R2 Windows Server 2016 Windows Server 2019

Hyper-V: Automatic Virtual Machine Activation

With the release of Windows Server 2012 R2 back in 2013, Microsoft introduced a feature called Automatic Virtual Machine Activation (AVMA). AVMA handles the activation process of any of your Hyper-V virtual machines (VMs) running on a physical Hyper-V host which is properly licensed with a Windows Server Datacenter license. In this way you do not have to deal with managing the product keys for each individual VM.

The VM activation process, which binds the VMs activation to the licensed Hyper-V host, takes place during the startup process of the VM. Because the activation takes place between the VM and the Hyper-V host it resides on, you are even able to license VMs in completely isolated environments or remote locations without any Internet connection. When the guest OS is activated, it only rechecks its activation against the host until the next VM reboot, or after 7 days.

Requirements for AVMA

  • A Hyper-V host running a Datacenter Edition of Windows Server 2012 R2Windows Server 2016 or Windows Server 2019. Keep in mind that if you migrate an AVMA licensed VM to a Hyper-V host which is not licensed with a Windows Server Datacenter license, the VM will become unlicensed. In this case you should replace the AVMA key in the VM with another valid non AVMA license key.
  • The Hyper-V Data Exchange Service (KVP), which is part of the Integration Services must be enabled on the VM.
  • In the VM itself the Microsoft Hyper-V Activation Component Driver should have an enabled device status and should be working properly.
  • AVMA does not work with other Virtualization Server technologies.

Supported Guest Operating Systems for AVMA

Only Windows Server guests are covered by AVMA. The below table shows which guests can be activated by each different Hyper-V host version. All server editions (Datacenter, Standard or Essentials) installed with Desktop Experience or Server Core can be activated.

Hyper-V host versionWS2019WS016WS2012R2
Windows Server 2019XXX
Windows Server 2016 XX
Windows Server 2012 R2  X

* AVMA in Windows Server 2019 can also activate Windows Server version 1809, 1803 and 1709.

AVMA Keys

Windows Server 2019

EditionAVMA key
DatacenterH3RNG-8C32Q-Q8FRX-6TDXV-WMBMW
StandardTNK62-RXVTB-4P47B-2D623-4GF74
Essentials2CTP7-NHT64-BP62M-FV6GG-HFV28

Windows Server version 1809

EditionAVMA key
DatacenterH3RNG-8C32Q-Q8FRX-6TDXV-WMBMW
StandardTNK62-RXVTB-4P47B-2D623-4GF74

Windows Server version 1803 and 1709

EditionAVMA key
DatacenterTMJ3Y-NTRTM-FJYXT-T22BY-CWG3J
StandardC3RCX-M6NRP-6CXC9-TW2F2-4RHYD

Windows Server 2016

EditionAVMA key
DatacenterTMJ3Y-NTRTM-FJYXT-T22BY-CWG3J
StandardC3RCX-M6NRP-6CXC9-TW2F2-4RHYD
EssentialsB4YNW-62DX9-W8V6M-82649-MHBKQ

Windows Server 2012 R2

EditionAVMA key
DatacenterY4TGP-NPTV9-HTC2H-7MGQ3-DV4TW
StandardDBGBW-NPF86-BJVTX-K3WKJ-MTB6V
EssentialsK2XGM-NMBT3-2R6Q8-WF2FK-P36R2

Configure AVMA

First of all, you should verify that the Data Exchange option is enabled in the Integration Services for the VM.  To ensure this open Hyper-V Manager and right-click the VM and click on Settings…


On the Settings Windows, under Management select Integration Services and verify that Data Exchange is marked.


You can also use PowerShell to see if the Data Exchange Integration Service (Key-Value Pair Exchange) is enabled. To get a list of the running Integration Services of a VM, run the following command (replace the VM name by your own) in a PowerShell window (as Administrator) on the Hyper-V host hosting the VM.

Get-VMIntegrationService -VMName "vm-tmpl-W2k19"

To enable the Data Exchange Integration Service when disabled, run the following PowerShell cmdlet (as Adminstrator) from the Hyper-V host hosting VM.

Enable-VMIntegrationService -Name "Key-Value Pair Exchange" -VMName "vm-tmpl-W2k19"


When you have any issues with activation and you need to troubleshoot, you can also verify if the Microsoft Hyper-V Activation Component Driver is working properly. To do so open Device Manger inside the VM and check the Device Status of the driver.

To install an AVMA key in a VM (in my example for a Windows Server 2019 VM), run the following command in a PowerShell window (as Administrator) on the VM:

slmgr /ipk TNK62-RXVTB-4P47B-2D623-4GF74


*The AVMA key can also be provided during an Unattended setup using a unattend.exe setup file. In this way the key is already injected during the build phase of that particular VM.

You can also use PowerShell Direct from the Hyper-V host to activated a specific AVMA key for a VM running on that host. Open a PowerShell window (as Administrator) on the Hyper-V host and run following command:

Invoke-Command -VMName "vm-tmpl-W2k19" -ScriptBlock {slmgr /ipk TNK62-RXVTB-4P47B-2D623-4GF74}


You can verify the correct installation of the AVMA key, by opening All settings – Update & Security – Activation in the VM.


You can also verify the VM’s AVMA activation status on the Hyper-V host by opening the Event Viewer and searching for Event ID 12310.



I hope this blog post did learn you something about AVMA and that this feature eases your VM activation process. If you have any questions, always feel free to contact me through my twitter handle (@wmatthyssen) or feel free to leave a comment.

Wim is an Azure Technical Advisor and Trainer with over fifteen years of Microsoft technology experience. As a Microsoft Certified Trainer (MCT), his strength is assisting companies in the transformation of their businesses to the Cloud by implementing the latest features, services, and solutions. Currently, his main focus is on the Microsoft Hybrid Cloud Platform, and especially on Microsoft Azure and the Azure hybrid services.   Wim is also a Microsoft MVP in the Azure category and a founding board member of the MC2MC user group. As a passionate community member, he regularly writes blogs and speaks about his daily experiences with Azure and other Microsoft technologies.

6 comments on “Hyper-V: Automatic Virtual Machine Activation

  1. hello,
    and when you have an evaluation windows?
    br

    Like

    • Using AVMA to convert form an eval version to a retail version will not work. Only retail installations will auto-activate with an AVMA key.

      Like

      • A little outside the scope of this great article (Thanks Wim!). However, it can be done, by using the dism command to change the edition of Windows Server from Evaluation to Standard or Datacenter. There are other blogs out there that will help you Luis. I then followed Wim’s instruction on how to activate the VM once it the edition was no longer Evaluation.

        Awesome article, thanks again.

        Like

  2. Hello good afternoon

    I have a new Dell T440 server that came with WIndows Server 2019 Std. I loaded Hyper-V on it and installed two vms also Windows Server 2019 Std … in both the VM activation process goes smoothly as you reported no procedure, but then restart the VM until and check and Windows on the VM is not activated … Windows on Physical Host is activated correctly purchased directly from Dell.

    Any additional tips? I tried both activation via VM and via Physical Host limitation for VM and nothing

    Like

    • Fabio Rolandone

      Dear Rafael,
      AVMA activation working only for Datacenter edition on the host. Is not working with Standard edtion.

      Like

Leave a reply to wmatthyssen Cancel reply