[codex] fix: assign unique hostname to macOS VMs - #32
Draft
czmDeRepository wants to merge 1 commit into
Draft
Conversation
CMGS
reviewed
Aug 24, 2026
CMGS
left a comment
Contributor
There was a problem hiding this comment.
image/script only, bash -n passes. the design is sound — persistent daemon deriving all three host names from the first 8 hex of IOPlatformUUID is idempotent and self-healing. two notes, neither blocking:
- only effective with
--random-smbios. without it every guest shares the golden's SMBIOS UUID, so they all become the samecocoon-mac-<8>— the collision is renamed, not removed. worth one line in the section comment so it isn't read as a universal fix. - reverse-dns label drift (see inline).
| <?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>Label</key><string>com.cocoon.set-hostname</string> |
Contributor
There was a problem hiding this comment.
label prefix is inconsistent across the daemons: existing com.cocoon.firstboot, this one com.cocoon.set-hostname, and #33 adds io.cocoon.resize-system-disk. pick one reverse-dns prefix for all three so they group predictably in launchctl.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Install a small persistent LaunchDaemon in provisioned macOS images that derives
ComputerName,LocalHostName, andHostNamefrom the VM's SMBIOS UUID.Why
Cloned macOS disks retain the source machine name. Multiple guests then advertise the same mDNS name and macOS resolves the collision by renaming hosts unpredictably. VMs created with
--random-smbiosalready have a stable unique UUID, which is a suitable source for an idempotent per-VM hostname.Validation
GOWORK=off go test ./...make fmt-check vet lintbash -n scripts/provision-macos.sh