-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: NetClient broken on M1 (arm64) Mac #20
Comments
When attempting an upgrade from 0.14.6 to 0.15, netclient tried to install in /Applications/ and the whole setup broke. I had to manually uninstall and install 0.15.0 cleanly, then apply the above fix. |
is it ok to run netclient on MacOS without the daemon? (launchctl unload /Library/LaunchDaemons/com.gravitl.netclient.plist) And only use it with "sudo netclient daemon" when required to join the netmaker network? |
if your run without the daemon, the client will not get any updates from the server ....eg if another peer joins or leaves the network or if a gateway is created or deleted. Also, if your local public ip or wg listening port changes, the server will not be updated and thus all the other nodes in the network will not get your new endpoint. instead of running without the daemon you would be better to not install netclient, create an extclient and download the conf file to your mac, copy it to /etc/wireguard/wg0.conf and just run wg-quick up wg0 |
If I run “sudo netclient daemon” on a terminal on demand only. Is this the same? |
netclient daemon is not a one-shot program, it runs continuously |
Yes I know. Id like to leave terminal open as long as I need the netclient to run. my unix/linux knowledge tells me its ok, but I wanted to make sure as I might be missing something MacOS specific. |
Hi @varoudis, You can see a discussion of the first issue here- We* also had the second issue with the .pkg version for macOS, and the devs fixed it. At this point I'd advise moving to the .pkg version- it does everything I can think of to be compliant with Apple's rules. Brew faces an impossible task - it doesn't do stuff 'the Apple way' and things break in interesting ways... PS I migrated my data from Intel to M1 over the weekend and my netclient came across with no issues... |
@adamphetamine The reason you had no issues after migration is likely because Homebrew kept its old prefix (/usr/local) instead of using the new, M1 prefix (/opt/homebrew). |
@ViRb3 I am not using Brew version, |
brew package updated |
@mattkasun you're missing a closing bracket which completely breaks the script: |
@ViRb3 good catch... fixed |
Hmm, even with the new changes I don't see a difference in behavior. Maybe Homebrew is still downloading the old version from before these fixes, even though I deleted all caches and reinstalled the tap? Anyway, I also noticed a few more issues:
I would recommend running the scripts through https://github.com/koalaman/shellcheck, it catches all of these issues. I took the liberty to simplify the installation and crafted an upstream formula: Homebrew/homebrew-core#109801. Due to being a formula instead of a cask, it comes with a bunch of benefits such as building from source, releases per macOS version and architecture, and automatic daemon management. I tested it and works great on M1 Mac. |
Contact Details
No response
What happened?
Traditionally, homebrew uses a prefix of
/usr/local/bin
. This means thatnetclient
would be installed under/usr/local/bin/netclient
. This path is also hardcoded in the launch daemon created on installation from homebrew.On M1 (arm64) Macs, due to the architectural changes, homebrew changed its prefix to
/opt/homebrew
. This means thatnetclient
is now installed under/opt/homebrew/bin/netclient
. This means that the launch daemon is invalid and essentially renders netclient unusable. Additionally, the PATH environment variable in the launch daemon needs to have/opt/homebrew/bin
, as this is wherewg
would be. But what is more, even after fixing these two issues,netclient
still does not run due to the raised security level on the new Macs:This is trivial to fix though, remove the quarantine flag of the binary in your installation script:
After applying all these changes, I can finally use netclient. I hope you can incorporate what is necessary to fix it for everyone :)
TL;DR of fixes (run as sudo):
Thanks!
Version
v0.14.6
What OS are you using?
Mac
Relevant log output
No response
Contributing guidelines
The text was updated successfully, but these errors were encountered: