-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macOS 15 doesn't set mac addr in dhcp_leases anymore #242
Comments
Hi phaer, thanks for opening the issue. It could be a side-effect of the MAC address randomization as you pointed out. We'll work on an enhancement to help users find the VM IP. Were you still able to log in into the VM using the first entry, though? |
Yes, the VM is reachable just fine. A workaround to get a predictable IP for the VM is to use a static mac address and convert that to a ipv6 link local ip (e.g. via ipv6calc or one the online calculators). |
Looks to work like a stack (populates at the top).
Wonder how these are so different with just a minute in between.
as the length is different. I would think IPv6, but that should not affect the hw address? |
Unlikely, as it is a timestamp from just a minute before. @phaer Was this a single start of the VM ? As I am confused why you got two different entries. Can you explain more how you were connected? The issue you reference assumes the format changed, as mentioned in canonical/multipass#3661 (comment). But I do not think this is the case. @vyasgun just ran this a few times and only got I suspect the guest OS. @phaer what did you start? |
On macos sonoma, we can still got the entry of the VM name created
|
This issue with "randomized" hw_address (canonical/multipass#3661) was fixed in multipass 1.14.1 (using canonical/multipass#3661 (comment) I added the workaround (as code) to a small shell script that I used, when running with vfkit instead of with qemu: https://github.com/afbjorklund/lima-the-hard-way/blob/main/getip.sh $ ./runvzf.sh&
INFO[0000] &{1 1024 {[efi variable-store=efi-variable-store create] true} [virtio-blk,path=disk.raw virtio-blk,path=seed.img virtio-net,nat,mac=52:54:00:70:2b:71] none:// false }
INFO[0000] boot parameters: &{EFIVariableStorePath:efi-variable-store CreateVariableStore:true}
INFO[0000]
INFO[0000] virtual machine parameters:
INFO[0000] vCPUs: 1
INFO[0000] memory: 1024 MiB
INFO[0000]
INFO[0000] Adding virtio-blk device (imagePath: disk.raw)
INFO[0000] Adding virtio-blk device (imagePath: seed.img)
INFO[0000] Adding virtio-net device (nat: true macAddress: [52:54:00:70:2b:71])
INFO[0000] virtual machine is running
INFO[0000] waiting for VM to stop
$ ./getip.sh "52:54:00:70:2b:71"
ubuntu has address 192.168.64.7 |
This is related to the guest OS that runs; in the case of CRC/ Podman Machine, we use gvisor/gvproxy. I guess the OP ran another OS. Note: I do not have access top a current macbook, so I had to base my assessment on the information given. As @afbjorklund does, the multipass project, uses |
From the name, I would guess NixOS |
Right... I never trust names given 'bogon' ;-) |
This would need to be fixed in minikube as well, it has some vintage code for the dhcpd leases parsing https://github.com/kubernetes/minikube/blob/master/pkg/drivers/common.go There is some other issue regarding "security" as well, where you have to open up access to localhost. |
I remember; We will eventually get to this on our end too, but not the highest priority. /me hides from @cfergeau... |
Hello, I can confirm that it seems to depend on the client, not the macOS version. You are right that it's NixOS in my case. The difference between my runs was that the one that has the mac address uses NixOS scripted networking ( So I suspect it might be related to some difference in the DHCP requests / GUID sent by the guest. I don't really have a use case left to look further, and i don't think there's much actionable stuff left for vfkit, except maybe a hint in the README? Feel free to close this :) |
It would still be nice if vfkit did all the parsing, and printed the IP address next to the MAC address But the current documentation is not wrong: "its IP can be found in |
5 minutes later I found https://unix.stackexchange.com/a/743782 which explains the whole thing. I just gave it a quick try and can confirm that it works as described. systemd-networkd (as well as probably other dhcp clients) defaults to sending a For nixos users systemd.network.networks."10-uplink" = {
matchConfig.Name = lib.mkDefault "en* eth*";
networkConfig.DHCP = lib.mkDefault "ipv4";
dhcpV4Config.ClientIdentifier = lib.mkDefault "mac";
}; |
I am glad this confirms my suspicions after analyzing Ubuntu bootlog yesterday; Note: will see if we can do something... though glad there is a workaround.
Ref: https://datatracker.ietf.org/doc/html/rfc3315#section-9 |
If you use cloud-init, it can be fixed by adding this network-config to your cidata.iso:
|
Hello,
usage.md
recommends/var/db/dhcp_leases
to get the IP address of a given virtual machine.But it seems like macOS Sequoia has changed the format of that file and haven't been able to find much about it nor to easily match DHCP leases with VMs.
The second entry is an older lease, probably from before I upgraded? It contains the mac address of my machine as expected. The first entry is a current lease, without a mac address. At least not a plain one, I haven't been able to find documentation about the new format.
canonical/multipass#3661 looks like it could be related.
I wonder if might be a side-effect of https://macadmin.fraserhess.com/2024/09/16/handling-mac-address-randomization-in-macos-15/.
The text was updated successfully, but these errors were encountered: