Making WireGuard from Homebrew Work on an M1 Mac
After writing the post on using WireGuard on macOS (using the official WireGuard GUI app from the Mac App Store), I found the GUI app’s behavior to be less than ideal. For example, tunnels marked as on-demand would later show up as no longer configured as an on-demand tunnel. When I decided to set up WireGuard on my M1-based MacBook Pro (see my review of the M1 MacBook Pro), I didn’t want to use the GUI app. Fortunately, Homebrew has formulas for WireGuard. Unfortunately, the WireGuard tools as installed by Homebrew on an M1-based Mac won’t work. Here’s how to fix that.
The key issues with WireGuard as installed by Homebrew on an M1-based Mac are:
- On an M1-based Mac, Homebrew installs (by default) to the
/opt/homebrewprefix. By comparison, Homebrew uses/usr/localon Intel-based Macs. Some of the WireGuard-related scripts are hard-coded to use/usr/localas the Homebrew prefix. Because the prefix has changed, though, these scripts now don’t work on an M1-based Mac. - WireGuard has a dependency on Bash. Unfortunately, the version of Bash supplied by macOS isn’t supported by WireGuard (it’s too old). Without a very specific PATH configuration, even installing the Homebrew version of Bash—which is Continue reading




