Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pjkelly/1068716 to your computer and use it in GitHub Desktop.
Save pjkelly/1068716 to your computer and use it in GitHub Desktop.
VMWare Fusion Images with a static IP Address on Mac OS X Snow Leopard
@axeff
Copy link

axeff commented Feb 6, 2014

On OS X 10.9.1 (Maverick) + VMware Fusion 6.0.2 I found the dhcp.conf there:
/Library/Preferences/VMware\ Fusion/vmnet8

@bryancallahan
Copy link

I've been trying to get this going for a couple days down OS X 10.9.1 (Maverick) w/ Ubuntu 12.04 LTS guest. My if I try this /etc/network/interfaces file on the guest...

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

...I don't get any IPs (as I would expect). When I try this...

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.78.10
netmask 255.255.255.0
network 192.168.78.0
broadcast 192.168.78.255
gateway 192.168.78.1

...things seem to work properly. I get the IPs I would expect and can SSH into the box. The problem is that it hangs when I try to get outside to the Internet. I've tried adding a "dns-nameservers 192.168.78.2" and that seems to get me a little farther as it lets me resolve domain names to their IP address. That said it won't connect to anything. I can't "telnet 8.8.8.8 53" or "curl google.com" or anything as it just hangs. I sort of feel at the end of the rope. Any ideas?

@bryancallahan
Copy link

Wahooo! Found the solution via a forked gist. :p I just had to restart services (https://gist.github.com/mgutz/1b8b5569190155dc31b9).

sudo /Applications/VMware\ Fusion.app/Contents/Library/services.sh --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/services.sh --start

@jhalterman
Copy link

Restarting w/VMWare Fusion 7

sudo /Applications/VMware\ Fusion.app/Contents/Library/services/services.sh --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/services/services.sh --start

@skplunkerin
Copy link

thank you @bryancallahan that's exactly the piece I was missing, now everything works as it should :)

@sjbylo
Copy link

sjbylo commented Jan 29, 2018

I was having a problem finding the correct "VM name" as I thought it was the name of the VM itself. Then I discovered the actual name that the DHCP Client was sending to the virtual DHCP Server was the system hostname, e.g. the output of the command hostname. To verify which name the system is using, look into the DHCP Client configuration.

ps -ef | grep dhc

In the output, find the name of the .conf file and look into it.

cat /var/lib/NetworkManager/dhclient-ens33.conf
...
send host-name "master";
...

The line shown shows you the exact hostname to use in Fusion's vmnet8/dhcpd.conf file as described above. Hope that helps.

@aelkz
Copy link

aelkz commented Aug 19, 2020

VMWare Fusion 11.0.2 w/ OSX 10.14:

sudo /Applications/VMware\ Fusion.app/Contents/Library/services/services.sh --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/services/services.sh --start

@trevorh
Copy link

trevorh commented Feb 10, 2021

For Windows hosts (at least tested with 10 and Fusion 12.1), you need to ensure that in the dhcp.conf the hostname is the Windows Computer Name as given in a cmd window by the hostname command.

      image

host SQLServer-W10x64 {
    hardware ethernet 00:0c:29:9d:2a:38;
    fixed-address 172.16.179.102;
}

You might also need to delete the DHCP leases entry in /var/db/vmware/vmnet-dhcpd-vmnet1.leases or /var/db/vmware/vmnet-dhcpd-vmnet8.leases depending on whether you're dealing with the private/Host-only or NAT DHCP server.

There seem to be issues with Big Sur but I haven't upgraded yet. See here and here. Seems Big Sur doesn't allow Fusion to have its own DHCP servers and therefore manages it for Fusion.

@zarinfam
Copy link

zarinfam commented Jan 4, 2023

Very helpful, especially the comments thanks.

@therealevanhenry
Copy link

This was the best resource I found online to help me configure a guest VM with a static IP on MacOS. It's kind of surprising VMWare doesn't have better documentation for Fusion's networking.

@lixiaomei-git
Copy link

This was the best resource I found online to help me configure a guest VM with a static IP on MacOS. It's kind of surprising VMWare doesn't have better documentation for Fusion's networking.

I totally agree... I spent so much time on setting static IPs on vms...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment