I am trying to get the MAC address of a VMware guest from the command line in ESXi 6.

The vSphere client shows the MAC address of the network adapters, which are configured as "automatic".

The command

vim-cmd vmsvc/get.config <id>

shows me many of the details of that particular guest, but not the MAC addresses of the network cards.

Is there a command that I can run from the VMware shell that displays the MAC address of a VMWare guest?

  • This command vim-cmd vmsvc/get.config <id> gives back "False MAC addresses"! – MUY Belgium Aug 27 at 8:11

vim-cmd vmsvc/device.getdevices <id> will show you details about the virtual devices of the VM, including the MAC adresses.

  • This may gives the mac at the moment of the VM creation but not the current mac address. – MUY Belgium Aug 27 at 8:25
  • No, it doesn't. I just checked with a VM where I changed the MAC address a couple of weeks ago. The command shows it's current MAC address. – Gerald Schneider Aug 27 at 8:30
  • Maybe it needs something to be installed in the VM? – MUY Belgium Aug 27 at 8:43

vim-cmd hostsvc/net/info | grep "mac ="

  • 2
    This shows the mac addresses of the host, not of the guests. – roelvanmeer Sep 5 '16 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.