tailscale: macOS brew package does not start
What is the issue?
I just installed tailscale with brew install tailscale to try out Tailscale Funnel but the Tailscale service fails to start.
When running brew services I get the following output:
tailscale error 256 sebastian ~/Library/LaunchAgents/homebrew.mxcl.tailscale.plist
Checking the logs with cat /opt/homebrew/var/log/tailscaled.log
tailscaled requires root; use sudo tailscaled (or use --tun=userspace-networking)
Trying to enable the service with sudo privileges doesn’t work either. Is this a known error?
Steps to reproduce
brew install tailscale
tailscale up
Are there any recent changes that introduced the issue?
Not sure.
OS
macOS
OS version
13.3
Tailscale version
1.38.3
Other software
No response
Bug report
N/A
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 5
- Comments: 18 (2 by maintainers)
What’s worked in my testing is to NOT do the
brew installundersudo:But then do the remaining commands under
sudo:Thanks for the information. I’ve updated the snippet above. the
-cstands for changes, it print in case it has changed any permissions. I have GNU utils in my$PATHfrom/opt/homebrew/opt/coreutils/libexec/gnubinand GNU coreutils’s chown support-cas well as allow for arguments to be at any position, unlike BSD chown that MacOS uses by default.Here’s how it looks with GNU chown:
To fix this, I did this:
Copied and modified the startup file at
/opt/homebrew/opt/tailscale/homebrew.mxcl.tailscale.plistand placed it at/Library/LaunchDaemons/com.tailscale.tailscaled.plistThen, do this:
Now tailscaled starts correctly.
The modified plist looks like this:
I think it is on the brew side to deal with it however I feel like getting this done would require tohe official tailscale client here to have some guideliness how to run it as a headless daemon on MacOS system. I much prefer the brew-installed tailscale CLI over the GUI variant.
My solution has been to install and update tailscale with
brewas normal (i.e. not usingsudo) and then follow the instructions from Tailscale in the section ‘Run the tailscaled (daemon)’. Seems to work well and then there’s no issue with messed up permissions in my homebrew installation.The result of it is brew not working well after that.
Which means after running brew services start as root you need to bump back privileges to your own user, otherwise it will simply not work for other apps.
For people that might come in here from web search, the best so far way to handle it I found is
And repeat the last step every time you use brew services with sudo (start/stop/restart after upgrade).
EDIT: Updated the snippet above to work with BSD chown.
What a nightmare to get this working 😄 @ksylvan solution worked for me, thanks!
For me, only
brew servicesneeds to be executed withsudo:This is not ideal though (as the message indicates), but it should unblock folks.