VMware Fusion 11.5: Assigning static IP addresses to virtual machines

This tutorial will show you how to find out what range of IP addresses you can use when assigning a static address to a VMware Fusion 11.5 virtual machine.

Introduction

When creating a virtual machine with VMware Fusion*, the the default network will assign an IP address to the OS.

You cant change it to static without first knowing what the DHCP range is because it can cause a duplicate IP on the network.

What’s the DHCP range

You can find out what the range is by looking in the dhcpd.conf file of the network assigned to the VM. By default this will be a network shared with the host, with the Mac using NAT for the VMs to access the internet.

On my installation on VMware Fusion 11.5, the conf file is in the vmnet8 folder. Run the following command.

sudo vim /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf

The contents of the file should be similar to below.

subnet 192.168.99.0 netmask 255.255.255.0 {
        range 192.168.99.128 192.168.99.254;
        option broadcast-address 192.168.99.255;
        option domain-name-servers 192.168.99.2;
        option domain-name localdomain;
        default-lease-time 1800;                # default is 30 minutes
        max-lease-time 7200;                    # default is 2 hours
        option netbios-name-servers 192.168.99.2;
        option routers 192.168.99.2;
}
host vmnet8 {
        hardware ethernet 00:50:56:C0:00:08;
        fixed-address 192.168.99.1;
        option domain-name-servers 0.0.0.0;
        option domain-name "";
        option routers 0.0.0.0;
}

As you can see, the second line contains the range, which is:

192.168.99.128 to 192.168.99.254

This means we can use 192.168.99.3 to 192.168.99.127.

Example config of a static IP on Ubuntu 18.04

Let’s say you wanted to assign the static IP of 192.168.99.11 to your Ubuntu VM. Here’s what the Netplan config would look like.

network:
  version: 2
  renderer: networkd
  ethernets:
    ens33:
      dhcp4: no
      addresses: [192.168.99.11/24]
      gateway4: 192.168.99.2
      nameservers:
        addresses: [8.8.8.8]

This tutorial explains how to assign a static IP on Ubuntu 18.04 in more detail.