0

I have an IP address of a Guest virtual machine running on an VMware ESXi host. I don't know the IP address of this VMware host.

How can I find the IP address of this VMware host?

  1. I have vSphere client software installed on my system.
  2. I can ping the IP of the guest machine and it replies. Thanks.
4
  • What do you mean by “I can’t access the guest machine”? Are you referring to the guest OS’ credentials? Also, how would you use vSphere Client without having the host’s address?
    – Daniel B
    Jun 1, 2015 at 12:00
  • Yes, I don't have the credentials of the guest machine. I edited my question because of the the answer provided by @Fazer87. Also, how would you use vSphere Client without having the host’s address? I would ask the same to Fazer87
    – ρss
    Jun 1, 2015 at 12:06
  • You did write “I have access to vSphere client only.” Did you actually mean it or perhaps something else?
    – Daniel B
    Jun 1, 2015 at 12:07
  • From that I mean that it is installed on my system and I am permitted to use it.
    – ρss
    Jun 1, 2015 at 12:09

5 Answers 5

1

If you really only have the guest’s IP address, you generally cannot obtain the host’s IP address. There may be some configurations where it could work, though.

From your (PC’s) perspective, the virtual machine is just another network-accessible computer. Even in the guest’s local network (broadcast domain), a VM cannot be distinguished from a real PC physically connected to a switch just by looking at its IP address and the way traffic takes to get there.

4
  • I tried to clear the arp cache of my windows machine and then pinged the guest vm machine. I then checked the arp cache and I never found the VMware host in the arp table. I thought maybe there I can find something, but unfortunately the VMware host never showed up. Your answer seems to be true. I shall just wait for some time before accepting it, maybe someone can provide me a hack. :) +1
    – ρss
    Jun 1, 2015 at 12:19
  • 1
    If the host doesn’t show up in your ARP table, it isn’t on the local network. Try tracert to get meaningful results.
    – Daniel B
    Jun 1, 2015 at 12:20
  • I tried tracert and the result is that the machine is just at one hop. This is fine because the machine is in DMZ and I am in the internal network. But tracert doesn't give any clue about the VMware host either! It seems like the Vmware host is transparently passing the traffic to the guest machine and vice-versa.
    – ρss
    Jun 1, 2015 at 12:25
  • 1
    Yes, of course. The VMware ESXi host operates a virtual network switch. Just like a real network switch, it is “invisible”.
    – Daniel B
    Jun 1, 2015 at 12:30
1

If you have the vsphere client, you can open the console of a guest machine and the title bar will show you which host you are connected to: enter image description here

You can see in the example above that the XA_StreamDev is on a host (with its name faded out). If you ping that host name, you will be able to get its ip address.

To open the full console, right click your VM and select "Open Console".

Also, if you go to VCenter > Hosts & Clusters > you will be able to see a list of hosts - which again, you should be able to ping.

2
  • Thanks but this solution will only work if I am able to login to the guest machine via VMware client. In my case I am not able to login to the guest vm.
    – ρss
    Jun 1, 2015 at 11:56
  • So you have a vm on a vsphere client and you only know the IP of the guest - hoping that from it you can ge the IP of the host?
    – Fazer87
    Jun 1, 2015 at 12:05
1

Theoretically, you may find that ESXi host can't be accessed because its IP address is beyond your scope.

But if you know its IP address range which you can access, the following tools ("ESXi host finder") can help you to find which one is the possible ESXi host:

ESXi Host Finder Picture

https://yinqingwang.wordpress.com/2016/01/18/esxi-host-finder/

3
  • This tool just saved me several days of annoyance. Thank you!
    – iwolf
    May 10, 2016 at 18:19
  • how to download it ?
    – Hamed
    May 2, 2019 at 7:28
  • download link not working
    – thilina R
    Jun 2, 2020 at 0:47
0

Yes you can.

With my vSphere client 5.5, I can enter Advanced search (right top corner) to add VM IP as search field.

enter image description here

enter image description here

EDIT:

Sorry that I overlooked the OP; but if you find the vm, you can see its host, naturally.....

You can open the VM, check the summary part, and there you have the IP of host.

enter image description here

2
  • Finding a VM by IP address was not the goal here.
    – Daniel B
    Feb 8, 2018 at 14:09
  • Edited... I overlooked it. Only lacked the last step.
    – WesternGun
    Feb 8, 2018 at 14:53
0
cat /etc/vmware/esx.conf | grep "/adv/Misc/HostIPAddr" | awk -F ' = ' '{gsub("\"", "");print $2}'

The IP is configured in the file cat '/etc/vmware/esx.conf' under the key /adv/Misc/HostIPAddr

The cat command captures the whole configuration file, the ouput is piped to grep

The grep command filters out all input except the line containing the key we want, the whole line is piped to awk

awk splits the line by the '=' character and grabs the IP on the second column, the 'gsub' awk subcommand removes the double quotes.

1
  • 3
    Could you please edit your answer to give an explanation of why this code answers the question? Code-only answers are discouraged, because they don't teach the solution.
    – DavidPostill
    May 15, 2021 at 20:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .