Tyler Voll

Writer - System Admin

For quite some time now, I've been running MacOS alongside Ubuntu. Dual-Booting was nice, because if I ever wanted to use any of the specific proprietary software that only ran on MacOS, I could do so, plus I could switch back to Linux any time if I wanted to use my system for anything else. Now that I don't have as many uses for MacOS or the proprietary software that used to hold me back, I decided that it was time to fully run Linux on my Macbook Pro. While I have been using Ubuntu 17.10 for quite some time, I wanted to try something different; and with the recent update of Fedora 28 supporting more features on Thunderbolt 3, I decided to try out Fedora 28 this time around.

My biggest issues with Linux on the MacBook Pro is that not all of the features work out of the box (primarily the Touch Pad and Keyboard and Sound for my model). I've gone through the process before with Ubuntu, but the instructions for implementing the changes to the kernel are different for a RedHat Distrobution, so this article is primarily for keeping track of the process to make it easier for others in my situation so they don't have to search or save multiple web pages to get the job done. Now, another big question that some people might have while reading this is: "Is it worth running Linux on my MacBook Pro?" This is a good question if doing some of this extra work seems tedious. For me, it doesn't seem like that much work. Overall, you will need to connect a keyboard and mouse to your Macbook Pro while you type out some commands in the terminal to get the built-in keyboard and Mouse working. Although, you are required to have those things connected while installing Fedora 28 as well, i've had to do far more work-arounds back in my Hackintosh days. As long as you prefer Linux over Darwin (MacOS), then the answer should be a clear Yes!

While this article is focusing on getting Keyboard and Touchpad control back, I will also include some other resources at the end for those who have more issues with things not working out of the box (which is very likely if you are using a different MacBook Pro model, primarily those using the Touch Bar), so that if you all need some further direction, you can still go somewhere else after here. Before starting this tutorial, make sure that you have installed Fedora 28. Although you need to plug in a keyboard and mouse into your thunderbolt ports, you shouldn't have an issue with the install (or at least I did not have any issues). While I haven't had any issues with installing Fedora and Ubuntu on my MacBook, I have had issues installing Arch Linux Distros (like Manjaro), because Calamares has issues writting the bootloader to the MacBook's NVME drive.

 Once you are successfully logged into Fedora 28, run straight to your terminal to put in these commands that will make changes needed for the keyboard and touchpad to be recognized along with downloading the required driver from GitHub.

echo -e "\n# applespi\napplespi\nspi_pxa2xx_platform\nintel_lpss_pci" >> /etc/initramfs-tools/modules

apt install dkms
git clone https://github.com/cb22/macbook12-spi-driver.git /usr/src/applespi-0.1

Now, I specifically ran into an issue where it wouldn't let me use dkms in order to make these changes. It would continually tell me (amongst a couple other things), "Your kernel headers for 4.16.7-300.fc28.x86_64 cannot be found" and that it couldn't build the kernel because it couldn't locate the correct Linux Kernel Headers. To fix this issue, I ran this below in order to get the proper headers required in order to further use dkms.

sudo dnf install "kernel-devel-uname-r == $(uname -r)"

After this has been done and it has successfully downloaded the proper Linux Kernel Header for Fedora 28, you can then run dkms to make the changes required to get the keyboard/touchpad back up and working. Lastly, reboot your machine so that the changes can take effect.

dkms install -m applespi -v 0.1
reboot

After rebooting, your keyboard and touchpad on your MacBook Pro should now be operational, and you can remove the wired devices from your laptop to use it as it was intended (Minus MacOS tongue-out). For more information on the driver we used, click here. And for more information on the state of Linux on the MBP 2016-2017 (along with resources that can help turn on other parts that might not have worked right out of the box), click here.

tags:
Back to Top