If you are running a virtual machine (VM) on Hyper-V, sometimes you want to know on which Hyper-V host this VM is running. If you don’t have access to the Hyper-V host, you need to find that information from within the virtual machines operating system. Luckily, the hostname of the physical Hyper-V server the virtual machine is running on can be found in the virtual machines registry.
You can find that information under the following registry key:
You will get some additional information about the Hyper-V host as well was the Physical Hyper-V Hostname of the VM.
You could also run the following PowerShell command to get the Hyper-V hostname inside the VM:
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters" | Select-Object HostName
Since we run a version of Hyper-V in our Microsoft Azure datacenters, this also works with Azure VMs.
I hope this post was helpful and shows you how you can find the hostname the physical Hyper-V host of a VM. if you have any questions feel free to leave a comment below.
And yes, the first screenshot was taken on a Surface Pro X running Hyper-V on Windows 10 on ARM.Tags: Azure, Host, Hostname, Hyper-V, Hyper-V Host, Key, Microsoft, Physical, PowerShell, registry, Virtual Machine, Virtualization, Windows 10, Windows Server Last modified: January 19, 2021