Setting up a Macbook to dual boot into Ubuntu and OS X

September 14, 2010

Recently I switched from using OS X on my development laptop (a macbook pro) to Ubuntu.

I set up my laptop to dual boot into Ubuntu or OS X. So far I’ve been using Ubuntu full time for a few weeks and am happy with the results.

Here’s the basic process I followed to get set up to dual boot, and get the basics up and running in Ubuntu. Keep in mind YMMV.

Backup

Make a backup of your system. This wasn’t necessary in my case (in hindsight), but the experts will tell you that having a backup is a great way to CYA. SuperDuper is a handy OS X utility that will make a bootable backup of your entire hard drive. Definitely do this before moving forward.

Partition your hard disk

I opened Disk Utility (in the Applications > Utilities folder) and partitioned my main hard disk partion into two equal parts. In my case I have a 500Gb HD and was using less than half of it, so it wasn’t necessary to clear up any space. I was able to do this successfully without data loss.

Download Ubuntu

I downloaded the 64 bit version of Ubuntu 10.04 from ubuntu.com, and burned this to a CD using Disk Utility. It may save you some headaches down the line to install the 32 bit version, but I wanted 64 bit.

Install Ubuntu

Restart your macbook with the Ubuntu install disk in the CD drive. Hold the ALT key as you restart, and choose to boot from the “Windows” CD. Follow the prompts to intall Ubuntu.

When asked about disk partitions choose to specify partions manually. I choose to install the boot partition on /dev/sda3 (the partition I just created.), and chose to use /dev/sda4 for swap. Be careful here not to install over your OS X partition (possibly /dev/sda2), and hose your OS X system.

Enter a username and password, and complete the installation process.

Booting into Ubuntu

Once Ubuntu is installed you can boot into it by restarting, holding the ALT key, and choosing to boot into “Windows”.

Getting things set up nicely

Once you’re in Ubuntu you’ll want to set up wireless networking and several other things. You can figure out which specific macbook you have by running:

sudo dmidecode -s system-product-name

In my case I own a MacBookPro5,3. Each macbook/Ubuntu version combo has its own wiki, which is very valuable at this stage. For example https://help.ubuntu.com/community/MacBookPro5-3/Karmic

Getting wireless networking to work

Connect to the internet using an ethernet cable and run:

sudo apt-get bcmwl-kernel-source

Restart, and bam, you’re wireless.

Touchpad

In the gnome main menu System > Preferences > Mouse > Touchpad.

Sound

Just turn up the volume. This took a minute to figure out.

Accessing your OS X partition and data

You can mount your OS X partion and access the data on it from Ubuntu.

First edit /etc/fstab and add a line similar to this:

/dev/sda2   /mnt/macHD      auto    defaults        0       1

Make sure that you select the right device (/dev/sdaxxx) that contains your OS X installation, and the the mount point (/mnt/macHD) is an existing directory.

Then run:

sudo mount -t auto /dev/sda2 /mnt/macHD

You should be able to access your OS X data from the /mnt/macHD directory.