Hot Shot
Hot Shot

Big Sur hosts with Fusion. Is vmnet-dhcpd-vmnet8.leases file still used?

Is it expected that the /var/db/vmware/vmnet-dhcpd-vmnet8.leases file be populated with guest os dhcp leases when the host is Big Sur macOS 11? The packer tool expects to parse this file to get the IP of created VMs before the OS responds in any way. What I'm seeing is that file is empty even if the guest VM is reachable with a dhcp provided IP. Depending on how it's supposed to work in the new hypervisor.framework style I'll open a bug with VMware Fusion or packer. Please Advise, Blake

Tags (3)
13 Replies
Community Manager
Community Manager

Hey Blake,

I think it's us... I too see those .leases files to be blank on Big Sur (minus the very colorful warning message about UTC) when compared to my Catalina installation.

I've asked Eng to clarify and advise what Packer should be doing now.

Sorry about this... there were a lot of moving parts in this change, we should have had documented some of these lower-level ones better.

- Michael Roy - Product Line Manager: Fusion & Workstation
0 Kudos
Hot Shot
Hot Shot

Had a quick update from Michael today via email. Sounds like we are still waiting to hear back from Fusion engineering on how this is supposed to work going forward. I have opened a bug to track this behavior on the packer side as well. https://github.com/hashicorp/packer/issues/10177

0 Kudos
VMware Employee
VMware Employee

Hi Blake,

In Fusion 12 we have switched to using Apple network virtualization API. This was required because of Apple's decision to disable usage of any 3rd-party kernel extensions in macOS 11 Big Sur.

In the legacy mode (with kernel extension) we have been using our own DHCP server and we have got full control over it. The leases file was a part of the operation of the DHCP server.

With network virtualization API now the DHCP server is provided by Apple vmnet framework. The only control that the API provides for controlling this server is the first and last address of the DHCP range for a given subnet. We don't have control e. g. of the DHCP lease time, or we cannot add static MAC-to-IP mappings. The leases file is no longer required for running Fusion, and more - we don't have a way to retrieve this information using the Apple vmnet API.

I don't have an idea how to retrieve this information in another way. The only thing that comes to my mind is using VMware Tools. Apart from that - Fusion does not have this information, and currently I am not aware of any API that could provide it. It is available only to the Apple DHCP server.

Hot Shot
Hot Shot

Yeah Apple leaving features out when shuffling APIs around is Standard Operating Procedure for them... Here is what I propose doing.

BRIDGE_IF=$(pgrep -lf rtadvd | grep -E -o "bridge[0-9]+")

MAC_ADDR=Get the mac addr from fusion gui and collapse any leading zero padding

sudo arp -i $BRIDGE_IF -a | grep $MAC_ADDR | grep -E -o "([0-9]+\.){3}[0-9]+"

Exposing the resulting IP via one of the vmrun commands like this would be ideal for the long term.

vmrun readVariable '/Users/blake/Virtual Machines.localized/macOS 11.0.vmwarevm/macOS 11.0.vmx' runtimeConfig ip

You should be able to use the ndp tool to get the IPv6 addresses in a similar manner but didn't have time to sort that part out yet.

Contributor
Contributor

Wow, this is very annoying. I use a gateway VM to provide firewalling between different network segments. This is totally messed up by the Apple DHCP server. Any workaround / hack to disable it?

0 Kudos
Enthusiast
Enthusiast

Hmmm... that would explain some problems (files in /Library/Preferences/VMware\ Fusion/vmnet8 magically being resetted after edit).

But even with the described constrains (only a dynamic address range may be defined), it does not work. My current setup is only a single VM with a Windows 10 guest. It is always assigned the address 192.168.xxx.2 (of my manually configured subnet - that is IIRC from around Fusion 3 and has been respected even with the current upgrade to Fusion 12 and MacOS 11 Big Sur). The dhcpd.config says it provides the range from .128 to .254, but it seems the Apple DHCP server has other ideas. What's worse: The dhcpd.config says it will announce .2 as DNS server - and this information is set inside the Windows guest. So my guest gets the IP .2 and also .2 as DNS server - that does not work. So currently, DHCP seems a bit broken on Fusion 12 and Big Sur. The only workaround I currently found is to manually configure static IP inside the guest (but as I use this and other VMs on different hosts and copy VMs around quite a bit, it is not a very good solution for the long term). Also getting back the ability to assign static DHCP address (like it is possible with VMware Workstation on Linux) would be really nice.

0 Kudos
Anonymous
Not applicable

If your finding this thread trying to troubleshoot non packer related issues keep in mind on Big Sur Fusion is required to use apples network stack now. Any configuration of dhcp and nat needs to focus on apple internet sharing settings. The fusion config files exist to support macos 10.x not 11.x. 

0 Kudos
VMware Employee
VMware Employee

Hi @snobis

The dhcpd.config is not used on Big Sur, the IP address range is declared in nat.conf. VMs will get new IP address assigned by DHCP server. Could your try to disconnect and reconnect the network adapter of your VM?

 

0 Kudos
Enthusiast
Enthusiast

Hi @nancyz 

My previous attempts to edit nat.conf failed (all changes have been reverted on the next start of Fusion). Is there a way (new options in nat.conf) to at least specify the exact address range for DHCP? Serving the lower half (e.g. from .2 to .127) is the exact opposite of the previous default of Fusion and Workstation. I have many VMs that mostly run on Linux hosts (with Workstation) that are sometimes copied to my MBP with Fusion. Some of these VMs have static IPs configured inside the guest, some rely on DHCP. The static IPs are all in the lower half. So, in order to still be able to use my VMs on Linux and Fusion I need to control the DHCP address range - or else I need to reconfigure all my VM network settings (because of my current setup and many tools inside the guests relying on some static IPs, configured in many different places, that would be quite an amount of work - in other words: will not happen; I do not pay you in order for me having much more work). This is a really bad and very annoying situation.

0 Kudos
Contributor
Contributor

Hi Nancy, I can see the options in nat.conf to change the dhcp assigned address range, but is there a way to completely disable mac dhcp using params in this file?

It seems that any changes to the file are overwritten on fusion restart?

0 Kudos
Contributor
Contributor

Leases managed by the new Apple DHCP server on macOS 11 Big Sur are stored in /var/db/dhcpd_leases:

{ ip_address=192.168.191.4 hw_address=1,0:c:29:b0:9e:ae identifier=1,0:c:29:b0:9e:ae lease=0x5fd4a699 name=centos8 }
0 Kudos
Contributor
Contributor

0 Kudos
Contributor
Contributor

Expanding on bennoonan's entry, which DOES work, thank you...  The /etc/bootptab file does not exist in Big Sur until you create it.  Read the manpage for bootptab first.  In my case, for a Centos 8 vmware host named "blorg", I created the following file:

# bootptab file for Big Sur and VMWare Fusion 12.1 to get fixed IPs working

%%

# hostname hwtype hwaddr ipaddr bootfile

blorg.local 1 00:0c:29:28:25:f7 172.16.20.251 boot

After installing this file and rebooting my Centos vmware host, I properly got the 172.16.20.251 IP number I wanted for host "blorg".  This IP number is in the upper half of the class C 172.16.20.x, as specified in the /Library/Preferences/VMware Fusion/vmnet8 file.  The vmnet8 file was what I previously used in Catalina to specify fixed IP numbers, with "host" declarations therein.  Note: I did not know what to use for the hwtype and bootfile args, so I just followed the example from the manpage and it worked.  Adding /etc/bootptab does not affect the booting up of my Mac.

 

0 Kudos