Changing MAC Address on an existing image prevents disables SSH. #120

Closed
opened 2025-12-28 23:25:14 +01:00 by adam · 2 comments
Owner

Originally created by @sickcodes on GitHub (Feb 9, 2021).

ssh works

docker run -it     \
--device /dev/kvm  \
-p 50922:10022   \
-v "${PWD}/mac_hdd_ng_auto.compressed.img:/image" \
-v /tmp/.X11-unix:/tmp/.X11-unix   \
-e "DISPLAY=${DISPLAY:-:0.0}"  \
sickcodes/docker-osx:naked

ssh unworks

docker run -it     \
--device /dev/kvm  \
-p 50922:10022   \
-v "${PWD}/mac_hdd_ng_auto.compressed.img:/image" \
-v /tmp/.X11-unix:/tmp/.X11-unix   \
-e "DISPLAY=${DISPLAY:-:0.0}"  \
-e MAC_ADDRESS="0f:44:a3:8d:4d:16" \
sickcodes/docker-osx:naked

Could be related to multicast generic MAC addresses? or cache related?

Originally created by @sickcodes on GitHub (Feb 9, 2021). ssh works ```bash docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v "${PWD}/mac_hdd_ng_auto.compressed.img:/image" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ sickcodes/docker-osx:naked ``` ssh unworks ```bash docker run -it \ --device /dev/kvm \ -p 50922:10022 \ -v "${PWD}/mac_hdd_ng_auto.compressed.img:/image" \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e "DISPLAY=${DISPLAY:-:0.0}" \ -e MAC_ADDRESS="0f:44:a3:8d:4d:16" \ sickcodes/docker-osx:naked ``` Could be related to multicast generic MAC addresses? or cache related?
adam closed this issue 2025-12-28 23:25:14 +01:00
Author
Owner

@sickcodes commented on GitHub (Feb 9, 2021):

Possible fix:

sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
sudo rm /Library/Preferences/SystemConfiguration/preferences.plist
reboot

If this fixes it, I'll edit the master image and delete that file so when the user boots up, they have fresh interfaces without any networking cached data.

@sickcodes commented on GitHub (Feb 9, 2021): Possible fix: ```bash sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist sudo rm /Library/Preferences/SystemConfiguration/preferences.plist reboot ``` If this fixes it, I'll edit the master image and delete that file so when the user boots up, they have fresh interfaces without any networking cached data.
Author
Owner

@sickcodes commented on GitHub (Feb 10, 2021):

Fixed, must/should a real mac address from the right vendor:

curl https://gitlab.com/wireshark/wireshark/-/raw/master/manuf \
    | grep -e 'Apple\,\ Inc\.' > apple_mac_addresses.list

sort --random-sort -o apple_mac_addresses.list apple_mac_addresses.list

RANDOM_MAC_PREFIX="$(cut -d$'\t' -f1 < apple_mac_addresses.list  | head -n1)"

NEW_MAC_ADDRESS=$(printf "${RANDOM_MAC_PREFIX}:%02X:%02X:%02X" $[RANDOM%256] $[RANDOM%256] $[RANDOM%256])

echo "${NEW_MAC_ADDRESS}"
@sickcodes commented on GitHub (Feb 10, 2021): Fixed, must/should a real mac address from the right vendor: ```bash curl https://gitlab.com/wireshark/wireshark/-/raw/master/manuf \ | grep -e 'Apple\,\ Inc\.' > apple_mac_addresses.list sort --random-sort -o apple_mac_addresses.list apple_mac_addresses.list RANDOM_MAC_PREFIX="$(cut -d$'\t' -f1 < apple_mac_addresses.list | head -n1)" NEW_MAC_ADDRESS=$(printf "${RANDOM_MAC_PREFIX}:%02X:%02X:%02X" $[RANDOM%256] $[RANDOM%256] $[RANDOM%256]) echo "${NEW_MAC_ADDRESS}" ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#120