Linux Manjaro on a MacBookPro9,2 with a Persistent USB Pendrive

Featured Video Play Icon

Unfortunately I had the dramatic idea of buying a Dell machine some years ago. This machine breaks by just watching at it. So, I recently had to experience the n-th broken part… and, 11 days after that, the replaced part also broke again… I won’t spend words on this shame. But, let’s see the bright side of it: I had the time to take from the drawer my old shiny MacBookPro9,2 (MacBook Pro mid 2012). After 10 years, no broken part appeared on my way (thanks Apple). There is only one downside of a Mabook: it does not have Linux installed. So I thought I could try again the persistent Linux USB pendrive experience. In a couple of hours, I had my new Manjaro Linux installation running at full speed. After a few hours of work, I was so impressed that I thought I could write a little post to share the experience for anyone thinking of doing something like this. It might help you decide and speed up your work.

Installation

I need Linux to work, and I also like using it in my everyday life, but there is nothing wrong I could say about the excellent MacOS (thanks Apple), so I thought I could leave MacOS installed in the internal SSD and just run Linux on a good USB pendrive. Years ago, it took me days to prepare this setup, and it wasn’t working that well. Now, things have changed, it seems. If you are thinking of trying a similar setup, I strongly suggest you to look at this excellent project: https://github.com/r-darwish/alma (thanks @r-darwish). This application is awesome.

I used the AUR package alma-git to produce a USB pendrive with a complete KDE Plasma desktop, including all KDE applications. I also added the b43-firmware that is needed to provide drivers for the WiFi chip in the MacBook Pro.

NOTE: the original project seems to be discontinued. I now have better results with https://github.com/philmmanjaro/alma (thanks @philmmanjaro).

To do this, I simply applied this patch to the above repo:

diff --git a/presets/kde.toml b/presets/kde.toml
index 2aaef21..0e1cca4 100644
--- a/presets/kde.toml
+++ b/presets/kde.toml
@@ -1,4 +1,5 @@
-packages = ["plasma-desktop", "dolphin", "gwenview", "konsole", "ttf-dejavu", "sddm"]
+packages = ["plasma-desktop", "dolphin", "gwenview", "konsole", "ttf-dejavu", "sddm", "plasma", "kde-applications"]
+aur_packages = ["b43-firmware"]
script = """
set -exu

Of course you could write something better by splitting presets. And with this command:

sudo ALMA_USER=... alma create /dev/disk/by-id/... \
    --presets ./presets/user.toml \
              ./presets/xorg.toml \
              ./presets/pamac.toml \
              ./presets/kde.toml

I got my USB pen drive with a persistent installation of Manjaro with a full KDE Plasma experience in no time.

Usage

At first, I thought it wouldn’t boot on a MacBook out-of-the-box but… I was completely wrong. Just press the alt button and select EFI when the choice is presented. Manjaro booted properly (and very quickly).

For some reason, I had the remove the b43 driver from the blacklist once the system booted, otherwise no wifi interface could be found. The file to edit is in:

/etc/modprobe.d/linux54-broadcom-wl.conf

What is Working

Actually, pretty much anything I tested seems to be working:

  • function keyboard buttons (screen backlight, window presenter, keyboard backlight, media control buttons, audio control buttons);
  • power button is recognized by the system;
  • battery charge and capacity;
  • ethernet;
  • thunderbolt with secondary FHD monitor (1920×1080);
  • USB;
  • internal speakers and headphones;
  • bluetooth;
  • keyboard backlight;
  • CD-ROM.

I could connect immediately a bluetooth speaker, a bluetooth mouse and the Apple bluetooth keyboard. Everything works out-of-the-box.

Plasma is hardware accelerated and framerate is excellent even with a two screen setup.

What is not Working

Not much. The SD card reader seems to be recognized, but a quick test of an SD card failed. The kernel reports many errors and nothing could be read.

Hardware decoding seems not to be working, vainfo returns an unknown error and I’m not completely sure why. However I didn’t investigate further as I was not very interested in the topic at the moment.

I couldn’t test the CD reader and the firewire ports.

The only big disadvantage is: WiFi is pretty slow. But it seems to work however.

Performance

Not only pretty much everything works properly, but it seems to be stable and performant so far on the persistent USB pendrive I used (a cheap SanDisk device I bought years ago). As a matter of fact, a very approximate measure of boot time results is this:

  • MacOS Catalina booting from the internal SSD: ~1 minute and 20 seconds;
  • Manjaro Linux booting from a USB pendrive: ~45 seconds.

I measured the time taken from the selection of the boot device to the actual desktop. I have to note here that, while Manjaro seemed to be done with the boot after that time, MacOS took many other seconds to settle to idle.

Also, battery consumption seems to be decent. As a quick test, I let VLC run with software decoding from 100% battery to ~70% battery:

  • MacOS Catalina discharge time from 100% to ~70% running VLC: ~45 minutes;
  • Manjaro Linux booting from a USB pendrive discharge time from 100% to ~70% running VLC: ~46 minutes.

Please note that these tests where highly approximate and pretty unfair: Linux was booting from a USB pendrive, MacOS was booting from an internal SSD. These quick tests were only run to give a rough idea of the result.

This is a quick demo of what you can expect from the setup:

Conclusion

MacOS is a good OS. However, on this model, updates are not supported anymore, so you’re stuck with a system that is getting older and older. Thus, if you need Linux to work or if you prefer it over MacOS or if you prefer something that remains up to date in the future, have a quick look at this setup! You can do so without even touching your MacOS installation.

In my case, I could complete my build of the Raspberry Ubuntu kernel on docker, which was taking literally hours on MacOS.

Leave a Reply

Your email address will not be published. Required fields are marked *