Skip to content

Instantly share code, notes, and snippets.

@johnjeffers
Created May 31, 2020 00:21
Show Gist options
  • Star 38 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save johnjeffers/3006011ec7767a4101cdd118e8d64290 to your computer and use it in GitHub Desktop.
Save johnjeffers/3006011ec7767a4101cdd118e8d64290 to your computer and use it in GitHub Desktop.
Ubuntu 20.04 on a 15" Retina MacBook Pro (Mid-2014)

Ubuntu 20.04 on a 15" Retina MacBook Pro (Mid-2014)

These are notes from my efforts to get Ubuntu 20.04 installed on my older MacBook Pro. I'm making this gist public in the hopes that it's helpful to others.

I did a Minimal install, but selected the option to install additional 3rd-party drivers.

Wifi doesn't work during the install (because it requires a 3rd-party driver), so you won't be able to choose to download updates while installing. No big deal, run a software update after the install.

The installer takes about 25 minutes to complete. Post-install, most things work. The only driver I had to manually install was for the FaceTime camera. More on that below.

Wifi

It works, mostly. I do get the occasional dropout, and it is slow to reconnect when you wake from suspend. Haven't figured this one out yet.

Display

I find the default setting of 2880x1800 at 200% scale to be too big.

For me, the sweet spot is to set the scale at 100%, then open Universal Access settings, turn on Large Text, and change the Cursor Size to Medium. That gives me the crisp graphics I want, with all the screen resolution I need, at a font size that isn't too small to see comfortably.

I'll also mention that I tried:

  • Fractional scaling, but apparently the display can't handle it. I just got a black screen.
  • Changing resolutions in the Nvidia control panel, but that just made everything fuzzy.

FaceTime Camera

This is a summary of info from https://github.com/patjak/bcwc_pcie/wiki/Get-Started

If you did a Mimimal install, you'll need:

sudo apt install curl git unrar

Firmware

git clone https://github.com/patjak/facetimehd-firmware.git
cd facetimehd-firmware
make
sudo make install

Results of sudo make install should be

Copying firmware into '//usr/lib/firmware/facetimehd

Sensor Calibration

Download Boot Camp Support Software from https://support.apple.com/kb/DL1837

Extract the file:

unzip bootcamp5.1.5769.zip
cd BootCamp/Drivers/Apple/
unrar x AppleCamera64.exe

# Extract the DAT files:
dd bs=1 skip=1663920 count=33060 if=AppleCamera.sys of=9112_01XX.dat
dd bs=1 skip=1644880 count=19040 if=AppleCamera.sys of=1771_01XX.dat
dd bs=1 skip=1606800 count=19040 if=AppleCamera.sys of=1871_01XX.dat
dd bs=1 skip=1625840 count=19040 if=AppleCamera.sys of=1874_01XX.dat

# Copy the DAT files to the folder containing the driver:
sudo cp *.dat /usr/lib/firmware/facetimehd

Driver

git clone https://github.com/patjak/bcwc_pcie.git
cd bcwc_pcie
make
sudo make install
# you may get SSL errors, but it appears these are safe to ignore
sudo depmod
sudo modprobe -r bdc_pci
sudo modprobe facetimehd
echo facetimehd | sudo tee -a /etc/modules > /dev/null

Don't forget to clean up the downloaded git repos and the extracted Boot Camp driver files.

Fonts

I'm a long-time Mac user. I like Mac fonts. Skip this bit if you want.

My favorite monospaced font is Monaco, and I like the look of the San Francisco font in the UI. If you don't have access to a Mac to copy the font files from, you can find them online.

You can use Dconf Editor to change the system fonts, but it's easier to use the GNOME Tweaks app. Both are available in the Ubuntu Software app.

In the Tweaks app, select the Fonts page. I use the following:

Interface Text         SF Pro Display Regular 11
Document Text          SF Pro Display Regular 11
Monospace Text         Monaco Regular 11
Legacy Window Titles   SF Pro Display Semibold 11



And that's it. Most of the other tweaks I do are pure personal preference, not really worth mentioning here.

If you have suggestions for improvements to this doc, please leave me a comment.

@lomagoel
Copy link

lomagoel commented Jan 1, 2021

Thank you for updated information. I was looking for it for weeks. I am novice at computers, so it was really hard to make Apple camera work on ubuntu.

@andreak3779
Copy link

Thanks for sharing the information. The instructions work on a macbook pro mid-2014 13.3" with zorin os 15.3.

@lgib2u
Copy link

lgib2u commented Feb 8, 2021

Thanks SOOOOO much, great easy to follow instructions... Now I can actually use my camera in my upcoming interview...

@eudoxos
Copy link

eudoxos commented Mar 9, 2021

Thanks a bunch, this also works for MacBook Air 6.1 (2013) without any changes.

@eelcoverbrugge
Copy link

This commando sudo modprobe -r bdc_pci was not working for me (modprobe: FATAL: Module bdc_pci not found.) but the camera works! Thanks

@eudoxos
Copy link

eudoxos commented Jun 16, 2021

I created repo with installation script and the extracted DAT files, in case someone finds that useful: https://github.com/eudoxos/skoly/tree/main/tweaks/macbook-air

@bmccashin
Copy link

Thanks.
I put Ubuntu 20.04 on 13" MacbookPro Mid 2014 yesterday. Everything worked of of the box except Camera.

That did the trick to get me back into most beloved Teams meeting...LOL

@WhoDeyNation
Copy link

When I did the step:
unzip bootcamp5.1.5769.zip
cd BootCamp/Drivers/Apple/
unrar x AppleCamera64.exe

Extract the DAT files:

dd bs=1 skip=1663920 count=33060 if=AppleCamera.sys of=9112_01XX.dat
dd bs=1 skip=1644880 count=19040 if=AppleCamera.sys of=1771_01XX.dat
dd bs=1 skip=1606800 count=19040 if=AppleCamera.sys of=1871_01XX.dat
dd bs=1 skip=1625840 count=19040 if=AppleCamera.sys of=1874_01XX.dat

These .dat files were not in there were I ran the command "unrar x AppleCamera64.exe". Is there something that I missed or a step that I missed?

@bmccashin
Copy link

I think you missed
sudo cp *.dat /usr/lib/firmware/facetimehd

That's the data that's required in the next step when you iniiialize the kernal module.
sudo modprobe facetimehd

@WhoDeyNation
Copy link

I think you missed
sudo cp *.dat /usr/lib/firmware/facetimehd

That's the data that's required in the next step when you iniiialize the kernal module.
sudo modprobe facetimehd

When I run the command
"sudo cp .dat /usr/lib/firmware/facetimehd"
it returns with:
"cp: cannot stat '
.dat': No such file or directory"

I ran the command "unrar x AppleCamera64.exe" and all that was dropped were these type of files ".txt,.cat;.inf;.sys".

Curious if I did something wrong. I followed the steps but am wondering why I am not getting the .dat files. Sorry first time owning a Mac in a long time and first time switching it to Ubuntu.

@eudoxos
Copy link

eudoxos commented Jul 13, 2021

@WhoDeyNation: you might want to look at https://github.com/eudoxos/skoly/tree/main/tweaks/macbook-air: cloning that repo and running facetime-install.sh should do everything for you. The *.dat files are extracted in the repo already.

Otherwise, follow the instruction above better: run unrar first (you did that already), then run dd 4× to extract parts from the AppleCamera.sys (this is what you skipped), then run sudo cp *.dat /usr/lib/firmware/facetimehd (also note the * which you are missing in the above)

@palmerj
Copy link

palmerj commented Aug 22, 2021

I did a full install, and selected the option to install additional 3rd-party drivers. After reboot I get a black screen. Any ideas?

@palmerj
Copy link

palmerj commented Aug 22, 2021

OK I re-did the install process and it work. Go figure...

@palmerj
Copy link

palmerj commented Aug 22, 2021

Note I've now been able to solve the problem with the scaling.

  1. install Nvidia drivers 470 sudo apt install nvidia-driver-470
  2. sudo reboot
  3. sudo vi /etc/modprobe.d/nvidia.conf
  4. added contents options nvidia_drm modeset=1 and saved
  5. sudo update-initramfs -u
  6. sudo reboot
  7. verified that sudo cat /sys/module/nvidia_drm/parameters/modeset returns Y
  8. opened gnome-settings and set fractional scaling to 125%

@palmerj
Copy link

palmerj commented Aug 22, 2021

I'm getting wake from suspend issues. When I reopen my laptop lid the fan maxes out and the OS locks up. Any ideas?

@palmerj
Copy link

palmerj commented Aug 23, 2021

Ok, I've downgraded to nvidia-driver-460 and at least the OS doesn't lock up when I close the lid. However the OS doesn't actually suspend and the Apple logo light on the lid turns on and off at about every 10 secs. I've tried setting echo XHC1 > /proc/acpi/wakeup && echo LID0 > /proc/acpi/wakeup but that make no difference.

@palmerj
Copy link

palmerj commented Aug 23, 2021

Ok installing the nvidia-driver-465 drivers now seems to fix the issue - man what a mess! Funny thing is installing the nvidia-driver-465 packages installed driver version 470.57.02, so the same as nvidia-driver-470. Maybe I had some original config issue with the first install of the 470 drivers. Who knows, I'm happy for now!

@palmerj
Copy link

palmerj commented Aug 23, 2021

Spoke too soon. Looks like I'm still get OS hangs when I close my lid from time to time. I might disable suspend.

@satmandu
Copy link

satmandu commented Apr 4, 2022

If one wants to generate the dkms package for ubuntu, so you don't have to manually install for new kernel installs, try this:

# Install required apps: 
sudo apt install debhelper git
# get source
git clone https://github.com/patjak/bcwc_pcie.git
cd bcwc_pcie/
sudo dkms mkdsc -m facetimehd -v 0.1 --source-only
sudo dkms mkdeb -m facetimehd -v 0.1 --source-only
# Now install the deb package in /var/lib/dkms/facetimehd/0.1/deb
sudo dpkg -i /var/lib/dkms/facetimehd/0.1/deb/*.deb

@goreycn
Copy link

goreycn commented Mar 12, 2023

Awesome ~, I tried this, and get WIFI works fine.

I did a Minimal install, but selected the option to install additional 3rd-party drivers.

@dphov
Copy link

dphov commented Sep 10, 2023

had same output as @eelcoverbrugge
camera works! I'm using 6.4.6 kernel

@shengelenge
Copy link

shengelenge commented Mar 28, 2024

Thank you, followed your instructions and Camera works fine on my 2017 Macbook Pro Ubuntu 22.04.4 LTS setup.

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