Ubuntu on a MacBookPro 8,2
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.
- Download rEFInd.
- Extract it onto your Mac.
- Open a Terminal and navigate to the directory.
- Run this command
sudo ./install.sh --esp
- We need to edit some files. Still in the Terminal
mkdir /Volumes/esp
then
sudo mount -t msdos /dev/disk0s1 /Volumes/esp
- Edit the file "/Volumes/esp/EFI/refind/refind.conf". Change the line
#dont_scan_volumes
to
dont_scan_volumes foo,bar
- 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.