I successfully retrieved the Hyper-V VM Host Name from a Debian-based Hyper-V VM.
Since Debian 12 does not hv_kvp_daemon
preinstalled, I installed it along with the hyperv
package to read the necessary files:
root@DEB-HYPV-Debian12:~# apt-get install hyperv-daemons
root@DEB-HYPV-Debian12:~# pip install hyperkv
Finally, I ran hyperkv
and obtained the following output:
{
"HostName": "WIN-SRGVS7XXXXX",
"HostingSystemEditionId": "79",
"HostingSystemNestedLevel": "0",
"HostingSystemOsMajor": "10",
"HostingSystemOsMinor": "0",
"HostingSystemProcessorArchitecture": "9",
"HostingSystemProcessorIdleStateMax": "0",
"HostingSystemProcessorThrottleMax": "100",
"HostingSystemProcessorThrottleMin": "5",
"HostingSystemSpMajor": "0",
"HostingSystemSpMinor": "0",
"PhysicalHostName": "WIN-SRGVS7XXXXX",
"PhysicalHostNameFullyQualified": "WIN-SRGVS7XXXXX",
"VirtualMachineDynamicMemoryBalancingEnabled": "0",
"VirtualMachineId": "18A2EE6D-B528-4103-A1BF-8B21C9FE324F",
"VirtualMachineName": "Debian12_VM"
}