How well does the Linux kernel support Mac hardware?

Also in today’s open source roundup: How to install Linux on a Mac, and is it worth it to install Linux on a MacBook?

How well does the Linux kernel support Mac hardware?
Thinkstock

The Linux kernel and Mac hardware

There is an interesting subset of Linux users that prefer to run it on a Mac. Yes, a Mac. That might seem odd given how Apple is known for its closed ecosystems and high cost hardware, but the Linux on Mac folks really do exist out there.

But how well does the Linux kernel support Mac hardware? LWN.net has a “state of the union” article for Linux on the Mac that could be quite helpful if you are thinking about installing Linux on your Mac.

Note that LWN.net usually requires readers to purchase a subscription for $7 per month, but this article has been made public. So you can read it for free, courtesy of Lukas Wunner, an LWN.net subscriber. Thanks, Lukas.

LWN.net reports on the state of the union for Linux on Mac:

The MacBook Pro introduction in October caused unusually negative reactions among professional users due to the realization that Apple no longer caters equally to casual and professional customers as it had in the past. Instead, the company appears to be following an iOS-focused, margin-driven strategy that essentially relegates professionals to a fringe group.

This has well-known developers such as Salvatore Sanfilippo (of the Redis project) consider a move back to Linux. Perhaps that's a good moment to look at the current state of Mac hardware support in the kernel. While Macs are x86 systems, they possess various custom chips and undocumented quirks that the community needs to painstakingly reverse-engineer.

Users wishing to try Linux as a dual boot option alongside macOS may want to consider ZFS as it allows cross-mounting between the two operating systems in a stable manner. Other Linux filesystems such as ext4 or Btrfs are unfortunately not well supported on macOS. Vice-versa, HFS Plus on Linux does not support journaling and FileVault2 support is experimental. Kernel developers need however be aware that loading the ZFS modules disables lockdep due to the CDDL taint.

Bringup on Macs is a challenge, but on the bright side we are making huge leaps with every new release. Supporting new hardware generally takes about two years, anything older can be expected to work decently. Battery life is not yet on par with macOS, Thunderbolt lacks many features, and GPU switching only works on pre-Retinas.

Despite these limitations, Mac hardware support is significantly ahead on Linux compared to other free operating systems. To quote Apple's classic commercial: "here's to the crazy ones" who are bringing up Linux on the Mac.

More at LWN.net

LWN.net readers shared their thoughts about Linux on Mac in the comments section of the article:

Bronson: “Phenomenal article. Very inspiring.

I'm surprised onboard display controllers don't support passthrough. It seems like that wouldn't take much silicon (except for the I/Os) and it would be a much simpler and cheaper architecture than the custom messes everyone is currently implementing.

I suppose there are two problems... 0. you might not want your powerful GPU to pass through the the cheapo chipset GPU, and 1. there's not enough demand to force nVidia and Intel to work together.

Back in the day, we thought dual-ported VRAM was snazzy. I say, dual-port the GPUs! Heck, daisy chain them.”

Zlynx: “It seems to me that Optimus / PRIME is already a pass-through solution. Instead of custom hardware it is sending the video buffer over PCIe to the GPU with the output on it. And it seems to me that we have this working pretty well these days.”

Mmeehan: “On the other hand, Dell's XPS 13 ships with Ubuntu 16.04 and newer hardware for the same price. I wish more developers would vote with their dollar.

Then again, folks get religious about brand identity.”

Giraffedata: “But if you're not running MacOS, you've given up the Apple brand.

So I still wonder what, besides the challenge, people want out of Linux on Mac hardware. ”

Rgmoore: “Apple does put together some very nice hardware packages, not just in terms of raw specs but also in terms of design and quality of the components they use. They've cared about a lot of that stuff for longer than most of their competitors, so they have brand loyalty for their hardware even among some people who want to rip out their software and replace it with Linux. ”

Mathstuf: “In the office the latest round of hardware is getting sour reviews. No new Mini, a lackluster laptop, and a still overpriced and under powered cylinder. The only thing left is the one that lives in a monitor which can't be a machine that just lives under a desk all that easily.”

Montj2: “What about the custom touchbar support? Do you think that will ever be possible? I mean, we're talking about several generations of Apple products that will fail to even support function keys.”

Cyberax: “Touchbar falls back to F-keys by default if no special configuration is applied.”

Mips: “I wonder whether there is a greater degree of continuity between MacBook Pros, meaning that development effort expended to get Linux working doesn't seem wasted?

A quick look at Wikipedia tells me the XPS 13 has been around since 2012, but I've no familiarity with them, and don't know whether the early XPS 13 was similar to today's.

Either way, design decisions like a non-user-replaceable battery and soldered RAM keep me away from either line.”

Excors: “I think they've mostly just been incremental changes - newer CPU generations, different wifi cards, etc. And Dell puts effort into officially supporting Linux and upstreaming patches, and can select hardware that's going to work okay, and can fix BIOS bugs properly instead of hacking kernel workarounds for them, so there should be less need for volunteers to waste time on model-specific hardware support than for most other brands.

Also they seem to be using fairly standard components, so any effort spent supporting them is likely to help a lot of other devices that happen to use the same components, whereas it sounds like Apple innovates so much that a lot of the work needed is not just Apple-specific but is specific to a single Apple model.

(I got an XPS 13 recently, partly to support companies that support Linux, partly so I didn't have to worry about compatibility, and partly because it sounds like one of the best small laptops regardless of OS. There are still bugs on Linux (e.g. the official USB-C-to-HDMI adapter is apparently fine on Windows but only appears to work at sub-1080p resolutions on Linux) but generally it seems pretty nice.)”

More at LWN.net

How to install Linux on a Mac

Now if you’ve decided to install Linux on your Mac, you might be wondering where to start and how to go about it. Not to worry, Macworld UK had a helpful article back in October that contains instructions on how to install Ubuntu on a Mac.

Lucy Hattersley reports for Macworld UK:

There are lots of great reasons to be interested in Linux. Like Mac macOS it has a heritage with Unix (or at least a Unix clone called GNU). Some Linux desktops, like Ubuntu Unity, are similar in nature to the Aqua user interface (the one used in macOS).

Linux is also incredibly versatile, designed to run on everything from mobile phones up to supercomputers. This makes it ideal for installing on older computers, such as the old Polycarbonate MacBooks. These won't even run the latest version of Mac OS X, let alone macOS. But they will run an up-to-date version of Ubuntu Linux without breaking a sweat.

Apple Macs make great Linux machines. You can install it on any Mac with an Intel processor and if you stick to one of the bigger versions, you'll have little trouble with the installation process.

Get this: you can even install Ubuntu Linux on a PowerPC Mac (the old type using G5 processors). And we're not talking about an old version of Linux. We're talking about Ubuntu 16.04 (or even the latest Beta of 16.10). Both are available as PowerPC image files thanks to some pretty active community support and demand to use old G5 Macs as servers.

More at Macworld UK

Is it worth it to install Linux on a MacBook?

After checking out the previous two articles, you might be wondering if it’s worth it to run Linux on a MacBook laptop. The same question came up in a thread on the Linux subreddit earlier this year and the folks there had some interesting thoughts to share.

Comfortably-glum started the thread with this post:

I currently own a 13" 2015 MacBook Pro w/ Retina display and force touch trackpad. I primarily went for it because I wanted a good screen and decent battery life (there were a few other reasons as well, but I'd rather not justify my purchase here and start a discussion on something else entirely).

Anyways, I'm finding it very difficult to get used to the weird modifier placement. There's an Alt/Option, a Command, and one Control, and coming from a PC, I can't get used to the new controls and placements on OSX.

Perhaps they are more configurable on Linux? Also, how is the Linux support on this particular MacBook? Those two factors can easily make me swap out OSX for Linux.

People who run Linux on MacBooks, is it worth it?

More at Reddit

His fellow Linux redditors shared their thoughts about running Linux on MacBooks:

Misterberu: “A lot of conjecture in this thread, thought I'd weigh in with some of my own experiences:

I'm currently running Arch on a 11,4 (Mid-2015) MacbookPro, the installation of which I handled last week. (brand new laptop, running Linux and OS X on it)

The installation process was incredibly easy…

Almost everything worked out of the box: wifi, bluetooth, trackpad (with libinput it works particularly great, even has gesture and palm recognition), etc. I'm absolutely captivated with this screen: yes, few applications don't work well with HiDPI screens (looking at you, Unity), but the experience has been pretty stellar for the most part.

The one issue I did have, which I think is exclusive to the 15" MBP, but you might have it as well, is the suspend/poweroff functions not working under Linux. The solution was to install this custom MBP kernel, and create a manual boot stanza in refind.conf so I could boot the custom kernel, but still have the boot entry for the normal one in case the problem eventually fixes itself. That was the only "game breaking" bug I've had, and it took me a grand total of 5 minutes to fix, after compilation was over.

All things said and done, this is one of the nicest machines I've ever used Linux on. My old machine was a System76 Galago Ultrapro and, while I do still enjoy it, the Macbook is just a much nicer machine to use. Gorgeous screen, great battery life, and a fantastic trackpad make it really ideal.

Naturally, YMMV, but please don't listen to the people in the thread who've never even used Linux on a macbook, and are here telling you to not go for it. It might take a while to set up, but it's oh-so-worth it once it's done. Just dedicate a lazy sunday to getting it all sorted, and I'm sure optimistic you won't be disappointed.

P.S.: Do keep OS X installed for things like Firmware updates, otherwise you might regret getting rid of it in the future.

P.P.S.: The custom kernel I mentioned above is just the standard Linux kernel with a couple of patches applied to it. If you're not running arch you could just download and apply those patches to the Linux kernel yourself, and you'd be ready to go. I predict that they will most likely find their way into the upstream kernel relatively soon, so it really isn't something worth fretting about.”

Suprjami: “I don't own a MacBook but I considered it with my laptop purchase earlier this year.

From what I saw, the MacBook say 2 models behind is likely to have better Linux support and most problems ironed out, when compared to the very latest model. The Arch wiki is pretty good at documenting issues, and do a Google search the model number and Linux, eg "macbook A1534 linux".

You almost certainly have to dual boot OSX so you can install firmware updates if required. I wanted just one OS and not to stuff around with another bootloader.

I couldn't find many good screen options. They seem to either be high res hi-dpi displays which are annoying on Linux, or too small like 1440x900. I wanted plain old 1080p or 1920x1200 and smaller than 14".

I don't really think Apple hardware is that expensive compared to other brands, at least to buy. The proprietary adaptors are where they get you. The power bricks are arguably designed to fail and be unserviceable. Their warranty support is notoriously bad.

Lastly, maybe this doesn't matter to you but it matters to me, Apple are not a good organization. I'll save the rant and just say I have ethical issues giving my money to this company.

In the end I decided it wasn't worth it for me. Hope that helps.

(I ended up getting an Asus UX305UA which is okay, not perfect but nicer than the aging netbook it replaced. I also looked at Carbon X1 Gen4 and Thinkpad T460s, both were very nice but also another $1000 over the Asus)”

Juan08880: “It is almost always better in my opinion to shop for the previous generation instead of the current offering. In this case, it would be the X1 Gen3 and the T450s.

Here's why:

You can save a lot of money (at least 40% of the retail price in most cases) by buying manufacturer refurbished laptops that also comes with the same warranty of a brand new laptop.

Better kernel support for your hardware.”

BradChesney79: “I can't get over that awful MacBook keyboard.

The screen was nice, great pixel density.

Buy a Thinkpad that meets your needs instead. You will likely save hundreds of dollars. My T540p was ~$600. I bumped it up to 16GB of RAM after I bought it. Still waiting for a good price on a best in class quad-core i7 which mine does not have at present.”

Erikd: “I started a new job about 2 months ago and the issued laptop was a brand new Macbook with 16G of RAM, 1TB SSD and the retina display. I was told it was ok to install Linux on it as long as the filesystem was encrytpted. I installed Debian without any issue.

It’s a great machine and runs like a dream. My only issue is the placement of the Fn and Ctrl keys which I'd like to swap but can't because one of them isn't wired all the way through to the software.

I'm also about to replace my personal laptop but will probably be getting a top of the line Dell instead of a Mac.”

Buzzrobot: “Look for reports of showstopping failures or glorious successes with the specific model of Mac you're considering.

I installed and ran Ubuntu and Fedora on a 2011 Macbook (model 8,11) a couple of years ago.

I found that guidance that was not specific to the 8,11 would not work.

That model had AMD video and Intel video on board. Linux was unable to handle switching between the two. One or the other had to be disabled. Since Macs have no BIOS in which to disable a video card, I had to resort to an obscure method of using grub to emit a string of bytes to the firmware before the kernel booted.

I found no way to regulate fan speed. The fans were maxed out when the AMD was in use, as were the temps.

This setup broke on both distros when the next kernel update. Reinstall attempts failed.

My conclusion: Save Linux for an old Macbook that lacks the oomph to handle the current OS X release. OS X is as Unixy as Linux. Thousands of Linux apps have been ported over and are maintained by various projects. You can install X if you wish.”

TheAlphaDingo: “I've been using linux on a macbook pro late 2013, since late 2013 with no real issues. I've used Mint 15-17.3, fedora 23, and ubuntu 16.04. There's plenty of good choices. Mint is probably the easiest if you don't want to mess around.”

Han-ChewieSexyFanfic: “I have a 2015 retina MacBook Pro. Ubuntu 16.04 runs like a dream on it. It actually gave me a lot less trouble than other designed-for-Windows laptops when running Ubuntu. The force touch trackpad works great as a track pad (sans actual force touch, of course), Ubuntu's screen scaling works great and text, images and video look beautiful, and the battery life is pretty close to what OSX delivers after following the MacBook setup tutorial in the Ubuntu wiki. ”

B1twise: “Wait about 6mo after release before seriously considering it. That gives the early adopters time to fix major issues, and you can usually find a thread on linux message boards documenting their successes.

I'm on my 4th or 5th Apple laptop now, and only one has been a complete piece of trash. The 2015 Macbook is junk. The lack of ports and the HORRIBLE keyboard really cripple it. It's also slow. It is my newest Apple laptop, but I never use it.

Happily using a MBA 11" with an external display for when I'm home.”

Monty20python: “I'd say you're better off sticking with OS X, especially if battery life is a consideration. You can use Karabiner to change the keys to whatever you prefer (though I got used to it pretty quickly). I tried dual booting for a while but gave up because of the issues with integrated/discrete graphics (I think yours is just discrete so that's not an issue). I do like that a lot of people are just telling you to buy a thinkpad though, because that totally answers your question…”

More at Reddit

Did you miss a roundup? Check the Eye On Open home page to get caught up with the latest news about open source and Linux.

This article is published as part of the IDG Contributor Network. Want to Join?

Related: