1

There's a Microsoft Virtual PC instance on my network that runs build scripts and reports problems by sending me an e-mail. I don't what machine it's running on! I can access the machine by Remote Desktop, but I don't know how to work out the host from that. What I'd really like, in the future, is to include the host name in the automated e-mail. So I have two questions:

1) If you're logged onto a virtual PC, is there any way of finding out the identity of the host machine?

2) If the answer to question 1 is yes, what's the easiest way to find the host automatically from a Python script?

Tommy Herbert
  • 143
  • 1
  • 1
  • 6

3 Answers3

4

Unless I am mistaken, outside of server-provided virtualization tools (like VMware's 'vmware tools'), you won't be able to determine even that the VM is a virtual machine.

Perhaps running through Hyper-V's admin consoles you could determine which machine it is running on. Outside of that, I know of no such way to determine what you're looking for.

warren
  • 18,369
  • 23
  • 84
  • 135
  • You can usually tell from the outside. If you scan it, it won't look quite like a regular system. (If nothing else, if you use nmap on it, the MAC address will almost always resolve to "VMware" or something similar. – Satanicpuppy Dec 24 '09 at 14:48
  • 2
    You can also usually tell via CPU features or DMI information when you are on the virtual machine. – James Dec 24 '09 at 14:54
  • Thought that might be the answer. Hey ho. Thanks. – Tommy Herbert Dec 24 '09 at 15:01
  • if you back-lookup the MAC address, yes it can come back. But if it's been masked (seen that a *lot*, personally) - it won't. On Virtuozzo (what my VPS uses), the CPUs are passed-through, and the MAC address looks 'normal'. – warren Dec 25 '09 at 13:54
2

Hah. Came in here to tell you I'd struck out, unless you were (for some reason) using Microsoft VM instead of VMWare.

Microsoft puts the name of the physical host in the registry of the virtual machine under:

HKLM\Software\Microsoft\Virtual Machine\Guest\Parameters\PhysicalHostName

Hope that helps.

Satanicpuppy
  • 5,946
  • 1
  • 17
  • 18
1

Worst case scenario: Locate it based on it's network connection, just as you would for a rogue machine. I start by determining which switch port it's connected to and then look up where that cable terminates.

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109