vsphere_static_160x300
Badges

vexpert_logo_100x57

gestaltitbadge

follow-me-twitter

Subscribe to me on FriendFeed

Comments / DISQUS
Feedjit.com

MAC Address Identifies a Remote Server is a VMware VM

Let’s say you need to quickly figure out if a remote server is a VMware virtual machine (VM). I won’t go into reasons why you might not already know, or why you would need to know, but let’s just say you do. If you have Remote Desktop access you can check the hardware devices, but what if you can’t and you need to tell remotely? I can’t think of an easier indicator than the server’s MAC address.

When ESX Server automatically generates a MAC address, the first three bytes are the VMware Organizationally Unique Identifier, or OUI. ESX Server uses one of two VMware OUIs for network adapters:

  • If you initiate the virtual machine directly in ESX Server, ESX Server uses 00:0C:29:XX:XX:XX
  • If you initiate the virtual machine in VirtualCenter, ESX Server uses 00:50:56:XX:XX:XX

If I am not mistaken the VirtualCenter generated MAC OUI is also the same for VMware Workstation, Fusion, and Server, but don’t hold me to that.

Armed with knowledge of the standard OUIs, it’s now easy to tell a VMware VM by the MAC address.

To get the remote MAC address using a Windows XP or Vista desktop, for example, enter the following at a command prompt:

>getmac /s [servername or ip] /u [domain\usename]
As an example, I know my lab VirtualCenter (VC) is a VM. Here’s a screen shot of using getmac from my Vista notebook. Note that I am prompted for the password, but I could have included it in the command with a “/p” switch. You still need administrative access on the remote server.

The OUI is 00:OC:29. Makes sense that the VC VM was generated from an ESX server, right? Otherwise, this example would have been a “twilight zone”, “how did that happen?” scenario. J

You may be thinking what about pinging the remote server and then using the ARP command ( >arp –a ). to view your updated ARP cache? That will work if you are on the same ip subnet as the other server, but if not, MAC addresses do not route and ARP does not work.

I am not aware of an equal tool to getmac in Linux. Fill me in if you know of one.

Another option could be to use PsExec or Putty for a remote console session, then use ipconfig /all or ifconfig to get MAC addresses.

I guess if you have access to the switches you could get the MACs that way too.

Let me know if you have a foolproof, easier way to determine a VMware VM remotely

Related Posts

  • You can get the mac of a remote server in linux using arping:

    [root@localhost ~]# arping whatever.example.com -c 1
    ARPING 192.168.4.157 from 192.168.3.13 eth0
    Unicast reply from 192.168.4.157 [00:0C:29:58:DB:85] 1.489ms
    Sent 1 probes (1 broadcast(s))
    Received 1 response(s)
  • egcagrac0
    When I tried that on a known VM, I got the hardware MAC of the host machine, not the emulated MAC of the VM.
  • Maish, Omar, Andy, Matt,

    Thanks for the alternative ideas and methods of identifying VMs!
  • If you want to know the exact machine type (or more specifically the vendor) based upon mac address scans, you can use the newly released fing command-line utility (from over-look.com) or simply do an nmap scan. Fing (similar to the name ping, so you don't forget it) is super easy to install and execute. Try it out. I think it's better than the solution you mentioned :)

    Note: I signed up for disqus because i'd like to be able to track this comment thread (as well as others). Please delete my other "unregistered" comment. Sorry for the "noise" generated by this "duplicate" comment, and I am an avid reader of your blog!
  • Matt Smith
    Using PSInfo can be a good way to identify a virtual machine as the Video driver should come up as a VMWARE SVGA.
  • If you want to know the exact machine type based upon mac address scans, you can use the newly released fing command-line utility (from over-look.com) or simply do an nmap scan. Fing is super easy to install and execute. Try it out. I think it's better than the solution you mentioned :)
  • Omar Torres
    another method is to use the services mmc console to connect to the remote "server" and see if vmtools service is running. if it's non windows, then ssh to the vm and run "chkdconfig --list" to see if vmtools service is running as well.

    the obvious pitfalls on this method are:

    a. the administrator failed to install vmtools (a whole different bag of worms to deal with)

    b. you don't have admin/root access to the vm in question...

    I think at the moment, the getmac method is the most foolproof method. good find guys.

    -o
  • What we usually do is keep all our VM's on a seperate VLAN, so from that we know it it virtual or physical. The problem begins when you P2V a physical server and it has to retain its IP, that is why it is no a perfect solution
  • Is there anything that prevents a VM admin from manually setting a vNic's MAC address to that of any physical NIC? Or does ESX limit you to their OUI?

    That might throw a wrench in their.
  • Sean,

    I'm pretty sure that I have set a VM to mimic a physical MAC address after a P2V conversion without issue.
    I remember doing it through the .VMX file directly though. The VC interface pre-fills the OUI but allows you to change it as well. I have a client that routinely changes the MACs to Manual (I'm sure they keep the same OUI though) to prevent the MAC from changing and messing up DHCP reservations.

    CARLO.
  • Sean, Carlo,

    Yes, you can change the whole MAC, but VMware pre populates / leaves the
    OUI in the field when you click the manual option. They are "suggesting"
    to leave the OUI, I guess. See the screen shot I am including.



    Sean, to your point if they change the MAC then the method in this point
    is no longer valid, but I'm willing to bet it doesn't happen that often.

    *Rich Brambley*
    rbrambley@gmail.com

    VM /ETC <http://feeds2.feedburner.com/%7Er/vmetc/%7E6/2>

    ↑ Grab this Headline Animator
    <http://feedburner.google.com/fb/a/headlineanima...>
  • Rich,

    I know you have commented before about how the blogOsphere is usually in tune with each other. I LITERALLY just stumbled upon getmac the other day and posted about it Tuesday. :) Pretty funny.

    http://www.vmwareinfo.com/2009/03/quick-dos-tip...
  • Carlo,

    Great minds think alike! (And use the same tools to make IT easier) ;)
blog comments powered by Disqus
Hyper9 Cowabunga
Support VM /ETC
Support VMETC.com

Support VMETC.com

Free Business and Tech Magazines and eBooks
@rbrambley tweets
Advertisements
VMTN Roundtable Podcasts
Subscribe



Add to Google Reader or Homepage
Subscribe in NewsGator Online
Add to netvibes
Add to Plusmo