How to Configure Hyper-V Integration Services and KVP Data Exchange in Windows 11 Using PowerShell

Hyper-V Integration Services provide high-speed paravirtualised synthetic device drivers and background management daemons that bridge host operating systems with virtual machine guests. While basic integration components handle time synchronisation, heartbeat monitoring, and volume shadow copy backups, the Key-Value Pair (KVP) Data Exchange service provides a direct, out-of-band communication channel between host and guest. Through KVP exchange, administrators can query guest operating system versions, fully qualified domain names, IP addresses, and processor architectures directly from the Windows 11 host without opening network ports, requiring remote credentials, or relying on active network adapters. Using Windows PowerShell, administrators can inspect, enable, and populate custom host-guest telemetry across their virtualization lab.

Architecture of Hyper-V Integration Services and KVP Exchange

Hyper-V Integration Services operate through synthetic VMBus transport channels, bypassing legacy hardware emulation for near-native host communication:

  • Time Synchronization: Synchronises guest system clocks with the host hardware clock (crucial for Active Directory Kerberos ticket validity).
  • Heartbeat: Reports operational responsiveness from the guest operating system to the host Virtual Machine Management Service (VMMS).
  • Volume Shadow Copy (VCC): Coordinates host-level application-consistent backups without interrupting active database engines.
  • Data Exchange (KVP): Manages bidirectional key-value registry and file entries exchanged across VMBus. The host writes to guest registry hives, and the guest exposes operational properties back to the host WMI interface (Msvm_KvpExchangeDataItem).
  • Guest Shutdown: Enables clean ACPI graceful operating system shutdowns from host management scripts.

Auditing Integration Services State via PowerShell

To inspect the status of integration services across your virtual machines, open Windows PowerShell as an Administrator and query the Get-VMIntegrationService cmdlet:

# Query all integration services for a target virtual machine
Get-VMIntegrationService -VMName "Win11-LabVM" | Select-Object Name, Enabled, PrimaryStatusDescription

Key integration components listed include:

  • Key-Value Pair Exchange (Data Exchange)
  • Time Synchronization
  • Heartbeat
  • Shutdown
  • VSS (Volume Shadow Copy)

Enabling and Disabling Integration Components

If a specific integration service is disabled or in an error state, toggle its availability using Enable-VMIntegrationService or Disable-VMIntegrationService.

To enable Key-Value Pair Data Exchange on a virtual machine:

Enable-VMIntegrationService -VMName "Win11-LabVM" -Name "Key-Value Pair Exchange"

In scenarios where a virtual machine acts as a domain controller or synchronises against a dedicated external PTP/NTP source, time synchronisation from the host hypervisor should often be disabled to prevent time drift conflicts:

Disable-VMIntegrationService -VMName "Win11-DC01" -Name "Time Synchronization"

Extracting Guest Telemetry via KVP Exchange and WMI

When the Key-Value Pair Exchange service is active, Hyper-V automatically collects intrinsic guest metadata and surfaces it to host WMI namespaces without establishing network connectivity.

To extract all guest properties collected by KVP exchange in PowerShell:

# Query KVP exchange data via WMI
$VM = Get-WmiObject -Namespace "root\virtualization\v2" -Class Msvm_ComputerSystem -Filter "ElementName='Win11-LabVM'"
$KvpData = Get-WmiObject -Namespace "root\virtualization\v2" -Class Msvm_KvpExchangeComponentSettingData -Filter "InstanceID like '$($VM.Name)%'"

# Parse XML-encoded guest intrinsic items
$KvpData.GuestIntrinsicExchangeItems | ForEach-Object {
    $Xml = [xml]$_
    [PSCustomObject]@{
        Name  = $Xml.INSTANCE.PROPERTY[0].VALUE
        Data  = $Xml.INSTANCE.PROPERTY[1].VALUE
    }
} | Format-Table -AutoSize

The command outputs comprehensive operational data directly from inside the guest:

  • FullyQualifiedDomainName: Complete guest DNS host name.
  • OSName & OSVersion: Accurate guest build and kernel information.
  • NetworkAddressIPv4: Internal guest IP addresses across all virtual NICs.
  • ProcessorArchitecture: x86, AMD64, or ARM64 processor classification.

Injecting Custom Host-to-Guest Data via KVP Exchange

Beyond reading default guest telemetry, host administrators can inject custom operational key-value pairs into the guest. In Windows guests, host-pushed keys appear directly in the guest registry under HKLM:\SOFTWARE\Microsoft\Virtual Machine\External.

To inject a custom key (such as deployment role, asset tag, or maintenance schedule) from PowerShell on the host:

# Retrieve VM management service and settings
$VMMS = Get-CimInstance -Namespace "root\virtualization\v2" -ClassName Msvm_VirtualSystemManagementService
$VM = Get-CimInstance -Namespace "root\virtualization\v2" -ClassName Msvm_ComputerSystem -Filter "ElementName='Win11-LabVM'"

# Construct KVP XML payload
$KvpXml = @"
<INSTANCE CLASSNAME="Msvm_KvpExchangeDataItem">
    <PROPERTY NAME="Name" TYPE="string"><VALUE>HostEnvironment</VALUE></PROPERTY>
    <PROPERTY NAME="Data" TYPE="string"><VALUE>StagingLab-RackA</VALUE></PROPERTY>
    <PROPERTY NAME="Source" TYPE="uint16"><VALUE>0</VALUE></PROPERTY>
</INSTANCE>
"@

# Push the custom key-value pair to the guest
Invoke-CimMethod -InputObject $VMMS -MethodName "AddKvpItems" -Arguments @{
    TargetSystem = $VM
    DataItems = @($KvpXml)
}

Reading Injected KVP Data Inside Guest Operating Systems

Inside a Windows virtual machine, verify the injected metadata using standard PowerShell:

# Execute inside the guest OS
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Virtual Machine\External"

On Linux guests running the linux-tools-virtual or hv_kvp_daemon packages, exchange records are accessible via the daemon key store located at /var/lib/hyperv/.kvp_pool_0.

Mastering Hyper-V Integration Services and KVP Data Exchange enables resilient, out-of-band monitoring and orchestration across complex Windows 11 virtualized environments.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.