Scott Forsyth's Blog

Postings on IIS, ASP.NET, SQL Server, Webfarms and general system admin.

.

  • Scott Forsyth

Hosting Needs

Training and Dev Labs

Hyper-V – getting host information from the guest VM

Sometimes it’s necessary to find out host machine information from a particular guest virtual machine.

With Hyper-V Integration Services installed, the following registry key contains information about the Host server:

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

Some keys of interest are:

  • HostName
  • PhysicalHostName
  • PhysicalHostNameFullyQualified
  • VirtualMachineName
  • Plus a number of settings about the Host Server’s version

This is maintained in real-time.  For example, if you rename the virtual machine name in Hyper-V, VirtualMachineName is immediately updated in the guest server, assuming that it’s running.  And, even if it’s not running at the time that you rename the server in the host, it will be reflected when powering on the VM or restoring from a saved state.

Posted: Oct 08 2009, 02:01 PM by OWScott | with 7 comment(s)
Filed under:

Comments

Ronen said:

What about if vm tools are not installed on the VM machine?

# January 4, 2010 8:22 AM

OWScott said:

If the integration tools aren't installed then the guest machine doesn't have any information available about the host unless you can figure that out from the assigned IPs, guest name you assigned or any other information.

# January 4, 2010 11:29 AM

Mark LaNore said:

This only works if the guest is a Windows Server 2008 or 2008 R2 OS.  It does not work if the guest is a Windows 2003 Server as this key does not exist.   Is there a similar method for a 2003 server guest to determine what the host system is?

# March 15, 2012 2:48 PM

OWScott said:

Hi Mark,

I just checked on 2003 RTM SP2 32-bit and 64-bit guests and they have that key with details.  My guess is that something with the integration components isn't installed and working correctly on your guest. Make sure that you have the latest.

# March 15, 2012 3:02 PM

askpcguy said:

From CMD line we run

reg query "\\machine\HKLM\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters" /v PhysicalHostName to show the Virtual Machine Host server.

# August 23, 2012 1:38 PM

Anand Trimbake said:

What about Linux guest?

# April 10, 2013 10:39 AM

OWScott said:

Hi Anand,

Good question. I don't the Linux world enough to know where that would be stored.

# April 11, 2013 10:02 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)