Bridge network guest receiving same ip address from external dhcp server
BEFORE SUBMITTING YOUR ISSUE, PLEASE LOOK AT THE PINNED ISSUES AND USE THE SEARCH FUNCTION TO MAKE SURE IT IS NOT ALREADY REPORTED. ALWAYS COMMENT ON AN EXISTING ISSUE INSTEAD OF MAKING A NEW ONE.
Describe the issue
When I configure
- Two guests with bridge networking
- Both guests have cloud-init installed and dhcp on the first interface
When booting both machines, both receive the same IP address from the dhcp server! 😅 The MAC address of the network cards is different inside of UTM.
Configuration
- UTM Version: 4.6.4
- macOS Version: 15.2
- Mac Chip (Intel, M1, ...): M2 Pro
From the Omada logs
Yeah pretty strange 😆
Could be related to me using the WiFi adapter instead of the ethernet adapter as mentioned here https://superuser.com/questions/1269435/vm-guest-getting-assigned-same-ip-as-host-when-using-bridge-adapter.
Changing from WiFi to the host adapter for the bridge interface (and rotating the MAC addresses) didn't help unfortunately. Both still get the same IP 🤔
I'm also running into this trying to run two Ubuntu VMs on macOS. Each has a unique MAC address and is configured to bridge from the Mac's Ethernet card.
Same issue on Ubuntu 24.04 guests.
Well, it turns out to be caused by conflicting /etc/machine-id in case of cloned VMs. Edit the last digit of your clone's machine-id, and DHCP works.
When creating bento vagrant boxes we have to cleanup the machine-id on ubuntu before ending the image creation otherwise cloning the image to multiple vm's will create dhcp IP issues. https://github.com/chef/bento/blob/main/packer_templates/scripts/ubuntu/cleanup_ubuntu.sh#L92