Dual booting elementary OS luna and OS X

Everything has been tested on a Mac Mini 5,2. Your mac may have slightly different hardware and may require a different video or wifi driver. If you have any problems or questions please comment or ask in the forums.

Want try out elementary but aren’t sure you want to give up OS X completely? Maybe you have some OS specific applications or a device that’s easier to sync on a mac. You don’t have to get rid of OS X to run luna. One way to use both is to dual boot OS X and luna. You can have both operating systems installed and choose which to boot when you turn on your computer.

Prerequisite :

1. A Mac with some spare hard drive space.
2. A wired keyboard and mouse
3. Wireless drivers or Ethernet connection
4. USB installer

Step 1 – Shrinking OSX

OS X makes dedicating hard drive space to luna easy. If you’re going to install luna then you’re going to need to give it some hard drive space. How much is up to you. You could go as low as 10-20gb or give it a couple hundred gigs. More space is always better, but we’re dual booting here. You have to leave some space for OS X too. Just think about what you want to do on each system. If you’re going to be ripping a bunch of Blu-rays on luna then you definitely want to give it a hundred gigs or more.

1. In Finder go to Applications/Utilities and open Disk Utilities.

2. The mac’s hard drive is probably named Macintosh HD or OSX, and it will have two listings. The top listing is for the hard drive, and the second is for the OS X partition on the hard drive. Our task is to shrink the OS X partition in order to create free space for luna.

3. Click on the listing for your hard drive, not the partition.

4. Now choose the partition tab. You’ll get a big white box representing your partitions.

5. You can grab the lower right corner and drag up to choose a new size for your OS X partition and create free space. Disk Utility gives you the option to format the free space. Don’t do it. The luna install will take care of that for you. Just size down your OS X partition and click apply. You shouldn’t lose any data, but it is always a good idea to backup the important stuff before messing with your partitions.

 Step 2 – Installing rEFInd.

refind

Mac’s come with a built in startup manager. Hold down the option key while booting and a screen comes up letting you choose which OS to boot. It works but it’s a bit slow, and if you don’t hold down option it defaults to an OS X boot. If you want to default luna then a boot manager is a must. Even if you think you’ll be using OS X more than luna, a boot manager just makes things easier.

The best boot manager made for macs is rEFInd. Its a fork of rEFIt, an older mac boot manager project. If you’ve been googling about dual booting OS X and Linux then you’ve probably come across rEFIt. Don’t install it. It’s no longer maintained and isn’t compatible with recent versions of OS X.

1. Download the latest version of rEFInd, currently 0.8.3, and extract the zip file in you Downloads folder

2. Open terminal via Applications/Utilities in Finder or search for terminal in spotlight.

2. Run the following commands, one at a time, in terminal.

cd Downloads/refind-bin-0.8.3/
./install.sh

*The install script will ask for the administrative password.

Step 3 – Make a luna USB Drive

Now that you have a rEFInd installed its time to make a bootable USB stick. I first attempted this with unetbootid. It worked on one, older mac, but on most macs it just loaded a black screen with the words “Boot error”. I spent a long time trying to figure out if this was a graphics card issue or what, but nothing worked.

I was reluctant to just make a new USB stick because it did work on some computers, but eventually I decided it was worth a shot. I made a new stick following ubuntu’s directions on making a boot stick from a Mac. The resulting boot stick has worked on every Mac I’ve tried.

If you’re on a newer mac unetbootid will probably not work. Save yourself some time and just use the terminal method.

Check out How Create a bootable USB stick on OS X for more information, but the basic rundown is easy.

1. Download luna from the elementary website. Get the amd64 bit version.

2. Go back to terminal and run:

hdiutil convert -format UDRW -o ~/Downloads/luna.img ~/Downloads/elementaryos-stable-amd64.20130810.iso

*If file isn’t found check to see if the downloaded iso has a different name.

3. Check your Downloads folder in Finder. If you have luna.img.dmg rename it to luna.img

4. In terminal run:

diskutil list

5. Insert your USB stick and run diskutil list again. There will be a new /dev/disk that wasn’t listed the first time. The new one is your usb stick.

disklist

6. Run the following commands, one at a time, in terminal, and replace each N with the number for your USB drive. Enter administrative password when prompted.

diskutil unmountDisk /dev/diskN
sudo dd if=~/Downloads/luna.img of=/dev/rdiskN bs=1m
diskutil eject /dev/diskN

7. Reboot

Step 4 – Installing luna Alongside OS X

On the next reboot rEFInd will come up with two options, OS X and what it calls Legacy OS or Windows.  The Legacy OS/Windows option is your luna USB stick. Once luna is installed rEFInd will recognize it as Linux, but now it just recognizes it as an OS using BIOS boot method. Use your keyboard to select the Legacy OS and hit enter to start luna.

refind_usb

Once luna has booted it will give the option to “Try elementary OS” or “Install elementary OS”. Click on the install button.

install_screen

The installer will check to see if enough hard drive space is available and if there is a working internet connection. This screen also gives you the option to install some updates and 3rd party codecs.

internet_screen

The next screen, the installation type screen, is important. Make sure you’re installing alongside OS X. This will tell luna to format and use the free space created earlier. It will also tell luna to leave the OS X partition alone.

install_alongside

Next it will ask to confirm your keyboard layout and time zone and to create a user. This is pretty straightforward. The only thing to note is that if you are using a Magic Trackpad and want to use multi-finger gestures then you shouldn’t set the user to login automatically. Make sure it is set to “Require my password to login”.

username

The install may take a while. When its done a popup screen will ask you to restart the computer. Go ahead and restart and remove the USB stick when prompted. To boot into luna choose the penguin in rEFInd.

refind_linux

Step 5 – WIFI & Update

It’s likely that wifi won’t work out of the box. Click on the network indicator to check. If you’re wifi is enabled you’ll see available networks. If it isn’t enabled then it’ll look like the screenshot below, and you’ll need to activate the driver.

wifi

For nearly a decade Apple has opted for Broadcom wireless cards. These work well under Linux but most require a proprietary driver. Enabling the driver is simple if you’re connected to the internet.

1. Open System Settings

2. Click on Additional Drivers

3. Once it launches and scans for available driver you will be able to activate a Broadcom driver.

wifi2

If you’re not connected to the internet, or if the default driver doesn’t work, see ubuntu’s documentation on Broadcom drivers. The documentation will help identify which driver you need and explains how to install it while offline.

Updating

Even if you selected install updates while installing luna, there will be more updates available.

1. Click on “Applications” in wing-panel and open Software Updater.

update1

2. Click “Check” to check for new updates.

update_install

3. Install updates and reboot.

Step 6 – Bluetooth Keyboard and Mouse/Trackpad

To pair bluetooth devices on luna use the same method you used on OS X. Click on the bluetooth indicator, select your devices and enter the pair code. On your keyboard just type in whatever code is displayed on the screen. The code for a mouse or trackpad is 0000. Alternatively you can click on the bluetooth indicator and choose set up new device.

bluetooth

There is an issue with bluetooth and dual booting. Once you’ve paired your devices in luna they will no longer work under OS X. You can re-pair them in OS X but then they will not work under luna. Officially the devices work on one system or the other but not both. Thankfully there is a fix. All you need to do is copy the pair codes from OS X to luna.

1. Pairing the keyboard/mouse/trackpad in luna.

2. Reboot to OS X and re-pair all the devices in OS X.

3. Reboot back into luna but don’t pair bluetooth devices. Use a wired keyboard and mouse.

Instead of pairing we’ll copy the pair keys from OS X. If both OS X and luna use the same keys then the devices will work on both systems.

4. In Files mount your OS X drive. When loaded an eject button appears next to the drive.

load_osx

My drive is named OS X so it will mount to “/media/OS X/”. Note that in the terminal all spaces in a path should be preceded with a “”.

5. Go to your home folder in Files, right-click and choose create new file > create an empty file. Name it “bt.sh” and open it in scratch. Paste in the script bellow.

#!/bin/sh
cd /var/lib/bluetooth
for i in *; do
cd "$i"
plutil -i /media/OS X/private/var/root/Library/Preferences/blued.plist -o /dev/stdout |
perl -0777 -MMIME::Base64 -ne 's|s||g; $s = $_; while ($s =~ m|(..-..-..-..-..-..)(.*?)|g) { $mac = uc($1); $key = uc(unpack("H*",reverse decode_base64($2))); $mac =~ s/-/:/g; $pinlength = 6; $pinlength = 4 if $mac eq "C4:2C:03:A0:C7:20"; print "$mac $key 0 $pinlengthn"; }' |
tee linkkeys
cd ..
done
service bluetooth restart

6. Replace “OS X” with the name of your OS X drive. For example if your drive is named Macintosh HD your line should read

plutil -i /media/Macintosh HD/private/var/root/Library/Preferences/blued.plist -o /dev/stdout |

7. Close bt.sh and execute the following commands in terminal, one at a time.

sudo apt-get install libplist-utils
cd ~/
chmod +x bt.sh
sudo ./bt.sh

Now the devices should be working on luna and will still work on OS X, and you can delete bt.sh. The only issue left is the keyboard only works in rEFInd on a reboot from OS X. The keyboard probably won’t work when rebooting from luna. It is a known bug, but it is unclear if the bug is in rEFInd or in the linux bluetooth stack. I’m not hopeful for a quick fix. This is a pain as it means keeping a wired keyboard hooked up for booting or to set OS X as the default boot choice and rebooting from OS X to get back to luna.

Trackpad Tuning

The Magic Trackpad is a bit capricious on Linux. Sometimes it works great right out of the box while other times the slightest touch on the trackpad sends the cursor jumping all over the place or the cursor will move so slowly it is almost useless. If it’s not working well try adjusting it in the System Settings.

1. Open System Settings from the Plank at the bottom of the screen.

2. Click on “Mouse and Trackpad”.

3. Click on the Trackpad tab.

4. Adjust sensitivity and speed.

mouse_trackpad

If trackpad still isn’t functioning satisfactorily then you may need to configure driver manually. There is a great writeup on this on the useless use of cat website. Its actually about setting up a trackpad on a MacBook Pro, but it does a good job of explaining how to configure a trackpad. Just play with the settings till the trackpad acts how you want it too. If you make things worse you can always just delete the conf file and start again.

For a more detailed explanation of Synaptics Touchpad options check out the entry in Arch Wiki.

For information on how to enable multitouch gestures see our guide on using xSwipe. 

Keyboard Tuning

The keyboard shouldn’t need any actual tuning, but you may want to change some shortcuts. If you use OS X a lot then you’re probably used to closing applications with super+q instead of alt+f4. If you’re like me then you’ll just absentmindedly use the keyboard shortcuts you’re use to, so it’s nice to have them work the same on OS X and luna.

1. Open System Settings

2. Choose Keyboards

3. Click on the shortcut for “close” then hit “super+q”.  That will be your new shortcut for closing apps.

4. Change other shortcuts to your preference.*Note that on an apple keyboard the super button is the command key.

keyboard_settings

Step 7 – Install Additional Drivers

Additional drivers may be available for your system. I’d suggest sticking to the open source, default drivers unless there is a reason to change. For example, on a Mac Mini 5,2 with Radeon HD 6630M the opensource drivers work great for everything but 3d effects. If you’re planning to install steam and play a lot of games then you want to activate the experimental driver. If you don’t care about 3d graphics then stay with the open source driver. It’s more stable.

1. Open System Settings

2. Choose Additional Drivers

3. Select the driver you’d like to use and click activate.

4. Reboot

wifi2

Troubleshooting

Your system should be working now, and you may want to check out our article on Things to do after installing elementary OS.

If something went wrong or you need more help just ask in the comments or forum. You may also want to check out ubuntu community pages for macs. There a bit outdated but still have some useful info. In either case it’ll be helpful to know which mac you’re using. To identify your mac run the following in Terminal.

sudo dmidecode -s system-product-name

You can use the resulting name to look up what hardware is in your mac, or to let people in the forums know more about your computer.

Add Comment

Click here to post a comment

Calendar

October 2024
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  

Recent Posts

October 2024
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031