Ubuntu on a MacBookPro 8,2 running Yosemite


Being mostly notes to stop me getting frustrated.

Based, in part, from this excellent forum post.

I've always run Linux on my Mac Hardware. I love the physical aspects of the Mac line, but I really can't be bothered with their Play-doh infested software.

Let's assume you have a nice, clean, freshly installed OSX 10.10 Yosemite sat on your MacBook Pro. I'll also assume that you may occasionally want to boot into OSX, so we'll be dual booting with Ubuntu 14.04.

Ubuntu MacBook Pro

Partition

In OSX, open the Disk Utility, select the main disk. We're going to split this in to two parts. Up to you how much you want to dedicate to OSX. Set the 2nd partition to be "Free Space".

rEFInd

Because Apple is a super-special-snowflake, it's not possible to directly install Ubuntu onto the new partition. We need to first install rEFInd. There are specific instructions for Yosemite.

  1. Download rEFInd.
  2. Extract it onto your Mac.
  3. Open a Terminal and navigate to the directory.
  4. Run this command
    sudo ./install.sh --esp
  5. We need to edit some files. Still in the Terminal
    mkdir /Volumes/esp

    then

    sudo mount -t msdos /dev/disk0s1 /Volumes/esp
  6. Edit the file "/Volumes/esp/EFI/refind/refind.conf". Change the line
    #dont_scan_volumes

    to

    dont_scan_volumes foo,bar
  7. Save the file. When you reboot, rEFInd should ask you which OS you want to boot to.

Get Ubuntu

Probably the easiest bit! Download the 64 bit version of Ubuntu. I used another Ubuntu machine to create the Boot Disk on a USB stick.

Install Ubuntu

Turn your MacBook off, insert the USB drive, turn the device on. All being well, rEFInd will give you a choice of devices to boot into. You probably want the one which says something like

/USB/EFI/grub64

You should see a grub style boot screen. Use the cursor keys to move down to "Install Ubuntu". Do NOT press enter! Press "e" to edit the boot options.

If you don't do this - your screen will be blank. And a black screen will make you sad.

Remove the words

quiet nosplash

and replace them with

nomodeset

. Then press the "F10" key to boot.

You'll be taken through the normal Ubuntu installation screen. It's pretty much just clicking "Next" until it is installed.

Partitions

...With the exception of setting up the partitions!

  • Create a 130MB empty partion. Macs get sad if OSX is bundled up next to a proper OS.
  • Create a 512MB partition and assign it to "/boot"
  • At the end of the free space, create a "Swap" parition. Personally, I use as much swap as there is RAM.
  • With the remaining free space, create a partition and assign it to "/".
  • Which device to you want to boot from? I chose the partition assigned to "/boot" - that way you go straight into Ubuntu when you start the machine. If you ever need to get into OSX, hold down "alt" while turning the machine on.

Keep clicking next! Eventually Ubuntu will be installed and you can reboot!

Setting Up Video

When the grub screen comes up, again you'll need to hit "e" to edit the default boot options.

Scroll down to "load_video" and add these lines below it. I don't know what they mean - it's just magic.

 outb 0x728 1
 outb 0x710 2
 outb 0x740 2
 outb 0x750 0

That should boot you into Linux. Now we need to make those changes permanent. Open a terminal and run

sudo nano /etc/grub.d/10_linux

Press CTRL+W to find the line containing "gzio".

Add these lines before it, so the new section looks like

echo "    outb 0x728 1" | sed "s/^/$submenu_indentation/"
echo "    outb 0x710 2" | sed "s/^/$submenu_indentation/"
echo "    outb 0x740 2" | sed "s/^/$submenu_indentation/"
echo "    outb 0x750 0" | sed "s/^/$submenu_indentation/"
echo "    insmod gzio" | sed "s/^/$submenu_indentation/"

To apply these changes, run the following commands.

sudo update-grub
sudo apt-get update
sudo apt-get dist-upgrade

Fans

For better fan performance...

sudo apt-get install lm-sensors
sudo sensors-detect

Answer yes to all questions. Then:

sudo apt-get install macfanctld

Reboot and enjoy Ubuntu! Everything seems to "just work" - although I'll write another blog post explaining how I've customised it.

11 thoughts on “Ubuntu on a MacBookPro 8,2 running Yosemite

  1. I'm looking forward to read that next post you talk about at the end :). . I'm just going to try this install on a MacBook Pro 2010. I hope it all goes as smooth as it looks here

  2. After the installation said to restart my computer, my computer booted into "Missing operating system." Holding option while the computer is turning on leads me to the regular bootloader, on which a "Windows" partition is my only option. I previously had Windows 8 installed via bootcamp, but I deleted its partition before following your tutorial. Selecting Windows leads me to the same "Operating system missing" message. Any thoughts as to what caused this/can fix this?

    1. Hi,
      Sounds like you chose the wrong partition when selecting a boot partition. I'd recommend reinstalling OSX, formatting the drive, and starting again.
      HTH
      T

  3. Did you upgrade the kernel to 3.17.3 to get hotswap support for thunderbolt? What did you do to get wifi working properly? I tried installing 14.04 pre 3.16 and there were enough little irritations that I figured I'd wait until the next kernel version makes it in.

    Also, any particular reason for going with 14.04 over 14.10? I know LTS makes sense for servers, but I'm wondering why you went with 14.04 for a laptop.

    1. Hi Andrew,
      I didn't upgrade the Kernel - I don't use Thunderbolt, so it hasn't come up. The Wifi worked without me having to do anything. I did look at changing to the fully open source driver, but as it didn't make a difference I didn't include it here.
      As for 14.04 - I did it in the (possibly mistaken) beleif that it would be unlikely to receive an update that breaks everything. As this is my work machine, I'm happy to stay on a stable version rather than bleeding edge.
      Terence

  4. Will this work for installing CentOS as well?
    I have a Macbook Pro 15" mid 2009. I just replaced the HDD and have Yosemite on it. when setting up the partitions on the drive I set half to Yosemite and the rest as "free space".
    Can I use the instructions above to install CentOS 7? or is there a tutorial elsewhere someone can point me to?
    Thank you in advance for any assistance you can give.
    -DP

  5. Hey! I've run across your tutorial and I'm having a problem with any linux distro while trying to install on this mac. The fact is that no installation is going after the second install screen (which is the one with the option to "download files while installing"). Is there something wrong with my OS?

  6. Hi,

    Ubuntu has been installed successfully, but I can't boot into it. Applied the nomodeset and the 0x7** to the options but still encountering the blank screen problem.

    The only points of difference between your guide and my process was that I installed reFIND after ubuntu and my partition structure differs slightly. Could either of these things cause problems?

    Thanks!

    1. Yes, rEFInd needs to be able to see the partitions. Try doing it the way I suggested and see if that works.

      1. Sadly, no. Still the same blank screen result. I also referred to the forum post you linked to and added the extra code suggested to no avail. Can you suggest anything else?

Leave a Reply

Your email address will not be published. Required fields are marked *