VMWare on MacBook set static IPs for images

I use my Macbook recently more and more for internet browsing (doing market research), mailing and presentations. Yesterday I wanted to test LimeSurvey and needed a support for development environment.

I used to use VMWare images to run Ubuntu instances with nginx, postgresql and php. And in my Macs host file I have image IP written to be associated with development domain. Standard stuff I believe …

By default DHCP is run and if you are switching between images it will happen that IP of the image will change and domain will stop working. Checking and fixing hosts file is task that shouldn’t be done more than once.

To set up persistent IP for image you can do this:

  1. Determine guest machine name

  2. Determine MAC address

  3. VMWare get MAC address
    1 – get name
    2 – click on settings and network
    3 – copy MAC address
  4. Add static IP address to VMWare dhcp.conf

    Open /Library/Preferences/VMware\ Fusion/vmnet1/dhcpd.conf . vmnet1 is the virtual interface for “private to my MAC” networking in VMWare. If you have different adapter used number will differentiate. In this file, you’ll see a subnet clause that looks something like this:

    Take note of the line starting with range. The IP addresses you will assign your guest machines will need to fall outside that range. Add this to the end of dhcp.conf
  5. Update your hosts file

  6. Restart  VMWare

Leave a Reply

Your email address will not be published. Required fields are marked *

Please prove me that you are not spamer :) * Time limit is exhausted. Please reload CAPTCHA.