-1

I want to identify the underlying, physical Hyper-V server (e.g., hypervisor) by DNS name of a given guest OS. I log into various virtual servers regularly. I've read that there is a way with PowerShell (a command to find the hypervisor that supports a given VM). But I don't want to use PowerShell. Ideally I would use WMIC commands remotely. But alternatively I could log in and issue WMIC command locally. Or maybe use DOS commands. Ideally the solution would be a one-step process.

The guest operating systems are Windows Server 2003.

  • I am little bit confused. So you want to find out DNS name of underlying physical machine after you logged in to guest OS? Is my understanding correct? – Atul Feb 12 '15 at 03:16
  • Maybe. I want to know the DNS name of the physical server with Hyper-V when I log into one of its virtual machines. I regularly log into virtual servers. I know their DNS names (obviously). But I don't know the physical server's DNS name that supports the virtual servers. Is that clear? – Jennifer33 Feb 13 '15 at 01:55

1 Answers1

0

The following registry key contains information about the Host server:

HKLM\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters

Some important keys are:

HostName
PhysicalHostName
PhysicalHostNameFullyQualified
VirtualMachineName

Plus a number of settings about the Host Server’s version

So simplest way to get host server name is to run following DOS command:

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters\" /v "PhysicalHostNameFullyQualified"

As per my info, this works for many guest OS. However not sure for all. Also it needs vmtools to be installed on guest OS.

Alternatively you can issue WMI command:

WMIC /namespace:\\root\virtualization PATH "Msvm_ComputerSystem" Get ElementName, Caption

This should give you "Hosting Computer System".

Please let me know if this helps. And if yes, please don't forget to mark this as answer.

Atul
  • 3,778
  • 5
  • 47
  • 87
  • I'm not going to be able to install vmtools on the servers. I tried that WMI command. Unfortunately, it didn't work. I got this : ERROR: Code = 0x8004100e Description = Invalid namespace Facility = WMI. Was I supposed to change the command? – Jennifer33 Feb 13 '15 at 21:14
  • The viewing of registry keys works for Windows Server 2003. On Windows 7, I cannot say if it works or not. But manually drilling into the registry for informational purposes can be a last resort. I'd prefer the WMIC command method because I could script it or automate it. I hope someone knows why the WMIC command didn't work. – Jennifer33 Feb 13 '15 at 21:35
  • Try running DOS command I given. It fetches info from registry only. – Atul Feb 14 '15 at 05:31