RSS
 

Static IP for VMWare Fusion

26 Aug

While trying to test an Apache installation running inside a VMWare Fusion instance, I found something irritating: Every time my Mac resumed from sleep, the IP address the guest OS used would increment by one, meaning whatever test scripts I was running from Safari or Firefox on my Mac would need to be adjusted to the new IP. Irritating.

The solution, fortunately, was quite simple, and came compliments of Craig Box:

  1. Run ifconfig inside the guest OS (the Ubuntu image, in my case) to find the MAC address of your virtual adapter
  2. Back on the Mac side, edit the bottom of /Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf (outside the “DO NOT MODIFY SECTION” tags) to create a static assignment that looks like:
    host developer-vm {
            hardware ethernet 00:0c:29:0e:5f:3f;
            fixed-address 192.168.139.100;
    }

The only note is that whatever fixed-address you assign must be within the randomly-assigned class-C subnet that VMWare is already using (i.e. the 192.168.nnn.0/24 that you’ve been getting dynamic addresses within; mine is “139″ above) ; if you need to change yours, that needs to be updated in /Library/Application Support/VMware Fusion/networking

To restart the service, you can reboot your VM. Theoretically, you can also try
sudo "/Library/Application Support/VMware Fusion/boot.sh" --restart and then trigger a DHCP Refresh within the VM, but that seemed like overkill to me…

Good luck!
/m

 
No Comments

Posted in sysadmin

 

Leave a Reply

 
 
 
Info about our use of ads