Skip to content

Instantly share code, notes, and snippets.

@almas
Forked from rob-hills/ubuntu-22.04-mbp-a1707.md
Last active November 30, 2025 20:35
Show Gist options
  • Select an option

  • Save almas/5f75adb61bccf604b6572f763ce63e3e to your computer and use it in GitHub Desktop.

Select an option

Save almas/5f75adb61bccf604b6572f763ce63e3e to your computer and use it in GitHub Desktop.
Ubuntu LTS on MacBook Pro 2017 (A1707, MBP 14,3)(T1 chip)

Summary

Notes to install Ubuntu 22.04.4LTS (Upgraded to 24.04LTS) up and running on my 2017 MacBook Pro 15 inch (MacBookPro14,3).

Now everything except the TouchID (Fingerprint), Suspend and Hibernation seems to work for me.

About Ubuntu 24.04LTS: I tried to install Ubuntu 24.04 and didn't have success. There was a crash issue during installation. https://bugs.launchpad.net/subiquity/+bug/2065310 But I installed 22.04 and upgraded it to the 24.04LTS later and it working same as 22.04.4.

Useful References (not mentioned in the text)

Out of the Box

What worked

A lot of online info about running Ubuntu on MBP indicated that you needed to build drivers and install them just to get the basics running. For Ubuntu 22.04LTS and my MBP a1707, this was not the case. Things that worked for me with the standard Ubuntu 22.04LTS Live USB and after initial installation included:

  • The basic keyboard (not the Touchbar with Esc and Function keys though);
  • The touchpad;
  • My SSK USB-C multi-port adapter, provides important infrastructure such as LAN connection, external monitor, and external storage;
  • Bluetooth. Connected external Bluetooth keyboard and Apple mouse 2.

What didn't work

  • Wifi: It was partly functional, but was not fully usable. Only 2.4Ghz access points shown with poor level and can be connected;
  • Touchbar;
  • Sound;
  • Camera;

What still doesn't work

The following notes mostly document what worked to get Wifi, Touchbar, Camera, and Sound working.

Pre-requirement

The Macbook's EFI partition seems to need to be kept. Please see the following comment for more information.

https://gist.github.com/roadrunner2/1289542a748d9a104e7baec6a92f9cd7?permalink_comment_id=4937505#gistcomment-4937505

Resolution

WiFi

Just creating the configuration file /usr/lib/firmware/brcm/brcmfmac43602-pcie.txt was enough for my hardware.

Andy Holst's example configuration file final iteration here was ideal and only required a little tweaking for my system.

WiFi Driver Configuration tweaks

I made the following changes to Andy Holst's /usr/lib/firmware/brcm/brcmfmac43602-pcie.txt

macaddr=00:90:4c:0d:f5:30
ccode=ALL
  • macaddr - set to the mac address of my WiFi card (I got it with the command ip addr)
  • ccode - I just simply set it to ALL, (ALL (Channel 1-14), US, EU etc.)

Touchbar

Step-by-Step Touchbar

Become the superuser

sudo su

Ubuntu uses initramfs so add our new modules to the list to be loaded

cat <<EOF | tee -a /etc/initramfs-tools/modules
# drivers for keyboard+touchpad
applespi
apple_ib_tb
intel_lpss_pci
spi_pxa2xx_platform
EOF

Build and install drivers from the source code.

apt install dkms
cd {your preferred source download folder}
git clone https://github.com/almas/macbook12-spi-driver
cd macbook12-spi-driver
git checkout touchbar-driver-hid-driver
ln -s `pwd` /usr/src/applespi-0.1
dkms install applespi/0.1 --force

Test the drivers by loading them and their dependencies

modprobe intel_lpss_pci spi_pxa2xx_platform applespi apple_ib_tb

An empty output indicates success

Reboot

At this point of the process, my touchbar was not working. More Googling led me to someone else logging this as [an issue on RoadRunner2's Driver repository[(roadrunner2/macbook12-spi-driver#42] and in the discussion I found a workaround. The following commands:

echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/unbind
echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/bind

caused my touchbar to light up!!

To save having to run these commands each time I start the computer, I needed to create a "macbook-quirks.service" and have it start up with the computer:

sudo su
cat <<EOF | tee /etc/systemd/system/macbook-quirks.service
[Unit]
Description=Re-enable MacBook 14,3 TouchBar
Before=display-manager.service

[Service]
Type=oneshot
ExecStartPre=/bin/sleep 2
ExecStart=/bin/sh -c "echo '1-3' > /sys/bus/usb/drivers/usb/unbind"
ExecStart=/bin/sh -c "echo '1-3' > /sys/bus/usb/drivers/usb/bind"
RemainAfterExit=yes
TimeoutSec=0

[Install]
WantedBy=multi-user.target
EOF

Now enable with systemctl enable macbook-quirks.service and reboot to check.

My MBP now boots up with the Touchbar working!

From the discussion in the link above, it appears this may be due to a bug in Linux and the usbmuxd system so hopefully will be able to remove the workaround in the future, so keep an eye on the relevant issue discussion.

Touchbar Tweaking (Optional)

Personally, I don't like this. But, if you want the Function keys to appear by default (instead of the brightness and sound keys), then you need to pass some parameters to the apple_ib_tb module. 'modinfo apple_ib_tb' lists the parameters and what they do.

sudo su
cat <<EOF | tee /etc/modprobe.d/apple_ib_tb.conf
options apple_ib_tb fnmode=2           # Default to Function Keys, Fn key toggles to "special"
options apple_ib_tb idle_timeout=60    # Turn off the Touchbar after 60 seconds.
EOF

After reloading the module with the following command, the Function keys will be shown by default.

sudo modprobe -r apple_ib_tb
sudo modprobe apple_ib_tb

Sound

I found the resolution from the Rade0nFighter's answer from the following QA: https://askubuntu.com/questions/1475091/sound-macbook-pro-ubuntu-22-04

sudo su

apt install wget make gcc linux-headers-generic
git clone https://github.com/davidjo/snd_hda_macbookpro.git
cd snd_hda_macbookpro/
bash install.cirrus.driver.sh

# It will give you instructions to install package linux-source-XXXXX. Install it.
apt install linux-source-XXXXX

# Then re-run install script.
bash install.cirrus.driver.sh

bash dkms.sh

reboot

Now the sound should work.

Camera

Execute the following command and reboot.

echo "optionsΒ uvcvideoΒ quirks=0x100" > /etc/modprobe.d/uvcvideo.conf

Now the camera should work too.

References

@arag0re
Copy link

arag0re commented Apr 15, 2025

I had wiped the entire disk on A1707. When I reinstalled macos, the device was stuck Critical update required..... I can get past this by killing the loginwindow service. But it seems macos is trying to complete EmbeddedOSInstallService and is failing to do so. There is no damage to the hardware that I'm aware of. I am sure the TouchBar will not work on ubuntu anymore since the firmware can't be installed.

I got the touchbar working on ubuntu 24.04 but only on the older 6.8.0 kernels, not on the 6.11.x kernels.

@SomeRandomCpu
Copy link

SomeRandomCpu commented May 4, 2025

I want to try this with Fedora 42 and a MacBook Pro 13,3 (this exact version). Anything I should be aware of before I try it?

Update: I just put windows 10 ltsc on it with bootcamp and it works well

@jdn3343
Copy link

jdn3343 commented May 18, 2025

I'm no expert but I managed to get the touchbar working on a fresh install of Debian 12 kernel 6.1. For testing purposes you could try adding ccflags-y := -Wno-incompatible-pointer-types to the applespi-0.1 Makefile. Don't forget to unbind/bind the usb after running dkms.

@element-sauce
Copy link

All steps completed successfully for me up to the unbind and bind command.
When I execute echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/unbind it gives me the error

tee: /sys/bus/usb/drivers/usb/unbind: No such device

Does anyone know how to fix this error?

@cookopotamus
Copy link

cookopotamus commented Aug 9, 2025

I'm not sure if you all can help (it is adjacent to this gist) but I'm running out of options! Feel free to ignore me or yell at me or delete this.

Firstly, I have a 2017 MacBook Pro (15", Intel chip, not Apple Silicon). Is that what you all have been doing this with? Intel, and not Apple silicon?

Secondly, I'm not trying to install Ubuntu, per-say, but closely related I'm trying to boot from an Ubuntu stick to go to Drives and restore a Home Assistant OS image onto the MBP. I've seen plenty of reports of this working, so I know it should be possible. It seems like this would also be about the same process for you all installing Ubuntu as the OS:

Screenshot_20250809_100816_Chrome

The issue I'm running into is when the Restore from Image process completes, the entire drive is axed. One partition of 500GB of free space. I would assume there should be one (or more) partitions with whatever OS I'm trying to restore.

When I reboot I get the flashing folder indicating no boot drive. If I boot back into the Ubuntu stick and go to Drives, the original state is back with the one MacOS EFI partition and a second free partition.

I guess I'm wondering if anyone has some ideas as to what is going on... or if there's a straightforward step I'm missing that's necessary before trying to restore an OS onto a MBP?

Thanks for bearing with my wall of text!

@networkdude2k
Copy link

All steps completed successfully for me up to the unbind and bind command. When I execute echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/unbind it gives me the error

tee: /sys/bus/usb/drivers/usb/unbind: No such device

Does anyone know how to fix this error?

I am having the exact same issue with my 2017 15" MBP. Please help. Everything has worked up to this point and now I've hit this snag!

@pedroresende
Copy link

@networkdude2k try to use my repo https://github.com/pedroresende/macbook12-spi-driver it's prepared for kernel 6.14

@maatthc
Copy link

maatthc commented Nov 4, 2025

2017 15" MBP with Ubuntu 25.10 (kernel 6.17.0-5)

macaddr=xx:xx:xx:xx:xx:xx
ccode=X3
regrev=15

  • to

macaddr=00:90:4c:0d:f4:3e
ccode=0
regrev=1

  • In Terminal:
    sudo cp ~/Downloads/brcmfmac43602-pcie.txt /lib/firmware/brcm/
    sudo reboot

@Davidson2k
Copy link

@networkdude2k try to use my repo https://github.com/pedroresende/macbook12-spi-driver it's prepared for kernel 6.14

Hello Pedro,
I have the same issue as @networkdude2k mentioned.
tee: /sys/bus/usb/drivers/usb/unbind: No such device

I did the following:

sudo su

cat <<EOF | tee -a /etc/initramfs-tools/modules

drivers for keyboard+touchpad

applespi
apple_ib_tb
intel_lpss_pci
spi_pxa2xx_platform
EOF

apt install dkms
cd {your preferred source download folder}
git clone https://github.com/pedroresende/macbook12-spi-driver
cd macbook12-spi-driver
git checkout touchbar-driver-hid-driver
ln -s pwd /usr/src/applespi-0.1
dkms install applespi/0.1 --force

Here, the drivers installed successfully, which is great!

modprobe intel_lpss_pci spi_pxa2xx_platform applespi apple_ib_tb
This shows nothing

and finally
echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/unbind
echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/bind

says:
tee: /sys/bus/usb/drivers/usb/unbind: No such device

What are we doing wrong?

Thank you for your suggestions.

@pedroresende
Copy link

@networkdude2k try to use my repo https://github.com/pedroresende/macbook12-spi-driver it's prepared for kernel 6.14

Hello Pedro, I have the same issue as @networkdude2k mentioned. tee: /sys/bus/usb/drivers/usb/unbind: No such device

I did the following:

sudo su

cat <<EOF | tee -a /etc/initramfs-tools/modules

drivers for keyboard+touchpad

applespi apple_ib_tb intel_lpss_pci spi_pxa2xx_platform EOF

apt install dkms cd {your preferred source download folder} git clone https://github.com/pedroresende/macbook12-spi-driver cd macbook12-spi-driver git checkout touchbar-driver-hid-driver ln -s pwd /usr/src/applespi-0.1 dkms install applespi/0.1 --force

Here, the drivers installed successfully, which is great!

modprobe intel_lpss_pci spi_pxa2xx_platform applespi apple_ib_tb This shows nothing

and finally echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/unbind echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/bind

says: tee: /sys/bus/usb/drivers/usb/unbind: No such device

What are we doing wrong?

Thank you for your suggestions.

Could you try to run update-initramfs -u and then reboot ?

@Davidson2k
Copy link

Davidson2k commented Nov 5, 2025

@networkdude2k try to use my repo https://github.com/pedroresende/macbook12-spi-driver it's prepared for kernel 6.14

Hello Pedro, I have the same issue as @networkdude2k mentioned. tee: /sys/bus/usb/drivers/usb/unbind: No such device
I did the following:
sudo su
cat <<EOF | tee -a /etc/initramfs-tools/modules

drivers for keyboard+touchpad

applespi apple_ib_tb intel_lpss_pci spi_pxa2xx_platform EOF
apt install dkms cd {your preferred source download folder} git clone https://github.com/pedroresende/macbook12-spi-driver cd macbook12-spi-driver git checkout touchbar-driver-hid-driver ln -s pwd /usr/src/applespi-0.1 dkms install applespi/0.1 --force
Here, the drivers installed successfully, which is great!
modprobe intel_lpss_pci spi_pxa2xx_platform applespi apple_ib_tb This shows nothing
and finally echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/unbind echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/bind
says: tee: /sys/bus/usb/drivers/usb/unbind: No such device
What are we doing wrong?
Thank you for your suggestions.

Could you try to run update-initramfs -u and then reboot ?

Unfortunately, still the same :(

Version: MBP 13,2 2016 with Ubuntu 25.10 and kernel (6.17.0-6)

@pedroresende
Copy link

@networkdude2k try to use my repo https://github.com/pedroresende/macbook12-spi-driver it's prepared for kernel 6.14

Hello Pedro, I have the same issue as @networkdude2k mentioned. tee: /sys/bus/usb/drivers/usb/unbind: No such device
I did the following:
sudo su
cat <<EOF | tee -a /etc/initramfs-tools/modules

drivers for keyboard+touchpad

applespi apple_ib_tb intel_lpss_pci spi_pxa2xx_platform EOF
apt install dkms cd {your preferred source download folder} git clone https://github.com/pedroresende/macbook12-spi-driver cd macbook12-spi-driver git checkout touchbar-driver-hid-driver ln -s pwd /usr/src/applespi-0.1 dkms install applespi/0.1 --force
Here, the drivers installed successfully, which is great!
modprobe intel_lpss_pci spi_pxa2xx_platform applespi apple_ib_tb This shows nothing
and finally echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/unbind echo '1-3' | sudo tee /sys/bus/usb/drivers/usb/bind
says: tee: /sys/bus/usb/drivers/usb/unbind: No such device
What are we doing wrong?
Thank you for your suggestions.

Could you try to run update-initramfs -u and then reboot ?

Unfortunately, still the same :(

Version: MBP 13,2 2016 with Ubuntu 25.10 and kernel (6.17.0-6)

Did you have any errors while compiling ?

@Davidson2k
Copy link

I finally got it working; the problem was in the Mac EFI boot because I deleted it. There were also issues with the OS Sierra recovery since it was stuck on the error. However, this star https://www.youtube.com/watch?v=Z9pK75VPJC0 made it work.

@pedroresende
Copy link

I finally got it working; the problem was in the Mac EFI boot because I deleted it. There were also issues with the OS Sierra recovery since it was stuck on the error. However, this star https://www.youtube.com/watch?v=Z9pK75VPJC0 made it work.

That's great πŸ‘ . You should keep a small partition to keep mac, to allow it to update firmware in the eventual case of a new one being released

@xicepoub
Copy link

xicepoub commented Nov 27, 2025

Hello,
MacBook Pro 13.2 2017 with Touch Bar, kernel 6.14, Linux Mint 22.2 Cinnamon for me. Everything works except the touchbar.

I get no response in the terminal after the commands echo β€˜1-3’ | sudo tee /sys/bus/usb/drivers/usb/unbind echo β€˜1-3’ | sudo tee /sys/bus/usb/drivers/usb/bind. At first, I got an error message saying that there was β€œno device with that name.” It was related to the same problem as @Davidson2k, no Mac EFI partition, so now I've reinstalled everything, leaving the partition intact. Now there are no more errors, but I get no response in the terminal after the commands, nothing happens. I also tried update-initramfs -u.
I followed the tutorial correctly, replacing the repo with @pedroresende's.

If anyone can help me, I'd appreciate it, thank you!

UPDATE : made it work with ubuntu 22.04 with @almas repo, gave up linux mint. Needed to reinstall two or three times the dkms apple-spi thing, and finally got it to work for no specific reason.
then upgraded to 24.05, don't work anymore. still on it, same issue as before. nothing show up after the "echo1-3" command, update init ram etc. if someone can help, thank you !.

UPDATE 2 : finally working on 24.05. it's crucial, after the upgrade to 24.05, to totally uninstall anything related to the drivers and above all CLEAR the /etc/initramfs-tools/modules file TOTALLY, update-initramfs -u and reboot. . For me, it didn't work until I clear the /etc/initramfs-tools/modules and update-initramfs -u + reboot with an empty /etc/initramfs-tools/modules file first.

Then re-follow the whole tutorial from the very beginning and worked again.

Maybe it was this problem that I had on linux-mint too (probably). Ubuntu is fine in the end, don't want to check again.

Thanks a lot for your work !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment