Skip to main content

Set Up a Mac as a Host

Prepare a Mac to host Daintree for your other machines: Remote Login and keys, start at login and the logged-in session, automatic login and sleep, This machine as a host settings, the host's own screen, Local Network permission and stopping a host.

Updated
Reviewed

Prepare the Mac

A Mac host needs ssh and your key before you add it. The Add host dialog can install Daintree for you.

  1. Turn on Remote Login. On the host Mac, open System Settings → General → Sharing, turn on Remote Login (that is ssh), and allow your user.
  2. Install your key. From the machine you work on, run ssh-copy-id you@studio-01.local, then check that ssh you@studio-01.local 'echo ok' prints ok without a prompt.
  3. Use an account that can write to /Applications if you want Daintree to install or update itself there. Installs land in /Applications/Daintree.app, which is also the only place Daintree looks for an existing copy.

Then add it from your machine: Settings → Hosts → Add host, as in Add a Remote Host. Once Remote Login is on, the Mac usually appears under Machines found by its Bonjour name. If Daintree has never run on that Mac, open it once at the machine before the Enable step: macOS asks to approve a first launch, and nobody can click that over ssh.

Keep It Serving

On a Mac, Host mode runs inside a logged-in user's session. Start at login installs a Daintree LaunchAgent, ~/Library/LaunchAgents/org.daintree.app.host.plist, that starts Daintree with no window when you log in. It never runs from an ssh login on its own, which is why the session matters.

  • Stay logged in, or for an unattended Mac turn on automatic login for that user (System Settings → Users & Groups). Then a power cut or a restart brings Host mode back by itself.
  • Stop it sleeping. A sleeping host drops its connection. The Add host dialog's Advise step and the host's own Settings show the current setting and the fix: sudo pmset -a sleep 0 disksleep 0.
  • Stopped is not fatal. If ssh reaches the Mac but Daintree isn't serving, a client that needs it starts Daintree there in Host mode and connects, usually within seconds. If Daintree hasn't started listening within a minute, the client says so. It does that only when the host's own record says Host mode is on, and it never installs or changes anything.

With nobody logged in, Daintree can't start: Couldn't start Daintree on you@studio-01.local. Log in there (or turn on automatic login), then connect again.

This Machine as a Host

On the host itself, Settings → Hosts → This machine as a host shows and controls the same thing setup did. It is on every Mac and Linux copy of Daintree, so any of your machines can serve the others.

  • Allow this machine to be a host: Host mode itself. Listens on a socket only you can open; other machines reach it through SSH.
  • Start at login: the LaunchAgent. Turning Host mode on here does not turn this on by itself; setup from another machine turns on both. Turning Host mode off removes the LaunchAgent too.
  • Advertise on this network: lets Daintree on nearby machines find this one by name, platform and architecture. On by default. Turn it off on networks you don't trust; you can still add the machine by its SSH address.

While Host mode is on, status rows show what it found, with a warning mark on anything that needs attention:

RowWhat it reports
SocketListening at …/host.sock, and whether it is advertised on the local network
Start at loginWhere the LaunchAgent is, or that it is missing or launches a different copy of Daintree
KeychainWhether a test encrypt and decrypt worked, with Check to run it again
SleepThe pmset sleep settings, and the command to change them
Attached machinesNo other machines attached, or each connected machine and how many projects it is driving
This machine as a host, on a Mac serving one other machine

The Host's Own Screen

A Mac host is still a Mac with a screen, and Daintree still works on it. Clicking Daintree in the Dock opens a window into the same running Daintree that serves your other machines, with the same projects and terminals. Closing that window doesn't stop Host mode.

While other machines are connected, the toolbar shows who: a pill reading Greg's MacBook Pro connected, or Greg's MacBook Pro controls 1 project, or 2 machines · 1 has control. Its menu, Connected to this machine, lists each machine, what it has control of and when it connected, with Host settings….

When a machine has control of the project a window here is showing, that window is viewing: Greg's MacBook Pro has control of this project · Viewing here. Take control hands it back to this screen. The other machine then sees studio-01's own screen has control of this project, and can take it back the same way.

On the host's own screen: who is connected, and what they have control of

Local Network Permission

macOS asks whether Daintree may find devices on your local network: Daintree connects to your other computers on the local network over SSH so you can work with their projects, and looks for Daintree hosts nearby. Allow it if you use hosts on your network.

  • On the machine you work on, a denied permission makes connections macOS treats as local fail, until Daintree is turned on in System Settings → Privacy & Security → Local Network.
  • On a Mac host, the same question appears on the host's own screen, and it covers everything its terminals and agents run. Until it is allowed there, they can't reach other machines on your network, and .local names can take half a minute to look up.

The Keychain

Plugin secrets on a Mac host are stored encrypted with that Mac's keychain, and credentials are never copied from your machine. When Host mode is first turned on, Daintree runs a test encrypt and decrypt at the machine. If the keychain needs approval, the prompt appears on the host's screen. If the check hasn't finished after 10 seconds, the Keychain row says it may be waiting on a prompt at that machine. Answer it there, then press Check.

Stopping a Mac Host

Quitting Daintree on the host stops it serving, but a client still trying to connect may start it again, because the host is set up to serve. To stop a Mac serving for real, turn off Allow this machine to be a host on the Mac itself, or remove it from the host list on every machine that uses it.