
Install Ubuntu 20.04 LTS on MacBookPro14,1 - victorleungtw
https://victorleungtw.com/2020/04/24/install-ubuntu-macbook-pro.html
======
Dunedan
I used MacBooks with Linux starting in 2006 till the end of last year. That's
when I finally gave up. I really love the hardware Apple produces, but we're
at a point where I believe it's not feasible anymore to use Linux on MacBooks.

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.

[1]:
[https://github.com/Dunedan/mbp-2016-linux](https://github.com/Dunedan/mbp-2016-linux)

~~~
pansa2
Do the latest Macs still support running Windows via Boot Camp?

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?

~~~
veidr
Yes, absolutely virtualization works so much better. In fact you can boot Mac
and run VMWare Fusion, or boot into Windows 10 and use either Windows
Subsystem for Linux _or_ VMWare Workstation, and you will have a pretty great
experience with Linux.

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.)

~~~
0xff00ffee
I run multiple OSes as part of my job.

The small investment in VMWare Fusion was worth it but I still need some
dedicated machines.

I just have a few issues:

Problem #1: Disk space requirements. I have a late 2013 MBP and windows
gobbles up a min 60GB for the image, which is 1/4th my SDD. This is why I
ended up buying cheap beige boxes for every other OS (or AWS).

Problem #2: Clipboard on VMWare is a trainwreck. Same goes for VNC and
Microsoft Remote Desktop which I also use. My workaround is to use a text file
on my router's USB drive so that I cut and paste through that in each OS.

\----> I would pay someone $1,000 to come to my house and fix my clipboard
problems.

Problem #3a: The magic mouse blows chunks on anything but macOS. And even
running Excel on macOS is impossible with a magic mouse. The left-right slop
makes it difficult to scroll vertically without drifting diagonally... I don't
know how macOS apps solve that.

Problem #3b: I would kill for a mouse with a real middle button, not a
scroll+button. Unix/X middle click paste is a feature I sorely miss on macOS
and Windows.

~~~
_bxg1
You know you can use regular mice on macs, right?

~~~
0xff00ffee
I explain how I'm running on 3 OSes and you actually think I don't know that?

~~~
_bxg1
> I would kill for a mouse with a real middle button

~~~
0xff00ffee
Your reading skills are atrocious.

> ... not a scroll+button. Unix/X middle click paste is a feature I sorely
> miss on macOS and Windows.

~~~
bitwize
Middle-click paste is one of X's many usability fails, especially since it's a
convention adopted by no other UI. All the rest assume a max of 2 essential
buttons.

Command-C and Command-V are just so much better. Learn to love them.

~~~
thomaslord
I don't know the implementation details behind this, but it also seems to me
that Ctrl-C/Ctrl-V has a separate clipboard while middle-click-to-paste pastes
whatever is selected. Makes no sense to me but I've tried to Ctrl-C / middle
click and had issues before. Just one more thing that makes it worse.

~~~
bitwize
On X, yes. Which makes X usability even more of a pain in the ass.

------
fcanesin
Buy a XPS-13 developer edition.

~~~
Narann
Honest question: Having Linux on a Mac a decade ago had sense has Mac
hardwares were special enough to provide value, but now you have XPS-like
hardware, why would people buy a Mac to install a Linux on it? Dual boot? What
does Mac hardware have that others don't?

~~~
trimbo
I've been trying since the Pentium III to use Linux on a laptop and have
finally given up completely. I've tried on a variety of hardware, even with
official support. Driver problems and battery life have always been an issue.

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.

~~~
wpietri
For what it's worth, I've been running Linux on Lenovo laptops for years and
years, and lately it has been fine. No weird tweaks, no special kernel builds.
It just works.

~~~
trimbo
Is the battery life any good? That has always been the Achilles heel for me.
The battery life is like half or 3/4 of what windows gets on the same
hardware.

Last I tried this was on a 2016 X1 Carbon.

~~~
bproven
Carbon X1 (6th gen ), I can get 8-9 hours light stuff and solid 6 doing work.
That is pretty much equivalent to the macbook 13.

I have a macbook 15 for work and am extremely disappointed in its battery
life, so I think the Lenovo matches up well.

~~~
trimbo
Bizarre. I probably only could get 3-4 hours tops with that Carbon X1 (might
have been 4th gen?). What distro do you run? Mine was running Ubuntu.

~~~
bproven
Fedora - currently 31

I do have tlp running on it.

------
sloshnmosh
Just an FYI... You might want to add “balena.io” to your hosts file. I do like
the simplicity of BalenaEtcher but it seems to still try to call home over tcp
port 443 even when I disable usage statistics and auto-updates in settings.
This may have been fixed in newer versions. (I’m using 1.5.45)

------
bproven
Lenovo Carbon X1 - besides maybe Dell XPS line - this is the best small 14"
laptop for Linux. I consider it a 13" macbook replacement. it is good quality.
I have had zero issues with my 6th gen running Fedora. However, you will never
get the trackpad exp of a Mac, but you get a GREAT keyboard on X1s to make up
for it (and the trackpad is actually pretty good).

I wouldnt want to fight with Apple hw with Linux. Apple doesnt want to make it
doable any longer...

------
rahimnathwani
If you have a mid-2017 MacBook pro, these instructions are great:
[https://nixaid.com/linux-on-macbookpro/](https://nixaid.com/linux-on-
macbookpro/)

You can follow the instructions to create a patched Ubuntu installer, or you
can just download the image.

------
3fe9a03ccd14ca5
> _Using Etcher to create bootable USB drive._

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/disk

~~~
yadco
And then overwrite your operating system. The main feature of etcher is that
you can burn an operating system without worrying that you could brick your
machine.

~~~
3fe9a03ccd14ca5
Good point, but at least in Mac I don’t think you can easily write like that
to a partitioned device that’s still mounted.

------
ohwel2l
Somewhat unrelated but do we still need Docker Desktop for Mac to run Docker
containers on macOS? Why is that, is it because Linux is needed? Couldn't
Docker run containers natively using just macOS?

~~~
ressetera
I don't have a clear image of how Docker behaves on Mac, but I had wasted a
whole day trying to make it work on Windows WSL.

I'd suggest you virtualize a normal Linux host on your machine (under VMware
for example) and run Docker there.

~~~
noisem4ker
I'm almost certain you already read this guide [1], so I ask: where did it
fail you? It definitely wasn't straightforward, but I managed to get it
working fine in a couple of hours (Windows 10 1903, WSL 1, Ubuntu 16.04).

[1] [https://nickjanetakis.com/blog/setting-up-docker-for-
windows...](https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-
wsl-to-work-flawlessly)

~~~
ressetera
If I'm not mistaken, I hadn't many issues installing docker on WSL.

The problems started when I docker-compose up'd a pretty basic nginx-php-
mariadb stack.

------
omarhaneef
Or go to windows hyper-v manager, and click install Ubuntu image. And you’re
done!

(Ok, expanding the memory to a decent size is a little more work)

~~~
em500
If you're ok with virtualized Ubuntu rather than native, it's just as easy to
install on the Mac: [https://multipass.run/](https://multipass.run/)

~~~
ShamelessC
I've somehow never heard of multipass.run before. It looks very similar to
Vagrant though. Is there any reason to choose this over Vagrant?

------
goerz
What year’s release is a “MacBookPro14,1”?

~~~
danieldk
Note that it is an identifier, the number indicates a generation, not a screen
size. The answer is MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports):

[https://support.apple.com/en-us/HT201300](https://support.apple.com/en-
us/HT201300)

This is a model without Apple T2, which probably simplifies Linux support.

------
wuunderbar
This might be great "because we can" or to recycle old MacBooks, but to me the
whole point of having a Macbook is the tight, native integration with its
hardware.

I pay the premium for Apple precisely because everything just works, and works
well. (Barring the occasional bugs...)

------
ngcc_hk
What you need is Microsoft like linux VM environment, with direct support by
Apple. But even boot camp ... but competition might help. When developer moves
to windows for its linux Env., it may trigger then to rethink about mac. But
probably not. Sadly.

------
seaghost
I've installed it on a Macbook Pro 15 Retina Late 2013 everything works out of
box.

------
yyx
Are these fixes experimental? There must be a reason why they aren't in the
main distribution.

~~~
LeonM
I did a quick peek at the patches the OP is referring to, the code seems
definitely experimental (no hard feelings towards the authors though!).

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.

------
pcr910303
For people who want to install Ubuntu on MBP14,2 or 14,3 (the new MBPs with
four thunderbolt 3 ports) — this[0] might help. (It'll be probably trivial to
update the article for Ubuntu 20.04 - just ignore the upgrading the kernel
parts.)

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/](https://nixaid.com/linux-on-
macbookpro/)

[1]: [https://github.com/roadrunner2/macbook12-spi-
driver](https://github.com/roadrunner2/macbook12-spi-driver)

[2]:
[https://bugzilla.kernel.org/show_bug.cgi?id=193121](https://bugzilla.kernel.org/show_bug.cgi?id=193121)

[3]:
[https://gist.github.com/roadrunner2/1289542a748d9a104e7baec6...](https://gist.github.com/roadrunner2/1289542a748d9a104e7baec6a92f9cd7)

[4]:
[https://github.com/Dunedan/mbp-2016-linux](https://github.com/Dunedan/mbp-2016-linux)

------
r4mbini
Do you know of a way to get OSX key bindings on Ubuntu?

~~~
LeonM
The key bindings are the least of your worries when trying to run Linux on a
Mac...

But FWIW: on Linux key bindings are always completely customizable.

~~~
r4mbini
I'm running Ubuntu on my custom build desktop PC but with a wired apple
keyboard. I also use Macs quite a lot. If I could get consistency between the
two with key bindings it would be so good.

I'll have a dig for customising them

------
OrgNet
Arent MacBooks overpriced because of MacOS?

------
deeblering4
2020 - Finally, the year of linux on the desktop.

