Troubleshooting: List Which Physical Computer Your VM is On Using PowerShell

Troubleshooting: List Which Physical Computer Your VM is On Using PowerShell

This information sourced from Ben Armstrong's Virtual PC Guy blog at: http://blogs.msdn.com/b/virtual_pc_guy/archive/2011/01/07/what-physical-computer-am-i-on.aspx

Applies to:  Hyper-V, Virtual Server and Virtual PC.

To get the name of the physical computer that you are running on, open a PowerShell console inside the virtual machine and type in:

(Get-ItemProperty –path “HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters”).PhysicalHostName

You can also get the fully qualified name of the physical computer by running:

(Get-ItemProperty –path “HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters”).PhysicalHostNameFullyQualified

To get the name of the virtual machine itself, open a PowerShell inside the virtual machine and type in:

(Get-ItemProperty –path “HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters”).VirtualMachineName

To do this using VBScript, see Ben's blog post: Programmatically detecting host information from inside the guest under Virtual PC and Virtual Server.

Leave a Comment
  • Please add 1 and 3 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Richard Mueller edited Revision 5. Comment: Remove (en-US) from title, improve grammar

  • Craig Lussier edited Revision 1. Comment: added en-US to tags and title

Page 1 of 1 (2 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Craig Lussier edited Revision 1. Comment: added en-US to tags and title

  • Richard Mueller edited Revision 5. Comment: Remove (en-US) from title, improve grammar

Page 1 of 1 (2 items)