Determining which Hyper-V host you are on

Over the past couple years, I’ve been using more and more virtual servers and workstations. At the moment, and for a few different reasons, I have various VMs hosted on any one of three physical machines.

If you connect to a hosted virtual machine, how do you determine where it is physically hosted?

If you are using Hyper-V, this is available in the registry in:

HKLM:Software/Microsoft/Virtual Machine/Guest/Parameters/PhysicalHostName

And there are several other things which are available too:

image

I looked and I haven’t found anything similar for VirtualBox. For VMWare… I’m not a fan, so I didn’t look at all for that.

Getting bginfo.exe:
One thing I started using again is bginfo.exe – which is a little SysInternals app which creates a desktop background which gives you information about the current machine. Again, if you are regularly connecting to different machines, sometimes it can be confusing which is which. BGInfo generates the yellow text in the top-right of the desktop:

image

Where do you get it?

http://live.sysinternals.com/

Or you can manually install the SysInternals suite from Microsoft, from here: http://technet.microsoft.com/en-us/sysinternals/bb842062.aspx

Using bginfo.exe:
You can use this any number of ways. You can have it run as part of startup, run as a service, or you can just run it interactively. Just double-click the .exe to begin:

image

You can tweak the information you want to show and hide using this interface, and ultimately do FIle –> Save to save your settings – and Apply to actual apply your changes.

Including Hyper-V info:
The last step is to add the Hyper-V in which the current VM is running. On the right side of bginfo, there is a list of Fields which you can add to the output. You can click “Custom” to add custom information.

image

click “New…”:

image

I am creating a new field called VMHost which will go out to the register and pull the value from here:

HKEY_LOCAL_MACHINESOFTWAREMicrosoftVirtual MachineGuestParametersPhysicalHostName

Note that if you are on a 64-bit machine, you must check off that “64-bit registry view” for this to work. Now, when you click OK, OK, and then Apply, if you add <VMHost> as one of your tokens, you will now see the Hyper-V host on which the current VM is running!

image

Posted in Cloud Computing, Computers and Internet, General, Infrastructure, Organization will set you free, Uncategorized, Windows

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 5 other followers

%d bloggers like this: