The Association of Mad Scientists

Manjaro Linux on a Macbook Pro (an older one)

MacOS is decent. It’s works, the animations look pretty, and this Macbook Pro from 6 years ago is still a beast of a machine. But animations and things working out of the box don’t make the whole environment, and I’m used to working on Linux. I realize for most people this sounds absurd, but for me, the most software that’s available for what I want to do and how I want to do it aren’t on Windows, and they’re hard to install for Mac. I share this machine, and I don’t know if you’ve ever tried, but brew is impossible to use in a multi-user environment. Which leaves me just hoping for a .dmg or compiling from source, when I could just pop open the Linux app store in whatever desktop I’m using and install whatever I need with a click and my password.

But this post isn’t about the merits of one desktop or terminal environment over another. I merely wanted to document the process of getting it working. Currently, the most comprehensive guide is here, but that’s a guide for installing Arch Linux from scratch, which I just can’t be bothered to do. I mean, I could do it, but that process would take a good few hours of careful, attentive work, while this one can be done in probably an hour while you’re watching some TV or something.

Manjaro is pretty awesome, especially the “architect” install disk. I don’t run it on my servers, but both the Macbook and my slower, older laptop are running Manjaro. The Architect installer allows you to choose from any currently supported Linux kernel, and more than a dozen different desktops, or even no desktop at all. It even prompts you to install any extra packages alongside the desktop,, and to chroot into the environment before booting it, allowing for a full custom configuration a-la Arch, but without the hassle of manually performing every step.

I would also like to note that my boyfriend would kill me if I deleted macOS off of his hard drive, so I’ve swapped his DVD drive out for a second solid-state drive. Therefore, while this is technically a dual-boot setup, it doesn’t involve any of the difficulties usually encountered when trying to run macOS alongside other operating systems. No need for rEFInd.

The first step is to burn the disk image to a USB drive. I believe macOS comes with a utility called “disk utility” for doing this sort of thing, but coming from Linux I’m more familiar with dd(1). First, lsblk(1) to find out how your disks are laid out. You could irreparably break your installation of macOS if you choose the wrong disk from the lsblk(1) output, so be sure it’s your flash drive that you are pointing this dd(1) command at. Also, this will obviously destroy any data on the flash drive, including its filesystem. It will need reformatted to be used again after this.

dd bs=4m if=/path/to/manjaro-architect.img of=/dev/diskX

Since dd(1) doesn’t show any sort of a progress bar (on mac, anyway), you should distract yourself for the next 5 or 10 minutes while it copies the filessee note. Once it’s done, tell your macbook to turn itself off, then hold the option key and turn it back on. Keep holding the option key until the list of available boot drives comes up, and choose “EFI boot” rather than macOS.

Walk yourself through the manjaro architect installer, bearing these important notes in mind:

  • When prompted to choose a kernel, choose version 4.14. Linux Kernel 4.16+ don’t seem to have the drivers necessary for booting to the macbook yet, as of the time of writing. If it’s been even a few months since this posting, and you have the time to probably go through the installation twice, please give the latest LTS kernel version a try and comment below if it’s working.
  • When you get to the “install bootloader” step, choose “systemd boot”. This is the bootloader that the installer uses, so if the installer boots, so will it.
  • MacOS handles the thermal controls for your Macbook, not the firmware. As such, you need to install the package macfanctld (mac fan control daemon) in order to keep your macbook from idling hot enough to brew your morning coffee. This step can be accomplished after installation but before booting into the final environment by entering the chroot environment when prompted after the install, by following these steps:
    • Install the macfanctld package
    • Add coretemp, applesmc, wl, and bcma on separate lines to the file /etc/modules-load.d/modules.conf
    • Recommended: increase the minimum fan speed in /etc/macfanctld.conf to at least 3500 RPM.
    • Enable the macfanctld service.

The thermal configuration can be accomplished with the following commands/script, run as root:

pacman -Syu macfanctld
printf "# List of modules to load at boot
applesmc
coretemp
wl
bcma
" > /etc/modules-load.d/modules.conf
sed -i.original 's/fan_min: .*/fan_min: 3500/' /etc/macfanctld.conf
systemctl enable macfanctld

With those 3 steps in addition to the typical Manjaro installation, you should have a full linux desktop on a mid-2012 Macbook Pro (the 9,2 model).

Note regarding the progress of a dd command: if you are genuinely concerned that dd is hung, you can run the following command from another terminal, and dd will output how much it has copied so far. I have never seen dd hang though so that shouldn’t be a problem.

sudo kill -s INFO $(ps aux | grep manjaro | grep -v grep | awk '{print $2}')
Again, it really shouldn’t be neccessary, just be patient. Once you’re done, you can just do it in Linux, where there is a progress bar.

Edit: At the time of posting, I had not yet gotten wireless internet to work. I have gotten it to work now by enabling kernel modules wl and bcma. The way I figured that out is that I installed Elementary OS on this machine for a brief while to try it out and show it to a couple people, and found that the wireless worked on that out of the box. I used lspci -k to figure out which kernel modules were in use, and backed up the firmware directory just in case before reverting to the backup image of my Manjaro install. It turns out the kernel modules were all it needed!