For the MacBook Pros 2016 and up I put significant effort into trying to get mainline Linux running as smoothly as possible by documenting and coordinating the efforts to have drivers for all internal devices [1], but just have a look where we're at over three years later: Audio doesn't work properly, Wifi does neither (expect for the non-TouchBar models, like the one the OP uses), hibernation is still somewhat broken and let's not even start talking about the advanced abilities of the TouchBar or support for TouchId. I could go on.
Models with T2 chip (2018 and up) are even worse in some regards and I believe it won't get better anymore. Next year we might see MacBooks with custom ARM SoCs and that's where I expect the driver situation will get even more dire. As Apple continuous to use more and more custom designed components, the effort for proper Linux drivers for such hardware only increases.
Most of these problems could be easily solved if Apple would simply make documentation for their hardware available. There are lots of great people passionate about running Linux on Macs out there, but reverse-engineering the hardware is what makes it really complicated to produce robust drivers for it.
I sincerely hope my predictions are wrong and Linux will still go strong on Macs in future as well, but for the time being I'm done with Macs.
But I think the crux of the problem is that people are trying to run commodity software on custom hardware. That just won't work long-term.
Linux is commodity software, that runs great on white box commodity hardware. macOS is custom software that runs great on custom hardware. Each has its place and purpose.
It's like driving a car on train tracks. Yes, it will get you somewhere, but it's not the right match of tools and environment. And it's inevitably going to be a bumpy ride.
Mac's are not as custom as you think, and it wouldn't be that hard for them to give out enough information to get Linux running on MBPs. In fact I hope we have a large community of folks making sure we can reverse engineer everything.
LLVM and the likes are great compilers, but Apple is leading exactly where Stallman warned about - a computer you can't write software for.
Any application that pushes frames/performance would do better on Linux/Windows on the equivalent amount of silicon. What's missing because the hardware and drivers is so closed is the feedback loop between application/game devs and the vendors. If I have an issue with what I'm building, I can hop into a chat and immediately talk to Nvidia/AMD/Intel folks/etc. In some cases, they share code, in some cases they release a driver update. In pretty much all cases, the code I'm working on gets better. Apple lacks this feedback loop, and their drivers are garbage.
I mostly did just coordination and verification. The only code I contributed are very small workarounds for the NVMe controller and webcam. Nothing noteworthy. The serious work of reverse engineering and implementing custom drivers was done by others which are to be applauded much more!
There is one person I want to point out in particular and that's roadrunner2 [1] who took the existing input driver for the 12" Retina MacBook and not just made it work with the MacBook Pro's, but also implemented support for the TouchBar and ambient light sensor. As this driver is based solely on reverse-engineered workings of the input system and Apple does very unique stuff there this was so much effort. Including very subtle, but surprising bugs (e.g. [2]) which could've easily avoided if documentation would've been available.
roadrunner2 is also the one to applaud for bringing the support for keyboard and touchpad to mainline Linux. As that not just required an input driver, but also touched other subsystems and required serious refactorings that was quite an achievement as well and is the reason keyboard and touchpad even work out of the box after booting a Linux distribution nowadays (although it's still not perfect as some distributions don't enable the applespi driver yet).
[1]: https://github.com/roadrunner2/macbook12-spi-driver [2]: https://github.com/cb22/macbook12-spi-driver/issues/53
[1] https://www.nextplatform.com/2018/06/20/a-deep-dive-into-cis...
Not the wifi one. The problem there is that the firmware itself is broken in the paths that linux implements the wifi stack. (fullmac) Mac is not affected, but practically the firmware is still broken. It's also a known/won't-fix case, so the documentation itself won't help.
> Audio doesn't work properly, Wifi does neither (expect for the non-TouchBar models, like the one the OP uses)
Wifi has a (pretty stable) proper workaround now, you might want to see this[0].
What would you recommend if I need to run both Linux and Windows alongside MacOS? Virtualisation? Or would I be better off using more than one machine?
OTOH if you try to install Linux on any recent MacBook Pro, you are in for hours and hours of googling weird shit with like only 2 comments on forums you have never heard of, and you will still never get Wi-Fi, sound, and sleep/hibernation all working at the same time.
It's just not worth it. If you are so hardcore about software freedom that you demand to install Linux natively on the metal then you should absolutely not, now or ever, buy a Mac.
OTOH if you just need to like, build some shit that only builds and runs on Linux, and you have $200 — VMWare. I don't like VMWare in theory (the Monsanto of tech companies) but I sure like them a lot in practice.
I have needed a Mac/Windows/Linux laptop for my job for the past decade. In former times, I installed Windows and Mac OS X, and ran the latest Ubuttnu in either VMWare Workstation or VMWare Fusion.
But since 2016 I just use VMWare Fusion for both Windows and Linux. If you want to use a Mac, I am confident that's the "best" approach.
(For me, that means "runs all GUI and CLI programs reasonably well, with the minimum hours per year spend fucking with shit just to make it work. But if you actually need efficient GPU acceleration or real high performance (like not a web app or GUI app, but some kind of computationally expensive whatever) under Linux — well, then get something other than a Mac.)
This really depends on whether you prefer Apple hardware or not. If you want Macbook hardware, use virtualization. If you want any kind of desktop or a laptop where everything isn't soldered and epoxied together, get whatever PC you want and then put the cheapest available Mac Mini in a corner and access it with remote desktop or similar as necessary. Another good solution is to buy a used Macbook which is old enough to have a rundown battery but not so old it won't run a recent macos, and then you get a better price and the battery doesn't matter because you're not actually using it as a laptop.
WSL is just a linux syscall wrapper around the Windows kernel, so it isn't a perfect replica, but WSL2 runs a customised linux kernel alongside windows, so it should very close.
That's what I would do.
I've seen that github go from quite a hopeless situation, to a surprisingly complete amount of things working, under your watch.
I do agree with your assessment that the ARM future isn't looking good, but I'm still hopeful, and we really won't know until people try it out. Many of us, like me don't need all features working e.g. I can do without WiFi if need be, so I don't feel as defeated as you, due to having not as complete a goal set.
I urge you to put a clear message at the top of the github about your current status of involvement. It may encourage others to step up and take the reins for a while? You've done an amazing job, maybe a break is in order!
No worries, I'm still accepting PRs and occasionally moderate discussions when they are in need of moderation.
My worry is that while Apple is continually making their machines less and less useful for development (meaning macOS as an environment), that the Linux laptop story remains bad even on the Dell “Ubuntu Certified” machines or the Lenovo line of newer Thinkpads.
I think this means I’m resigned to “No, I would rather ssh to a Linux workstation” because I want to spend ~0 hours per year fighting with “WiFi doesn’t work, Audio doesn’t work, or Suspend sucks”. A recent set of threads here suggested buying a sufficiently old Thinkpad that the Linux community has worked out the bugs. Thoughts?
Edit: Thanks for the responses! (Sounds like a year or so back is plenty for solid support).
Regarding the need to fix occasional problems when using Linux: There is no silver bullet. While Linux has some advantages over the other operating systems, it also has its disadvantages. One disadvantage is that it's still quite niche, which I believe is the main reason for such problems. However from my experience it has already gotten _a lot_ better over the past two decades. More people are using Linux nowadays which results in companies putting more effort and resources into Linux development which then results in a better overall experience for everybody.
If your goal is to spend no time at all fixing or tweaking your system, I'd say Linux isn't the right choice for now.
[1]: https://fwupd.org/
If you want to stick with a specific brand (eg. I usually buy Lenovo) the trick has always been to buy one gen back. Laptops are all custom hardware by nature and if the manufacturer isn't spending the time to make sure Linux works on it then it is up to the community, and they can't do it until it is available. Once available it seems to take a year or so to get everything ironed out (assuming it is a major brand popular among Linux users). This really applies equally well to small, token lines, like Dell's, as they are really only a few steps ahead of the community due to limited resources.
I assumed it was because this machine didnt fall into the “newer Macs that have issues with Linux” bucket
1. Shitty 1080p TN or barely IPS panels with laughable color accuracy, horribly bad color reproduction, viewing angles that just plain suck, 300 or 250 nits brightness and no 100% coverage of even sRGB.
2. Completely overkill and expensive 4K panels with HDR, touch, OLED, all the bell and whistles that somehow forgot that they are in laptops and drain battery at ridiculous levels.
Apple, on the other hand, have displays that have the perfect pixel density for laptops so their battery drain is manageable, have excellent color space coverage (even the 999$ Air has 100% sRGB) and perfect color accuracy and viewing angles.
Then comes the trackpad and it's not even a contest. On a macbook, I really don't need a mouse unless I am doing something high precision like Illustrator or video editing. Even there the trackpad is workable.
And then something that is more on a personal level, but no one apart from Apple has their high end devices available in India quickly. The new dell XPS might come very close to the macbook, but getting it in India is not possible, even after 4 months after launch. Even if it arrives, it will be one or two base models with limited availability or the completely overkill models. Not so with Apple.
I'm less enamored with the rest. My daily driver laptop is a 32G i9 from 2018(?). While I have enough RAM to run a couple docker containers, most of the folks I work with are stuck with the 16G version, which are constantly out of resources and have no upgrade plan. For being a 'pro' spec machine, it does not have the cooling it needs to be pushed like I do.
I have a 2011 MBA whose battery still lasts an hour and it can do all the "daily driver" tasks except gaming.
(Meanwhile I replaced my other laptop's battery 3 times in that time!)
THe MBA's mobo finally went out so I'm in the market for a new laptop NOW and want to justify buying an EIGHTH GEN i5 MBP for over $1000 when there are laptops with TENTH gen i7's and >1tb hdd's for similar money.......
But... are we talking about the same XPS laptop? My wife's 13" XPS purchased ~2016 has had horrible reliability. The charging port died a long time ago, fortunately, it charges over USB-C. But now it no longer keeps a charge, won't sleep/hibernate properly (will cook with the lid closed), and more. A friend of mine bought the same one at the same time and his is also breaking down (keyboard problems).
I've tried to get her to switch to Mac, but she prefers Windows, so next time I'm buying her a Surface Laptop. HTH anyone considering the XPS.
For various reasons my main OS is Windows, however due to my past life as Linux fanboy during the university, when I decided to buy a travel netbook, Asus were the ones getting my money for a 1215B with Ubuntu pre-installed.
Sure it had a couple of issues later, more due to the way that Canonical managed the transition of the wlan and Brazos drivers, but it served the message to which vendors I wanted to support.
Don't want to use either Windows or hate Apple's behaviours? Then support the OEMs trying to ship Linux on their hardware.
Another thing is Thunderbolt, but IDK if that’s supported under Linux? So that might be a moot point anyhow.
I used a 2015 Macbook Pro to experiment with making the leap to Linux desktop (though Macbook was essentially just a Linux terminal already).
I think everything worked (this was a year ago) - what pushed me to an XPS was when I realized (pretty quickly) that I have 0 interest in figuring out which arcane key sequence on the Mac keyboard was equivalent to a certain special key on a "PC" keyboard.
I was a 10+-year MacOS power user, and I'd felt it would be impossible to be "happy" (more like "unannoyed") with anything else - I'd re-evaluate that question every year.
I've been happily using Linux Mint on an XPS 15 since Sept last year. Cannot believe what a non-issue the change has been. I have hardly thought about my Macbook - been on it maybe 2 or 3 times to test something Mac-specific. Had I known, I would have switched a few years earlier, rather than "powering through" the unpleasant last few years.
I ended up going with a 15' XPS and installing Ubuntu. The annoying part was the wifi card which sometimes Ubuntu would stop finding, so I'd have to re-install the drivers. For simplicity sake, I didn't bother having hybrid graphics since the only time I really needed the video card was simulations or computer gaming (which I did with booting in Windows).
I had a 15 XPS (Skylake version?) a few years ago with Ubuntu - I just ended up buying an Intel Wifi card for $25 and replacing the oem one. The nice thing about that XPS was it was user serviceable.
I looked at the 2020 Macbook Air (the $~1300 model), and it seems to offer the same or better specs (depending how much you value the display) for the price. Are we at the point where we must pay a premium NOT to run OSX, or am I missing something? I don't love the direction OSX has headed, but I'm still content enough running it and using Linux remotely where needed.
A short description, a bit old, but still useful:
So even if Docker supported a native container system on MacOS, it would be useless because no Linux Docker images could run on it.
I'd suggest you virtualize a normal Linux host on your machine (under VMware for example) and run Docker there.
The reason it doesn't work on WSL1 is because of the whole Linux kernel not being there, the features required for Docker to work don't exist. But since WSL2 is a (rather performant for certain tasks) VM, it works fine.
[1] https://nickjanetakis.com/blog/setting-up-docker-for-windows...
But FWIW: on Linux key bindings are always completely customizable.
I'll have a dig for customising them
(Ok, expanding the memory to a decent size is a little more work)
For such a technical post, I’m surprised this is the recommendation. There are a million ways to copy the iso to the usb drive and make it bootable. The easiest in my opinion is:
cat Ubuntu.iso > /dev/diskhttps://support.apple.com/en-us/HT201300
This is a model without Apple T2, which probably simplifies Linux support.
As far as I am aware of how the Linux kernel is structured, these patches would have to be submitted as BSP 'quirks'. Most of the ICs (such as the audio IC) that Apple used are standard components with Linux drivers available, but Apple often uses different pinouts or configurations requiring modified (patched) drivers to make them work.
In the current state I don't think the patches meet Linus's quality standards to be accepted into the kernel, but it shouldn't be too hard to polish that up.
Should be a fun project to work on of you are looking at contributing to the Linux kernel. You'll need basic knowledge of electronics and embedded systems, but it shouldn't be that hard. Judging from Louis Rossman's youtube channel the schematics for each Macbook board should be available.
Heck, now that I think of it: I would like to give it a try, if only I had a Macbook available to do this with.
I wouldnt want to fight with Apple hw with Linux. Apple doesnt want to make it doable any longer...
You can follow the instructions to create a patched Ubuntu installer, or you can just download the image.
I pay the premium for Apple precisely because everything just works, and works well. (Barring the occasional bugs...)
It mentions adding the touchbar, keyboard drivers[1] and fixes for the non-working wifi[2], all without an external keyboard or anything. You can just boot up your Ubuntu virtual machine, execute some commands in the chroot environment & make an bootable ISO.
This gist[3] and this GitHub repo[4] might also be worth to check out - although it looks like a bit lagging in information (the wifi fix, added last November isn't reflected yet).
This is my command checklist (tweaked from this[0] to match my prefs), might be helpful for someone?
### check if pwd is ~/Download
# ask password beforehand
sudo -v
# mounting iso and copying to current file
sudo mkdir -p /mnt/iso
sudo mount ubuntu-20.04-desktop-amd64.iso /mnt/iso
mkdir customiso
rsync -a --exclude=casper/filesystem.squashfs /mnt/iso/ customiso/
sudo unsquashfs /mnt/iso/casper/filesystem.squashfs
sudo umount /mnt/iso
# chrooting
sudo mount --bind /dev squashfs-root/dev/
sudo chroot squashfs-root/
PS1="(chroot) $PS1"
LC_ALL=C
HOME=/root
export PS1 HOME LC_ALL
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
# updating
mv /etc/resolv.conf /etc/resolv.conf.bak
echo 'nameserver 1.1.1.1' | tee /etc/resolv.conf
### change apt mirror list
apt update
apt upgrade
apt dist-upgrade
apt autoremove
apt -f install
# installing driver
apt install git dkms
echo -e "\n# macbook12-spi-drivers\napplespi\nappletb\nspi_pxa2xx_platform\nintel_lpss_pci" >> /etc/initramfs-tools/modules
git clone https://github.com/roadrunner2/macbook12-spi-driver.git /usr/src/applespi-0.1
dkms install -m applespi -v 0.1
cat > /etc/udev/hwdb.d/61-evdev-local.hwdb << 'EOF'
# MacBook8,1 (2015), MacBook9,1 (2016), MacBook10,1 (2017)
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBook8,1:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBook9,1:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBook10,1:*
EVDEV_ABS_00=::95
EVDEV_ABS_01=::90
EVDEV_ABS_35=::95
EVDEV_ABS_36=::90
# MacBookPro13,* (Late 2016), MacBookPro14,* (Mid 2017)
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro13,1:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro13,2:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro14,1:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro14,2:*
EVDEV_ABS_00=::96
EVDEV_ABS_01=::94
EVDEV_ABS_35=::96
EVDEV_ABS_36=::94
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro13,3:*
evdev:name:Apple SPI Touchpad:dmi:*:svnAppleInc.:pnMacBookPro14,3:*
EVDEV_ABS_00=::96
EVDEV_ABS_01=::95
EVDEV_ABS_35=::96
EVDEV_ABS_36=::95
EOF
cat > /etc/udev/hwdb.d/61-libinput-local.hwdb << 'EOF'
libinput:name:*Apple SPI Touchpad*:dmi:*
LIBINPUT_MODEL_APPLE_TOUCHPAD=1
LIBINPUT_ATTR_KEYBOARD_INTEGRATION=internal
LIBINPUT_ATTR_TOUCH_SIZE_RANGE=200:150
LIBINPUT_ATTR_PALM_SIZE_THRESHOLD=1200
EOF
### edit wifi driver(https://bugzilla.kernel.org/show_bug.cgi?id=193121#c52)
# exiting chroot
mv /etc/resolv.conf.bak /etc/resolv.conf
umount /dev/pts
umount /sys
umount /proc
exit
sudo umount squashfs-root/dev/
sudo rm customiso/casper/filesystem.squashfs
sudo mksquashfs squashfs-root customiso/casper/filesystem.squashfs
cd customiso
sudo rm md5sum.txt
sudo find -type f -print0 | xargs -0 sudo md5sum | grep -Ev "./md5sum.txt|./isolinux/" | sudo tee md5sum.txt
cd ..
sudo xorriso -as mkisofs -r -V "ubuntu-for-mac" -R -l -o ubuntu-for-mac.iso -c isolinux/boot.cat -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat customiso/
[0]: https://nixaid.com/linux-on-macbookpro/[1]: https://github.com/roadrunner2/macbook12-spi-driver
[2]: https://bugzilla.kernel.org/show_bug.cgi?id=193121
[3]: https://gist.github.com/roadrunner2/1289542a748d9a104e7baec6...