VMware Communities
trodemaster
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)
24 Replies
Mikero
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 Marketing Engineer: VCF
Reply
0 Kudos
trodemaster
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

Reply
0 Kudos
ivivanov
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.

__________
It is worse!
trodemaster
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.

dmpm
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?

Reply
0 Kudos
snobis
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.

Reply
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. 

Reply
0 Kudos
nancyz
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?

 

Reply
0 Kudos
snobis
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.

Reply
0 Kudos
eaglesrest
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?

Reply
0 Kudos
VahanYerkanian
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 }
bennoonan
Contributor
Contributor

Reply
0 Kudos
jaearick1
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.

 

Reply
0 Kudos
virtualnate
Contributor
Contributor

In my case, I don't want Fusion or Big Sur to provide DHCP Services at all and would prefer to use my own to divy out IP address on the private network.  Anyone found a way to turn off DHCP completely?

Nate Hudson
Senior Staff Solutions Engineer
vExpert, VMware
Reply
0 Kudos
VahanYerkanian
Contributor
Contributor

To start the DHCP Server

sudo /bin/launchctl load -w /System/Library/LaunchDaemons/bootps.plist

 

To stop the DHCP server

sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/bootps.plist

 

To configure the built-in DHCP server, edit the /etc/bootpd.plist, you'll need something like this:

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

    <key>bootp_enabled</key>

    <false/>

    <key>detect_other_dhcp_server</key>

    <integer>1</integer>

    <key>dhcp_enabled</key>

    <array>

        <string>en0</string>

    </array>

    <key>reply_threshold_seconds</key>

    <integer>0</integer>

    <key>Subnets</key>

    <array>

        <dict>

            <key>allocate</key>

            <true/>

            <key>dhcp_router</key>

            <string>192.168.10.1</string>

            <key>lease_max</key>

            <integer>86400</integer>

            <key>lease_min</key>

            <integer>86400</integer>

            <key>name</key>

            <string>192.168.10</string>

            <key>net_address</key>

            <string>192.168.10.0</string>

            <key>net_mask</key>

            <string>255.255.255.0</string>

            <key>net_range</key>

            <array>

                <string>192.168.10.100</string>

                <string>192.168.10.200</string>

            </array>

        </dict>

    </array>

</dict>

</plist>

 

Reply
0 Kudos
AntonioMeireles
Contributor
Contributor

@ivivanov 

hi, 


Any plans to get back the ability to set the actual IPs (by using perhaps the  /etc/bootptab scheme described above) in a new release soonish ?

I mostly use Fusion Pro with Vagrant to test stuff, and the loss of the ability to set an IP in a private_network in Big Sur is a major deal breaker for me that messes with almost everything :/, so getting this implemented would really, really be a major step forward. 

Thanks in advance and have a great weekend!

 

Reply
0 Kudos
trodemaster
Hot Shot
Hot Shot

Look into editing the internet sharing settings for macOS. Fusion is using the network services provided by the OS now. This article seems like a good starting point. https://www.amsys.co.uk/change-internet-sharing-subnet-on-mac-os-x/

Reply
0 Kudos
steve_loranz
Contributor
Contributor

I'm not getting any love with /etc/bootptab entries. In your example is blorg on a private host-only network or is it using NAT? Thanks.

 
 
 
Reply
0 Kudos
steve_loranz
Contributor
Contributor

Never mind... I had an address outside of the configured range in bootpd.plist. Reconciling that fixed it for me.

 
 
 
Reply
0 Kudos