Skip to content

fix: launchctl load before kickstart for SSH and screen sharing on macOS 26#32

Closed
celanthe wants to merge 2 commits into
mainfrom
fix/macos26-ssh-launchctl
Closed

fix: launchctl load before kickstart for SSH and screen sharing on macOS 26#32
celanthe wants to merge 2 commits into
mainfrom
fix/macos26-ssh-launchctl

Conversation

@celanthe

@celanthe celanthe commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • On macOS 26, launchctl enable system/com.openssh.sshd fails with could not find service on a fresh VM because the service isn't bootstrapped into launchd yet. launchctl enable requires the service to already be registered.
  • Replaces launchctl enable with launchctl load -w, which registers and enables the service in one step. launchctl kickstart then starts it immediately.
  • Same fix applied to screen sharing: collapsed the duplicate version branches since both now use launchctl load -w, with kickstart only on macOS 26+.

Verified on macOS 26.5.1: ssh.plist is present at /System/Library/LaunchDaemons/ssh.plist with label com.openssh.sshd.

Test plan

  • Run setup/setup.sh on a fresh macOS 26 VM and confirm SSH is accessible after completion
  • Confirm screen sharing also comes up correctly on macOS 26
  • Confirm no regression on pre-26 macOS (systemsetup path unchanged)

🤖 Generated with Claude Code

…g on macOS 26

launchctl enable fails on a fresh VM because the service isn't yet
bootstrapped into launchd. Switching to launchctl load -w registers
and enables the service in one step, after which kickstart works.

Verified on macOS 26.5.1: ssh.plist is present with label com.openssh.sshd.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@celanthe celanthe self-assigned this Jun 3, 2026
@celanthe celanthe marked this pull request as draft June 3, 2026 17:11
Without ServerAliveInterval, a silent VM left the SSH call hanging
indefinitely. The step now fails within ~90 seconds of the VM going
silent, and hard-kills at 15 minutes regardless.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@celanthe

celanthe commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Closing - the SSH keepalive and timeout changes from this PR are now included in #33. The setup.sh changes here were superseded by changes already on main (launchctl enable approach for macOS 26 was already correct there).

@celanthe celanthe closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant