Reprocessed, by Matt Patterson

Something approaching a weblog

Getting Ubuntu Server (10.04) working on an intel Mac Mini

Getting Ubuntu's Server edition running directly on a Mac Mini proved to be a bit of a pain, with lots of partial instructions, but with lots of important bits missed out or glossed over. And lots of stuff about the Desktop edition, which has a completely different installer.

The reason it's not yet straightforward is that Apple's intel-based kit uses EFI, rather than the older BIOS based methods. The standard GRUB and LILO bootloaders don't yet know how to deal with EFI. Grub 2, in development, will do that, but until it's released and stable we have a problem. Bizarrely, the most aggravating problem I had was when it looked like I'd bricked the machine, but it turned out the keyboard I was using was too new.

There are three basic steps:

  1. Partition
  2. Sort out the bootloader issue
  3. Install (includes more partitioning)

Actually, 1 and 2 are quite closely linked. My first thought was that I could just wipe the disk and install Ubuntu, but the bootloader problem means that really you need to keep a Mac OS X install hanging around. The solution to the bootloader problem is to use rEFIt which provides an EFI bootloader which can hand off to another bootloader, either Apple's or Ubuntu's. You install it on your Mac OS X partition. As several people have pointed out, keeping an OS X installation around means you can continue to apply firmware updates.

A digression about keyboards

I tried to get into Apple's startup manager loader thingy (hold down option on the keyboard after the power-on bong) on the Mini, a Core Duo from 2006 or 2007, and nothing happened. I tried to boot off the CD, (hold down C on the keyboard after the power-on bong). I was trying to do this because I had used the Startup Disk preference panel to boot off the Ubuntu CD, and the installer seemed like it was hanging at the first screen. I couldn't boot into OS X, and it wouldn't boot off the OS X DVD. In a panic, I took it off the genius bar. They couldn't get it to do anything, until they tried an older keyboard. Then it was fine. By the look of things, the problem is that USB is (OS) software, and before you've booted is firmware. The older firmware didn't know how to make the newer apple keyboard work, I assume because it has different special keys and such. Fortunately I had a correct-era keyboard in the office. I guess the lesson is to make sure you always have a keyboard dating back to your oldest bit of hardware. I'd be interested to know if a bog-standard generic PC USB keyboard would have worked...

End of digression.

Partition

So, you need to keep your Mac OS X partition around. If, like me, you're wiping the computer then you can boot off the installer DVD, make a small HFS+ partiton for OS X, and leave the rest of the disc as free space. You'll need 12-15GB for Snow Leopard.

If you want to keep your existing OS X install then you can use the Bootcamp Assistant (in 10.4+), or plain old Disk Utility (definitely in 10.6, maybe in 10.5) to resize your existing HFS+ partition.

Bootloader

rEFIt is the thing to use. Download it from sourceforge, and install it on the Mini. It installs its stuff in the folder /efi, which you shouldn't delete. I needed to enable it manually, which you can do from Terminal.

cd /efi/refit
./enable-always.sh

I used enable-always.sh because I want the machine to always boot into Linux.

Reboot to check that it works. If it does, you'll see rEFIt's loader screen. If you do, you're done with this bit.

Install

Download and burn the Ubuntu server ISO. Make sure you get the right architecture - the server version defaults to 64-bit, while the desktop version still defaults to 32-bit.

Insert the disc, reboot, and you should see the CD-with-penguin icon in rEFIt. Boot off the installer. Do your partitioning, making sure to leave the HFS+ and the sooper-sekrit EFI partitions well alone. Make a note of which partition you will be installing Ubuntu on, in /dev/sdXN form (i.e. /dev/sda3). You will need it later and there is no way to find out what the correct form is at the point you have to type it in.

Install Ubuntu, and at the install-GRUB step enter /dev/sda3 (or whatever the correct place is). Once it's done that it should eject the install CD and you can then reboot. You'll have to select Linux from the rEFIt screen, and it should boot.

Always booting Linux

rEFIt has a configuration file which allows you to select, more or less, which operating system will automatically boot. It's in /efi/refit/refit.conf on the Mac OS X partition, so boot into OS X and edit it.

At the end there's a couple of sections about boot choice:

# List legacy options first. When enabled, legacy BIOS based boot options
# (e.g. Windows, Linux via LILO or GRUB) will be listed first. This is
# intended as a quick fix to change the default boot choice until full
# configurability arrives.
#
#legacyfirst

# Set the default menu selection.  The available arguments match the
# keyboard accelerators available within rEFIt.  You may select the default
# loader using a one-character abbreviation for the OS name ("M" = Mac OS X,
# "L" = Linux, "W" = Windows).  You may also specify a digit between 1 and
# 9, in which case the Nth loader in the menu will be the default.  You can
# also select a rEFIt tool entry ("S" = EFI Shell, "P" = Partitioning Tool,
# "U" = shutdown).  This is intended as a quick fix to change the default
# boot choice until full configurability arrives.
#
#default_selection L

I uncommented default_selection L and that seems to work fine for me. I imagine YMMV.

Acknowledgements

The basic outline for this came from Victor Costan's post about installing the Desktop edition, plus assorted reading of the Ubuntu wiki and rEFIt documentation. Thanks for the info.

Not forgetting:

This page is: