Ubuntu 14.10 running on my MacBook

What I did to get it running, and why it’s still not perfect


A few days ago I thought I’d never run something different than Mac OS X on my MacBook, but then I remembered how great Ubuntu ran some years ago on my old laptop. Apart from that my development environment was easily adoptable to Ubuntu and I really love customising stuff, so I made the switch to Ubuntu. That’s how it starts…

That’s how it starts, at least according to xkcd. http://xkcd.com/456/

Let me say this first: It doesn’t run perfectly fine compared to OS X. With “perfectly fine” I mean, that the UI has some hiccups. “The UI?”— you might ask. Yes, Ubuntu’s Unity looks really great (IMHO), but it has got its problems with Retina displays. This is currently my only problem with it, and everything else runs really smoothly.

The overall stability is great! I had some crashes, but they were really predictable and even Mac OS X crashes sometimes. Every OS has its rough edges, I’d say.

If you’d like to try an even smoother system with more freedom, which I’m currently running myself, then read my new guide: Arch Linux running on my MacBook.

Why I wrote this article

The Wiki page for setting up Ubuntu 14.10 on a Macbook 11,1 just sucks. There are still old pages for previous versions of Ubuntu, but those are obviously outdated and were really unspecific to what was needed to make the system usable.

I wanted to run Ubuntu-only on my MacBook, without rEFIt, without the BIOS-legacy mode, and of course without OS X. There was no complete guide to do this, and so I decided to write this after I finished to set Ubuntu up.

I did this mainly because of two simple reasons: Perfectionism and Experimentation.

I just wanted to see whether it works, and whether it can replace OS X as my daily driver. It is an experiment of whether Open Source is even able to be comparable to a corporate product as OS X. In my opinion it really is, but judge for yourself.

For whom I wrote this article

This article is for people, who…

  • are Ubuntu enthusiasts, who’d like to run Ubuntu daily on their Mac
  • are Ubuntu agnostics, who’d like to see, whether Ubuntu can even replace Mac OS X (Spoiler: Yes, it definitely can)
  • love to tinker with systems and their development environment

But this article is not for people, who…

  • don’t know how to use the command line or are not familiar with Bash
  • never used Ubuntu before (you might be able to do this, but what if it goes wrong?)
  • are afraid of deleting everything from their Mac including OS X.

So, you’re still here? —Great! Let’s do this!


This guide will wipe everything from your disk and install Ubuntu only. No OS X involved! If you really want to do this make backups, lots of them.

I wrote this guide for a Macbook Pro Retina 11,1 13". It might work for similar models too, but I can’t guarantee it. In fact I better guarantee nothing.


It’s really easy to make a bootable setup-stick for Ubuntu. You just need Unebootin and the Ubuntu 14.10 Utopic Unicorn (non-mac) ISO.

You can get the ISO image here: http://www.ubuntu.com/download/desktop/thank-you/?version=14.10&architecture=amd64

There once were mac-versions of the setup ISOs. They came without the EFI booting files, so the Mac would start them in BIOS-legacy mode.

The BIOS-legacy mode is included in the Mac firmware and emulates a full BIOS, which is obviously really inefficient. The Mac would startup the EFI, then the BIOS-legacy mode, then the Linux bootloader, then Ubuntu itself. When you install Ubuntu, it will set itself up to boot in BIOS-legacy mode.

I’m a perfectionist when it comes to these things, so I really tried hard to set Ubuntu up without this BIOS emulation, and you should too.

It’s really easy to prepare an installation stick with Unebootin, so I won’t write about it.

Setting up Ubuntu

I really searched a long time to find a guide to do this and found a great one here: http://heeris.id.au/2014/ubuntu-plus-mac-pure-efi-boot/

I will try to simplify it here and explain step by step why we’re doing what.

First of all insert your boot-stick and restart your MacBook while pressing the “alt” or “option” key on your keyboard. This will hopefully (probably not on your first try) bring up the Mac’s boot menu.

Your boot menu will most likely look this one alike, but instead of the “Install OS X Mavericks”-drive there should be your Ubuntu installation stick.

Select your Ubuntu installation stick there, press Enter and the Ubuntu installer should boot up.

Another menu will show up. The Ubuntu installer’s menu. Among those options you will find “Install Ubuntu”. So go ahead and select it.

The installer will explain everything from there on. Just go ahead and set everything up to your liking. Be careful with the partitioning step though! There we need to be careful, so everything goes as planned.

You should see these partitioning options:

  • Guided — use entire disk
  • Guided — use entire disk and set up LVM
  • Guided — use entire disk and set up encrypted LVM
  • Manual

You should select “Guided — use entire disk”—again, this will erase your entire disk. We do not want LVM, as this confuses EFI later on.

The installer will present you with the partitioning it will perform. It should create three partitions: EFIboot, ext4 and swap. Be careful, that it really creates an EFIboot partition! If it doesn’t, something is going awfully wrong.

Continue with the installation and you will get an unbootable Ubuntu installation. Hooray!

Booting Ubuntu

One might say: “What’s this?! We just installed Ubuntu and it’s already broken?” Yes, but this step isn’t always necessary. You could just boot it in BIOS-legacy mode. Ewwwwwwwww!

To fix Ubuntu we need to boot the installation stick again and instead of selecting “Install Ubuntu”, this time we only need to press “c” to bring up the grub console.

The GRUB console. Isn’t it beautiful? — No.

Type “ls” to get an overview of your partition table. It should look like this:

(memdisk) (hd0) (hd0,msdos) (hd1) (hd2) (hd2,gpt3) (hd2,gpt2) (hd2,gpt1)

Cycle through the partitions with the following instruction to find your GRUB installation:

ls (hd2,gpt1)/boot/grub

You just need to modify “gptX”.

If you get this back: “error: file ‘/boot/grub’ not found.” it’s the wrong partition if you get something like: “unicode.pf2 […] grub.cfg” it’s the partition we’re searching for.

Now we need to get the UUID of the drive:

grub> ls -l (hd2,gpt2)
Partition hd2,gpt2: Filesystem type ext* [...] UUID e86c20b9-83e1-447d-a3be-d1ddaad6c4c6 - Partition start at [...]

Where “(hd2,gpt2)” is the partition you found earlier.

Note down this long string (the UUID) and be prepared to enter it again later.

Now set it as your root, so GRUB can reference it in our further instructions:

set root=(hd2,gpt2)

Now we know enough to boot into the system.

linux /boot/vmlinuz[tab].efi.signed root=UUID=[UUID]

You can press [tab] to find our which files are there, because I’m not really sure which kernel 14.10 originally uses. It’s probably 3.16.7–031607, but hey—tab completion.

Replace [UUID] with the UUID string you noted down earlier. No shortcuts, no copy&paste, no tab completion. I’m sorry, but there’s no way around typing it.

initrd /boot/initrd[tab]

The same game—tab completion. Then:


And your fresh Ubuntu system should boot for the first time.

Fixing Ubuntu

Now we’re finally fixing it. Make sure, that your system is connected to the internet. In Ubuntu 14.10 Wi-Fi should already work. That’s nice. If it’s not (this was the case with older versions of Ubuntu) you need a LAN connection or copy all the Debian packages needed to install Wi-Fi drivers from another system.

(Ignore that everything still looks tiny due to the Retina display. We’re going to fix that later)

Open a terminal window by pressing “ctrl-alt-T”.

Here comes the first sudo in this guide, but it won’t be the last.

First of all we’re going to add Jason Heeris’s repository, which contains nice tools to fix the EFI boot partition:

sudo add-apt-repository ppa:detly/mactel-utils

Then we’re going to install some tools we need:

sudo apt-get update
sudo apt-get install mactel-boot hfsprogs gdisk grub-efi-amd64

Now we’re going to get the partition table (again):


Somewhere in there you’ll find this line:

/dev/sda1 on /boot/efi type vfat (rw)

This is your EFI boot partition, but it’s formatted as VFAT. Unfortunately the Mac EFI firmware does not boot anything from VFAT, so we will need to reformat it. First of all we need to unmount the partition to be able to edit it:

sudo umount /dev/sda1

Note that it doesn’t have to be at “/dev/sda1” for you, even if it’s very likely.

Now let’s edit your partition table with gdisk:

sudo gdisk /dev/sda

Press “p” to print to let gdisk print the current table, which looks like this:

Number Start (sector) End (sector) Size Code Name
1 2048 194559 94.0 MiB EF00
2 194560 968574975 461.8 GiB 8300
3 968574976 976771071 3.9 GiB 8200

The first partition is the EFI boot partition. For me—in contrary to Jason’s instructions—it didn’t have the code EF00. It’s size was even larger at about 500MB. So don’t worry, you will recognise it as it is always really small and number 1. Now delete it:

Command (? for help): d
Partition number (1-3): 1

And add a new partition at its place:

Command (? for help): n
Partition number (1-128, default 1): 1

Now press enter twice to confirm the recommended size for the partition:

First sector (34-976773134, default = 2048) or {+-}size{KMGTP}:[ENTER]
Last sector (2048-194559, default = 194559) or {+-}size{KMGTP}: [ENTER]

Then enter AF00 for the filesystem code:

Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): AF00
Changed type of partition to 'Apple HFS/HFS+'

Then press “w” to write the changes to your disk. Gdisk will ask for your confirmation before it proceeds. Now you’ve got a new, unformatted HFS+ EFI boot partition. Let’s format it with:

sudo mkfs.hfsplus /dev/sda1 -v Ubuntu

After that we need to update the Ubuntu filesystem table, so Ubuntu knows where to load the new /boot/efi partition from. First of all edit the /etc/fstab file:

sudoedit /etc/fstab

Search for these two lines and delete them:

# /boot/efi was on /dev/sda1 during installation
UUID=C59D-1B30 /boot/efi vfat defaults 0 1

Exit with “ctrl-x” and press “y” to save.

Now we need to replace the line you deleted with our new partition:

sudo bash -c 'echo UUID=$(blkid -o value -s UUID /dev/sda1) /boot/efi auto defaults 0 0 >> /etc/fstab'

I modified the command Jason suggests, because of a bug (?) in blkid.

Then remount the EFI boot partition:

sudo mount /boot/efi

Reinstalling GRUB

By default GRUB is installed on the system partition, but for EFI it’s on the EFI boot partition. Oops! We just formatted it. Well then let’s reinstall GRUB.

Because this process is always identical I will just write out all commands you need:

sudo mkdir -p "/boot/efi/EFI/$(lsb_release -ds)/"
sudo bash -c 'echo "This file is required for booting" > "/boot/efi/EFI/$(lsb_release -ds)/mach_kernel"'
sudo bash -c 'echo "This file is required for booting" > /boot/efi/mach_kernel'
sudo grub-install --target x86_64-efi --boot-directory=/boot --efi-directory=/boot/efi --bootloader-id="$(lsb_release -ds)"
sudo hfs-bless "/boot/efi/EFI/$(lsb_release -ds)/System/Library/CoreServices/boot.efi"


Better reboot the system to make sure it works.

Improving the EFI Boot Order

After rebooting we should improve the EFI boot order. THis can be done using the “efibootmgr” tool. If you run it, it will print something like:

BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0080
Boot0000* ubuntu
Boot0001* Ubuntu 14.10
Boot0080* Mac OS X

Then remove all entries, which names are not “Ubuntu 14.10”:

sudo efibootmgr -b 0000 -B
sudo efibootmgr -b 0000 -B

Replace the numbers with the ones you see from “efibootmgr”’s output.

Now set the default booting partition to “Ubuntu 14.10”, in this case:

sudo efibootmgr -o 0001

You should end up with an EFI boot order, that looks just like mine:

BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0001
Boot0001* Ubuntu 14.10

By the way, even if you change the timeout after a reboot it will always default to 5 seconds.

GRUB timeout

In the next steps we will update the system. This will also load the newest kernel. Unfortunately this will reconfigure GRUB, which will then set a timeout of 10. There’s no way around adding some scripts to GRUB to prevent this:

sudo touch /etc/grub.d/25_pre-os-prober
sudo touch /etc/grub.d/35_post-os-prober
sudo bash -c 'echo -e "#! /bin/sh\nset -e\n\ncat << EOF\nset timeout_bak=\${timeout}\nset timeout_style_bak=\${timeout_style}\nEOF" > /etc/grub.d/25_pre-os-prober'
sudo bash -c 'echo -e "#! /bin/sh\nset -e\n\ncat << EOF\nset timeout=\${timeout_bak}\nset timeout_style=\${timeout_style_bak}\nEOF" > /etc/grub.d/35_post-os-prober'
sudo chmod 755 /etc/grub.d/25_pre-os-prober
sudo chmod 755 /etc/grub.d/35_post-os-prober


Following some fixes for Ubuntu on MacBooks, some things are not really necessary, but some are kind of critical.

The Retina Screen

Everything looks tiny? Open the “System Settings”, go to “Displays” and drag the “Scale for menu and title bars” slider to “2”.

Now you’ve got it. Maybe you need to reboot to apply it at more places. I have yet to find out how to scale everything on the login screen. This seems to be a bug at the moment.

To fix Firefox open it and go to “about:config”. Search for “layout.css.devPixelsPerPx” and set it to “2” as well.

Some applications still won’t scale. For example Google Chrome and Chromium. That’s a shame, as one of these browsers is needed to watch Netflix. Personally I’m really feeling bummed out by this.


If your Wi-Fi still doesn’t work out-of-box—which it did for me—install the driver manually:

sudo apt-get install bcmwl-kernel-source

If you’re on a different system than the Macbook Pro 11,1 you might need to try different drivers than the proprietary one. The Macbook Pro 11,1 uses the BCM4360, which is unfortunately not supported by the open source b43 driver. But if you’re on a different system, you might be lucky.

Found out on which chipset you are by executing:

lspci -vnn | grep 14e4:

And check out here whether your chipset is supported. If it is you can install the b43 driver by executing:

sudo apt-get purge bcmwl-kernel-source broadcom-sta-common broadcom-sta-source
sudo apt-get install firmware-b43-installer

There’s still another driver, but these two here should cover most (if not all) of the Macbooks.

Updating the system

Just run:

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get autoremove

Update the kernel

This is really critical! Suspending won’t work properly without an upgrade to the newest kernel.

Run this to install the 3.18 kernel:

cd /tmp/
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-vivid/linux-headers-3.18.0-031800-generic_3.18.0-031800.201412071935_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-vivid/linux-headers-3.18.0-031800_3.18.0-031800.201412071935_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-vivid/linux-image-3.18.0-031800-generic_3.18.0-031800.201412071935_amd64.deb
sudo dpkg -i linux-headers-3.18.0-*.deb linux-image-3.18.0-*.deb

And don’t forget to reboot.

Fixing the touchpad

Ubuntu’s default configuration for the touchpad is unusable! Run this to get it configured more like OS X’s, including natural scrolling:

gsettings set org.gnome.settings-daemon.plugins.mouse active false
sudo apt-get install xserver-xorg-input-mtrack
sudo apt-get autoremove xserver-xorg-input-synaptics
sudo rm /usr/share/X11/xorg.conf.d/50-synaptics.conf

This installs mtrack, a multitouch trackpad driver, originating from a project which was meant specifically for the MacBook’s trackpad.

Now create and edit the xorg.conf file:

sudo nano /etc/X11/xorg.conf

Paste the following:

Section "InputClass"
MatchIsTouchpad "on"
Identifier "Touchpads"
Driver "mtrack"
Option "IgnoreThumb" "true"
Option "IgnorePalm" "true"
Option "DisableOnPalm" "true"
Option "BottomEdge" "30"
Option "TapDragEnable" "false"
Option "Sensitivity" "1.2"
Option "ButtonEnable" "true"
Option "ButtonIntegrated" "true"
Option "ClickFinger1" "1"
Option "ClickFinger2" "3"
Option "TapButton1" "0"
Option "TapButton2" "0"
Option "TapButton3" "0"
Option "TapButton4" "0"

Save with “ctrl-x” and “y”.

To enable natural scrolling execute:

echo "pointer = 1 2 3 5 4 6 7 8 9 10 11 12" > ~/.Xmodmap

Now reboot to apply.

Fixing a Marvell SSD bug

There’s a bug with Marvell PCIe SSDs when the SSD is set to maximum power, which spams the dmesg with messages of resetting the SSD. THis possibly lowers performance and increases the chance of file corruption.

There’s a workaround which prevents a certain SATA script from setting the drive to maximum power.

Open the said script:

sudo nano /usr/lib/pm-utils/power.d/sata_alpm

And replace the following line:

false) set_sata_alpm max_performance;;

With this one:

false) set_sata_alpm min_power;;

Save with “ctrl-x” and “y”.

Fixing sensors, fans and the ambient light sensor

Out of the box Ubuntu doesn’t recognise your MacBook’s sensors, thus don’t regulating the fans and the backlight. This is really a bummer, but easily fixable.

Edit the “/etc/modules” file:

sudo nano /etc/modules

And add the following two lines:


And save (as always) with “ctrl-x” and “y”. You should reboot to be save. Now the linux kernel loads modules to recognise MacBook-specific sensors. But the system still doesn’t know what to do with them.

There are two pretty nice daemons which utilises them: “Lightum” and the “Fan-Control-Daemon”.

Lightum controls your backlight and the keyboard light based on the ambient sensor readouts.

The Fan Control Daemon obviously controls your fan speeds based on the temperature sensors’ readouts. This program is pretty similar to the way OS X handles the fan speeds. Another popular program to do this, called macfanctld just races up the fan speed in bursts. This daemon however exponentially rises the fan speed according to the temperature and lowers it quadratically when the temperature drops.

To install these tools we will need to install Git and essential tools for building, and set up our build directory:

sudo apt-get install git build-essential
sudo mkdir /usr/local/src
sudo chmod -R 755 /usr/local/src
sudo chown -R $USER:$USER /usr/local/src

Now we will download and compile the two daemons.

For the Fan-Control-Daemon do:

cd /usr/local/src
git clone https://github.com/dgraziotin/Fan-Control-Daemon.git
cd Fan-Control-Daemon
sudo make install
sudo cp mbpfan.upstart /etc/init/mbpfan.conf
sudo start mbpfan

This should start it in the background and on boot.

For Lightum do:

sudo apt-get install libxss-dev libdbus-glib-1-dev
cd /usr/local/src
git clone https://github.com/poliva/lightum.git
cd lightum
sudo make install

To configure lightum open its configuration file:

sudo nano ~/.config/lightum/lightum.conf

Here are my current settings for:


Now you’ve got that out of the way too.

Comments on this setup

Ubuntu runs great! It’s quick, it’s beautiful and it’s much easier to set up than a few years ago. (And you thought this was hard?)

It seems to even outperform Mac OS X 10.10 often, as I’ve observed myself and read about here: www.phoronix.com/scan.php?page=article&item=osx10_ubuntu1410.

We’ve got smooth flash video now, but what about Retina displays? http://xkcd.com/619/

But what matters the most is: You’ve got freedom! You’ve basically freed your MacBook from any restrictions Apple laid on it. You can customise anything, really. This is what I like the most about it.

I really hope that the HiDPI support for Unity and Google Chrome will improve in the future. That’s the only bummer at the moment in my opinion.


I hoped, that this guide helped you to Ubunt-ify your MacBook. Just write me or comment if you’ve got some questions.

Have I missed something? Comment and I will try to add it to the guide!

I’m also thinking about writing an article about my personal development environment for Ruby, node.js and web development.

I’d like to know whether what I think and write made a difference, so please “Recommend” this article to your friends and leave a comment, if you like what you read.