HomeProjectsBlogTestimonialsAbout

A Light Guide for Installing Arch Linux on a MacBook Air 2015

- Posted March 2024 -

Introduction

I bought a MacBook Air 2015 from a friend last year, intending to use it as a Linux playground or baby home server. I installed Manjaro on it and enjoyed playing with it for a few days, then I left it on my shelf, untouched, for almost a year. About two weeks ago, as a little post-grad project, I decided to abandon Microsoft Windows and fully embrace Linux, making it my daily driver. Trying Arch with limited Linux experience seemed like an educational. trial-by-fire, and maybe even fun approach to adopting a new OS. I was still hestitant to jump in without any safety net though, and going through the process on a virtual machine just didn't appeal to me. So, I decided I should first go through the whole install/config procedure on my ol' dusty MacBook before doing it on my primrary laptop. I knew buying that thing was a good idea!

There are full-on guides for installing Arch on MacBooks and official Arch wiki pages specifically for Mac troubleshooting. I highly recommend you search for and read them as needed, they are very useful and I wouldn't be writing this without their help! There's more material than I initially realized, some are fancier walkthroughs that include extra things like dual-booting, and unfortunately some of it is just outdated. This article is not an installation walkthrough, I'm just providing recommendations/solutions that are specific to issues I encountered, for fun.


Section 1: Installing with iPhone Tethering

When I first started, I was getting tangled up in the documentation trying to set up an internet connection. It's much easier than I first thought.

Once you're in the live installation environment, simply plug your iPhone into the MacBook. Unlock the iPhone, and it should ask whether you "trust this computer" or not. If it doesn't ask you this, use the idevicepair pair command to initiate pairing. Once paired, your iPhone should automatically start a hotspot, and the Mac should automatically connect to it (start a hotspot if it doesn't do it automatically). Voila! That's it.

HOWEVER! iPhone tethering like this is not built into stock Arch, so you must pacstrap the usbmuxd and libimobiledevice packages. Plus, if you end up using networkd as your network manager, the tether won't automatically connect like it does in the live environment. You'll need to configure it as if it were any other wired connection (how to configure wired connection with networkd).


Section 2: Packages for Wi-Fi

The Macbook's wi-fi card (the Broadcom BCM4360) is unfortunately not supported by the default drivers, and it doesn't seem to jive well with iwd for wi-fi authentication, so we'll need to use other packages.

Here are the packages you should include during your pacstrapping process for connectivity (and why):

  • usbmuxd and libimobiledevice (for iPhone tethering)

  • broadcom-wl-dkms (drivers for Broadcom wi-fi card)

  • linux-headers (computer needs these for building Broadcom drivers)

  • wpa_supplicant (for wi-fi authentication (in place of iwd)

  • less (this one isn't actually related to wifi, it's just a suggestion of mine. It's very helpful when you're just using a basic tty that can't scroll, I pipe command outputs into it all the time)

For network management, I've been using networkd and resolved alongside wpa_supplicant / wpa_cli. I explain this setup in section five.


Section 3: Wi-Fi Driver Conflicts

The broadcom-wl-dkms package has some conflicts with other kernel modules, so we need to blacklist them.

Create/Edit the file as root: # nano /mnt/etc/modprobe.d/broadcom-wl-dkms.conf

This new file should just contain these lines:

blacklist b43
blacklist b43legacy
blacklist bcm43xx
blacklist bcma
blacklist brcm80211
blacklist brcmfmac
blacklist brcmsmac
blacklist ssb

Then, run mkinitcpio: # mkinitcpio -p linux

You should be all set.
source


Section 4: Bare Bones Network Management

If you want to go super barebones, you can just use the built in systemd-networkd and systemd-resolved packages plus wpa_supplicant for all of your network management needs (assuming you've installed wpa_supplicant). In this section, we'll use these tools to get connected!

Once you've gotten to the network configuration step of the install process and have set your hostname, you will need to make sure you have a networkd configuration file and a hosts file.

The networkd configuration file for your wi-fi card should be /etc/systemd/networks/25-wireless.network, and contain:

[Match]
Name=YOUR_WIFI_CARD_NAME

[Network]
DHCP=yes
IgnoreCarrierLoss=3s

source

Use ip link or networkctl to find your wifi card's name. Mine was wlp3s0, yours will likely be similar.

The hosts file should be: /etc/hosts, and contain:

127.0.0.1 localhost
::1 localhost
127.0.1.1 YOUR_HOSTNAME_HERE

source


I would recommend restarting networkd and resolved afterwards to make sure the changes are put into effect, then systemctl enable-ing them so that they automatically launch upon boot in the future (help for systemctl commands)

Once you've done that and you have a networkd configuration file for the wi-fi adapter, you need to use wpa_supplicant to get logged into the wi-fi network. Use these instructions for logging into your wi-fi network. They're pretty straight forward and you should be able to just follow along in that section I linked to.

NOTE: If you have problems with wpa_cli not starting/connecting properly, run it with sudo!

Once you've gone through those steps and enabled your network, you can check the status of your connection with networkctl. If you authenticated to the network successfully, the wi-fi card should be "routable" and "managed".

FYI, even after you have wpa_supplicant connected to a network and a config saved, you will need to initialize it with the following command every time you reboot the computer: wpa_supplicant -B -i _interface_ -c /etc/wpa_supplicant/wpa_supplicant.conf

I just put this command in my .bashrc so I don't have to type it out every time I boot.

To understand this setup more, read about networkd, resolved, and wpa_supplicant.


Conclusion

As a lifelong Windows user, installing Arch provided a fun challenge and the opportunity to understand how my computer works more intimately. I have learned a lot about the operating system installation process, have become more comfortable navigating official documentation/manual pages, and have been deeply humbled in my attempts to convert to a more command-line-focused computer setup. It's amazing how much you learn while earning a computer science degree, and yet 80% of what I had to do to get Arch set up, I needed to teach myself on the spot. I am extremely grateful to my professors who introduced me to bash and disk management, as this process would've been a nightmare without it.

After having gone through this process, I believe that computer science students need far more exposure to the command line. Honestly, I think that computer science curriculums should require students to use a UNIX-like OS for all four years! I've seen peers in their 3rd/4th-year struggle with things like ls and cd, let alone piping output from one command into another. Who knows, I just personally believe that university is far too expensive for it to be so narrowly focused on high-level languages like Java. As a graduate who feels like they received the short end of the stick (and trust me, I really put effort into my education), I firmly believe students would benefit from a curriculum that focuses more on C, shells, and exploring other operating systems that are not Windows.

Anyways, writing this was a lot of fun, and I hope that this post maybe helps someone out!


Next Steps (for me)

After I get comfortable with a window manager or desktop environment, I plan on using my newfound knowledge to finally convert my Windows laptop into an Arch machine. Then, I intend on wiping my Arch MacBook and using it to try out OpenBSD next! I just adore that little pufferfish, and its obsession with "correctness" has piqued my interest. I'm intrigued to see the differences/similarities between a BSD and Linux, but from my layman's understanding, OpenBSD is kind of like a more focused, security minded, less supported, and better documented Arch.

Until next time!



If you noticed any errors or mis-explanations of any of these steps, please feel free to contact me at vesspa0330@gmail.com and let me know!


back to postslast modified: 08/25/24back to top

linkedin logogithub logoresume icon