Can I determine the IP of a virtual machine using VMware Fusion without actually entering the operating system running on the virtual machine? I'm looking for a menu option, command line, or otherwise that I can issue against the virtual image with the VMware Fusion Software itself.

Thanks - Adron

  • If you know the MAC address of the virtual machine NIC you could always try to leverage your host machine's ARP cache, or reverse ARP. – ta.speot.is Dec 31 '11 at 0:59
  • 1
    It's amazing that vmware doesn't make this drop-dead obvious and easy like other vms! Cheers for the avahi answer, and nmap if you're desperate, but still - Big fail, VMware! – nealmcb Feb 8 '15 at 4:55

10 Answers 10


Short Answer: No

Long Answer: No but maybe

An IP address is purely the responsibility of an OS. Therefore, the virtual framework that holds the OS has no idea about the TCP/IP stack within unless there are symbiotic additions to the framework such as Hyper-V and VMware's additional guest tools (thanks to todda.speot.is in the comments below). It's not much different than wanting to browse the files on a VM without starting it up first.

Technically, if the VM relies on DHCP, you could search your DHCP server (likely your LAN's router) for the last lease that was handed out to the MAC address of the virtual NIC to get a good idea of what the IP would probably be the next time it launches. That's assuming that same IP wasn't handed out to another device in between when you looked at the lease history and when the VM started up.

  • 1
    Argh. I was hoping that VMware had some hooks into the OS that would provide that. :( I have no access to the corporate DHCP, thus have no idea since I don't have access to the actual OS either. – Adron Dec 31 '11 at 0:47
  • A hypervisor can hook in and get the IP address, Hyper V does it with its Guest Additions. And it seems some flavours of VMware will tell you, too kb.vmware.com/Platform/Publishing/images/1006098.JPG - but as WesleyDavid said, it's not really the hypervisor's responsibility to worry about this. – ta.speot.is Dec 31 '11 at 0:58

VMWare provides, not surprisingly, a built in tool for this, vmrun. It's under /Applications/VMware Fusion.app/Contents/Library/vmrun although it has moved around in other Fusion releases a bit.

🍺 vmrun list
    Total running VMs: 1

🍺  vmrun getGuestIPAddress ~/.docker/machine/machines/myvm.vmx
  • 7
    This should be the accepted answer. Worked perfectly. – Be Kind To New Users Feb 17 '16 at 19:03
  • 3
    Nice! vmrun is in my Mac's PATH by default, so vmrun getGuestIPAddress "$(vmrun list | grep vmx)", include the quotes! – Big Rich Oct 26 '17 at 9:59
  • 1
    Apparently VMWare Tools need to run in the VM. (Fusion V8.5) – Laryx Decidua Sep 4 '18 at 9:44

Here's a tip in case it helps anyone. Install avahi-daemon on the VM. This allows you to connect via hostname vmname.local, where vmname is the name of your virtual machine. In my case, the VM's name is baremetal and on the host I can run:

ssh baremetal.local

No need to know the VM's IP. :)

  • 1
    Nice idea but what about VMs that run operating systems where avahi-daemon is not available? Windows for instance comes to mind... :-) – Laryx Decidua Sep 1 '14 at 9:18

As Mikhail T. said, "Because VMWare is providing the NAT-ing, it ought to be able to tell us, what addresses it is currently NAT-ing for." Indeed it does:

In my VMware Fusion 6 installation, the vmnet-dhcpd daemon writes its leases to the files /var/db/vmware/vmnet-dhcpd-vmnetX.leases, where "X" is 1 and 8. Empirically :-) I established that it is vmnet8 that I should look for. Here is an excerpt from the lease file /var/db/vmware/vmnet-dhcpd-vmnet8.leases:

lease {
    starts 1 2014/02/17 09:34:19;
    ends 1 2014/02/17 09:36:56;
    hardware ethernet 00:0c:29:2b:2b:10;
    client-hostname "ubuntu";

The client-hostname is the name of the VM and the number after the word lease is its IP. You can parse these entries or just simply look at the most recent ones. Make sure the lease you are looking at is still valid.


It is possible -- at least, in the common case, where NAT-style network is configured for the guest. Because VMWare is providing the NAT-ing, it ought to be able to tell us, what addresses it is currently NAT-ing for. Something like vmrun list should be outputting this information. That it does not is a flaw...

But, in any case, here is how one can find out anyway. First, run ifconfig on your Mac (perhaps, ipconfig would do the same on Windows, but I haven't tested it). This will list all network interfaces on the machine -- both physical and virtual. Look for the vmnet-ones. On my Mac this produces:

% ifconfig | grep -A2 ^vmnet
ether 00:50:56:c0:00:01 
inet netmask 0xffffff00 broadcast
ether 00:50:56:c0:00:08 
inet netmask 0xffffff00 broadcast

So, my guest's IP is on either one of these two VM private networks: either or On your host there may be just one, lucky you, or more than two -- we need to check them all. Here is a very simple tcsh-script, entered directly on command-line, that did it for me. It attempts to ping each address in all of the class-C private networks managed by vmnet and ends, when a ping succeeds. The -W 500 option tells ping to wait only half a second for a response (could, probably, use even less), and the -c 1 tells it to send exactly one packet:

% set i=2
% while ( $i < 255 )
while? ping -W 500 -c 1 192.168.82.$i && break
while? ping -W 500 -c 1 192.168.123.$i && break
while? @ i++
while? end

The above little script ran for some time listing all the unsuccessful attempts to reach the non-existent addresses:

PING ( 56 data bytes

--- ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss
PING ( 56 data bytes

Until it finally succeeded and finished:

64 bytes from icmp_seq=0 ttl=64 time=0.307 ms

--- ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss

Voilà, I was able to ssh into my guest:

% ssh

Now, I only had a single guest running -- so the first IP-address to respond to a ping was the right one. If you run multiple guests at once, you may need to use the same or similar ping command to build a list of all such valid private IP-addresses and then try them all until you get into the correct guest...

(And, maybe, .130 is a good guess for NAT-based addresses anyway. But I can't say for sure.)

  • 1
    With nmap you find the up IPs faster ;-) nmap -sP 192.168.123.* – Robert Reiz Jan 21 '15 at 12:12

My solution to this was:

Once you have VMware tools installed, configure sharing, so that you can access a folder (any folder) from CentOS. Then, modify /etc/sysconfig/network-scripts/ifup-post to append your current date & ip address to a file in this shared folder.

How to do this:

Modify: /etc/sysconfig/network-scripts/ifup-post

add this before the last line of ifup-post ("exit 0"):

date >> /path/to/shared/folder/guest_ip.log
ifconfig >> /path/to/shared/folder/guest_ip.log

This will append your guest_ip.log with the date and return value of ifconfig each time the network comes up.

In my case, I decided to grep for a prefix of 192 on my ip address, since i know that between my home and work, it is always 192. This can be done by adjusting the above as follows:

date >> /path/to/shared/folder/guest_ip.log
ifconfig | grep 192 >> /path/to/shared/folder/guest_ip.log
  • "so that you can access a folder (any folder) from CentOS.". What about those people who 1) use other Linux distributions, 2) use UNIX operating systems other than Linux, 3) use non-Unix operating systems such as Windows, ... in their VMs? :-) – Laryx Decidua Sep 1 '14 at 9:20

Run in VM console ipconfig (if VM is Windows) or ifconfig (if VM is Linux).

IP of eth0 is the IP address that you are looking for.

  • The original question was "without actually entering the operating system running on the virtual machine?" This might have escaped your attention. – Laryx Decidua Sep 1 '14 at 9:22
  • It might not answer the question, but I ended up here with a slightly different question and it was helpful. – jamie-wilson Jun 1 '16 at 20:53

I had the same issue while running VMPlayer on Ubuntu 15.04. My virtual machine was set to NAT, and though I could determine its ip address by logging into the gui and running ifconfig in the VM, I could't ping or ssh into it.

Turns out when VMPlayer installed, it didn't enable dhcp on the vmnet1 and vmnet8 adaptor. Solution was to use the ubuntu gui to edit the network connections with "Edit Connections". Find vmnet1 under ethernet, and hit the edit button. Under IPv4 settings, enable DHCP, save and reboot.

Now if you run ifconfig on the command line, you'll notice that the vmnet1 has a ip address. SSHing into the nat-ed VM from the host now works as well.


From the manpages of vmrun (version 1.14.4 build-3204469):

getGuestIPAddress        Path to vmx file     Gets the IP address of  the guest

However, keep in mind that in order for this to work the VMware Tools suite should be installed in the guest OS and this step cannot be accomplished without logging to the guest OS. You can install the tools in a "base image" and create new images from it via cloning. Then you can use the above command to get the IP address of the newly created VMs.

arp -a| grep vmnet 
? ( at 0:c:29:83:1:e0 on vmnet8 ifscope [ethernet]

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.