Dual Boot OSX 10.10 and Ubuntu 14.04 on a 2013 Macbook Pro Retina¶
Introduction¶
Why? Some recent benchmarks have shown that Ubuntu can out-perform OSX on Macbook hardware.
- http://www.phoronix.com/scan.php?page=article&item=osx10_ubuntu1410&num=1
- http://www.phoronix.com/scan.php?page=article&item=ubuntu_1404_mba2013gl&num=1
This process was tested on a late 2013 Macbook11,2 A1398 model:
- 2GHz Intel Core i7
- 16GB 1600 MHz DDR3
- Intel Iris Pro 1536MB
You can check your Macbook model from Ubuntu like so:
sudo dmidecode --type 1
Issues¶
Thunderbolt Monitor support is not great. It will work if the monitor is connected to the system at boot-up, but it does not support hot-plug.
Note
See https://blog.jessfraz.com/post/linux-on-mac/ for some new information on this.
Apparently, kernel 3.17 has support for hotplugging Thunderbolt connections.
See http://ubuntuhandbook.org/index.php/2014/11/how-to-upgrade-to-linux-kernel-3-17-4-in-ubuntu-14-10/ for adding 3.17 to Ubuntu 14.
Installing¶
-
Prepare Macbook for Ubuntu installation.
-
Partition hard disk.
- Finder > Applications > Utilities > Disk Utility
- Macintosh HD > Partition
- Add a "Free Space" partition equal to half the drive.
- Apply and wait for the file system to shrink (30-60 minutes).
-
Download a binary zip and install rEFInd Boot Manager. This will allow you to switch between booting OSX 10.10 and Ubuntu 14.04.
unzip refind-bin-0.8.4.zip cd refind-bin-0.8.4 ./install.sh --alldrivers
-
Download Ubuntu and create a bootable USB stick.
hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso diskutil list # find usb disk diskutil unmountDisk /dev/diskN sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m diskutil eject /dev/diskN
-
-
Install Ubuntu.
- Reboot, hold down the Option key and choose Ubuntu USB stick.
- Grub Boot Menu: Install Ubuntu
- Continue with the installation, without networking.
- Installation Type > Something Else
- This will allow you to create a custom partition configuration and preserve your Mac OSX install.
-
You should see a partition list like the following:
Partition Type Size /dev/sda1 efi 209 MB /dev/sda2 hfs+ 125441 MB /dev/sda3 hfs+ 650 MB free space 124699 MB -
Within the free space, create two new partitions:
- Swap space, equal to the same size as system RAM.
- An Ext4 partition for the root mount point, consuming the remaining space.
- Select the new root partition and continue the installation.
- Time Zone: Los Angeles
- Keyboard Layout: English (US) - English (Macintosh)
- Who Are You? Re-use your existing username and computer name.
- Reboot and choose Ubuntu installation from rEFInd menu.
-
Configure Ubuntu Environment.
-
Start a Terminal
- Ubuntu Search > Terminal
- Right-click Launcher Icon > Lock to Launcher
-
Configure wireless networking.
- Insert USB stick with Ubuntu installation media.
-
Install dkms and bcmwl-kernel-source packages.
cd /media/`whoami`/Ubuntu\ 14.04.1\ LTS\ amd64/ sudo dpgk -i pool/main/d/dkms/dkms_2.2.0.3-1.1ubuntu5_all.deb sudo dpgk -i pool/restricted/b/bcmwl/bcmwl-kernel-source_6.30.223.141+bdcom-0ubuntu2_amd64.deb
-
Create a network manager wakeup script
/etc/pm/sleep.d/99_wakeup
and make it executable. This will restore wireless networking when resuming from suspend. Bugs 1299282 and 1289884 are tracking this issue.1 2 3 4 5 6 7 8 9
#!/bin/bash case "$1" in thaw|resume) nmcli nm sleep false ;; esac exit $?
-
Install binary drivers for Intel Iris Pro Graphics 5200.
- Download the 64-bit Ubuntu installer
from https://01.org/linuxgraphics/
sudo dpkg -i intel-linux-graphics-installer_1.0.7-0intel1_amd64.deb sudo apt-get install -f
- Download the 64-bit Ubuntu installer
from https://01.org/linuxgraphics/
-
Disable suspend when closing the lid.
sudo vi /etc/systemd/logind.conf HandleLidSwitch=ignore sudo restart systemd-logind
-
Configure mouse behavior.
- System Settings > Mouse and Touchpad
- Check: Natural Scrolling
- Uncheck: Disable while typing
- Uncheck: Tap to click
-
Disable turning the screen off.
- System Settings > Brightness & Lock
- Turn Screen Off When Inactive For: Never
- Lock Screen After: 10 minutes
-
Add a screensaver. The default gnome-screensaver is just a black screen.
sudo apt-get remove gnome-screensaver sudo apt-get install xscreensaver xscreensaver-data-extra xscreensaver-gl-extra
-
-
Install Applications
-
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections sudo apt-get install oracle-java7-installer echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections sudo apt-get install oracle-java8-installer # switching versions sudo update-java-alternatives -s java-7-oracle sudo update-java-alternatives -s java-8-oracle sudo apt-get install oracle-java8-set-default
-
- As of version 35, Chrome no longer supports the NPAPI plugin, which is required by the Oracle and OpenJDK Java plugins. If you need to run a Java plugin from a web browser, use Firefox instead.
-
-
Test Java version.
-
Test WiFi speed.
- Download large files.
curl -O http://releases.ubuntu.com/14.10/ubuntu-14.10-desktop-amd64.iso curl -O http://www.wswd.net/testdownloadfiles/1GB.zip
- Download large files.
Uninstalling¶
-
Reboot into OSX.
-
Uninstall rEFInd.
diskutil list diskutil mount disk0s1 sudo su - cd /Volumes/EFI rm -rf BOOT ubuntu
-
Download GParted Live and install it on a USB stick.
hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/gparted.iso diskutil list # find usb disk diskutil unmountDisk /dev/diskN sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m diskutil eject /dev/diskN
-
Reboot and hold down the option key.
- Remove the Linux partitions.
-
Reboot into Mac OSX and extend the partition.
-
Covert the CoreStorage volume back into HFS+.
diskutil cs list diskutil coreStorage revert $VOLUME_UUID
-
Reboot.
- Delete the recovery partition.
- Extend the primary partition.
- Recreate the recovery partition.
-
Convert the HFS+ volume back to CoreStorage.
diskutil cs convert "Macintosh HD"
-
Reboot.
-