Skip to content

[Bug]: NetClient broken on M1 (arm64) Mac #20

Open
@ViRb3

Description

@ViRb3

Contact Details

No response

What happened?

Traditionally, homebrew uses a prefix of /usr/local/bin. This means that netclient 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 that netclient 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 where wg 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:

Screen Shot 2022-08-21 at 02 04 41

This is trivial to fix though, remove the quarantine flag of the binary in your installation script:

xattr -c /opt/homebrew/bin/netclient

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):

sed -i '' 's|/usr/local/bin/netclient|/opt/homebrew/bin/netclient|g' /Library/LaunchDaemons/com.gravitl.netclient.plist
sed -i '' 's|/usr/local/sbin|/opt/homebrew/bin:/usr/local/sbin|g' /Library/LaunchDaemons/com.gravitl.netclient.plist
xattr -c /opt/homebrew/bin/netclient

# if applying changes post-mortem, need to reload launch daemon
launchctl unload /Library/LaunchDaemons/com.gravitl.netclient.plist
launchctl load /Library/LaunchDaemons/com.gravitl.netclient.plist

Thanks!

Version

v0.14.6

What OS are you using?

Mac

Relevant log output

No response

Contributing guidelines

  • Yes, I did.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions