Installing Debian 10 on Macbook Pro

debian-10-on-apple-macbook-pro

TLDR: Apple, by design, wants to spy on you and manipulate you. Installing an open source Unix-like OS on a beautiful piece of Apple hardware is a very satisfying feeling! And it’s a great snub at Apple. See the steps I took below.

Why Linux on Apple hardware?

One of the best, most satisfying, ways to take your liberty and privacy back from Apple is to install an open-source operating system like Debian Linux on Apple hardware. In my case I have an Apple MacBook Pro (17-inch, Mid 2010) that wasn’t getting any use. After contemplating selling it, I decided instead to install Debian 10 and use it as a daily driver. After reading about Apple hardware compatibility issues with Linux, I was concerned this may not be a viable long-term solution. However, I’ve been using Linux on this MacBook Pro every day for almost a year and have had great success. The few problems I experienced were quickly resolved with a simple internet search. So without further delay, here are the steps I took to install, configure, and troubleshoot Debian 10 on an Apple MacBook Pro.

References

My Laptop Specifications

  • Processor: 2.53 GHz Intel Core i5
  • Memory: 4 GB 1067 Mhz DDR3
  • Hard drive: 500.1 GB ATA Hitachi HTS54505
  • Dual GPA: (1) Graphics NVIDIA Corporation GT216M [GeForce GT 330M] 512 MB, (2) Intel HD Graphics 288 MB
  • Wi-Fi: Broadcom Limited BCM43224 802.11a/b/g/n (Card Type: AirPort Extreme)

Installation

Note: I’m not going to explain step-by-step the Debian installation in this post, mainly because it is straight forward. If you need hands-on assistance installing Debian, check out this step-by-step installation guide from the The Debian Administrator’s Handbook. It provides screenshots and explanations at each step.

Head over to debian.org and find the installation method that’s best for you. I chose to download the amd64 stable full installation suitable for writing to CDs. After downloading the image, I wrote the files to disc, booted the MacBook Pro starting with disc 1, and followed the text-based installation method.

One of the last steps is to install optional packages. I chose the Gnome Debian Desktop Environment, Print Server, and Standard System Utilities. What you choose is a matter of preference. Recently, I actually uninstalled Gnome and replaced it with bspwm, a very small and efficient tiling window manager (I’ll explain this in a future post). But for now, having the convenience of the entire Gnome desktop was helpful to get up and running.

Temperature & Fan Control

One issue I noticed immediately was the laptop ran hot especially when I was watching videos or doing anything that taxed the GPU. Even running Mac OS X, this device would get hot. So the problem was rooted in hardware design, and less in Linux compatibility. After searching online, I landed on macfanctld, written by Mikael Strom. Realizing there was a managed package available from the official Debian repository, I decided to test it out.

References:
https://packages.debian.org/buster/macfanctld
http://manpages.ubuntu.com/manpages/bionic/man1/macfanctld.1.html
https://github.com/MikaelStrom/macfanctld

Files:
/etc/macfanctl.conf
/etc/init.d/macfanctld
/var/log/macfanctl.log

Install macfanctld
$ sudo apt update
$ sudo apt install macfanctld

Check daemon status
$ systemctl status macfanctld
● macfanctld.service - LSB: Apple MacBook (Pro) fan control daemon
Loaded: loaded (/etc/init.d/macfanctld; generated)
Active: active (running) since Sun 2021-02-14 07:59:47 EST; 5h 34min ago
Docs: man:systemd-sysv-generator(8)
Process: 653 ExecStart=/etc/init.d/macfanctld start (code=exited, status=0/SUCCESS)
Tasks: 1 (limit: 4504)
Memory: 2.3M
CGroup: /system.slice/macfanctld.service
└─717 /usr/sbin/macfanctld

This was a great success! The daemon initialized immediately. I could hear the fans spin up and was able to verify it was working by going to the log file at /var/log/macfanctl.log

Configuring Dual GPUs

After doing some research (see references below) I decided to use the NVIDIA card and try the NVIDIA proprietary drivers rather than the nouveau driver.

References:
https://wiki.debian.org/NvidiaGraphicsDrivers
https://www.kernel.org/doc/html/latest/gpu/vga-switcheroo.html
https://linuxconfig.org/how-to-install-nvidia-driver-on-debian-10-buster-linux

Check the installed NVIDIA device
$ lspci -nn | egrep -i "3d|display|vga"
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT216M [GeForce GT 330M] [10de:0a29]
(rev a2)

Run nvidia-detect to determine supporting driver
$ sudo apt install nvidia-detect
$ nvidia-detect

Detected NVIDIA GPUs:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT216M [GeForce GT 330M] [10de:0a29]
(rev a2)
Checking card: NVIDIA Corporation GT216M [GeForce GT 330M] (rev a2)
Your card is only supported up to the 340 legacy drivers series.
It is recommended to install the nvidia-legacy-340xx-driver package.

Before installing the drivers, you must obtain the proper kernel headers. For a typical 64-bit system using the default kernel, simply run:
$ sudo apt install linux-headers-amd64

Add “contrib” and “non-free” components to /etc/apt/sources.list, for example:
deb http://deb.debian.org/debian/ buster main contrib non-free

Install the driver
$ sudo apt install nvidia-legacy-340xx-driver

Note: During the package installation, dkpg displays a message that the nouveau driver is conflicting, and the best way to blacklist it is to reboot. Restart your system at this point to enable the nouveau driver blacklist.

Configuring Broadcom Wireless

References:
https://wiki.debian.org/MacBook/Wireless
https://wiki.debian.org/brcm80211

Once again, getting the right driver for the wireless adaptor in the MacBook Pro to work properly was painless thanks to good documentation on the Debian Wiki. I literally followed step-by-step and WiFi was up and running in minutes. I’ve read comments online that wireless using these Broadcom drivers is “hit or miss”, but I believe those problems are long gone based on older kernels. I have not had one single problem in the year that I’ve been working from this laptop.

uhci_hcd Error Messages

At every boot, I get the following message:
uhci_hcd 0000:00:1a.0: Found HC with no IRQ. Check BIOS/PCI 0000:00:1a.0 setup!
uhci_hcd 0000:00:1a.0: init 0000:00:1a.0 fail, -19
uhci_hcd 0000:00:1d.0: Found HC with no IRQ. Check BIOS/PCI 0000:00:1d.0 setup!
uhci_hcd 0000:00:1d.0: init 0000:00:1d.0 fail, -19

The uhci_hcd failure does not create any performance issue or any notable problem at all. It’s an error message that I’d like to remove and correct the problem if possible. But to date, I’ve not really tried very hard to fix it.

One possible solution I found was to set kernel parameter video=efifb
https://bugzilla.redhat.com/show_bug.cgi?id=1192619 – This report was related to Macbook Pro 2010.

If you’ve encountered this error message and have resolved it, please let me know.

All Hardware Support Packages Installed

In total, below is the list of packages from the Debian repository that I installed on the MacBook Pro:

Leave a Comment

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