Installing Ubuntu 9.04 on a Mac Mini

Ever since I bought my MacBook Pro a few months ago, my poor ol' Mac Mini has been alone and lonely. I really didn't have much use for it, since I transferred all important work files to my new laptop. So what would I do with it? That's when Ubuntu 9.04 was released. Back when I was in Puerto Rico, I would always get excited when a new release of my favorite Linux distributions (Fedora, Debian, Slackware and Ubuntu) was announced. It had been a while since I gave one of these new releases a test drive. It would also give me a chance to use my Mac Mini as a server, where I can test some new software that I've been wanting to check out for a while.

The Mac Mini seems like a good, cheap alternative for a server if you have one lying around unused. These machines are pretty quiet, consume low amounts of energy and are fast enough for most server tasks. Here were the steps I took to get a fully-functional Ubuntu Server installation on my Mac Mini. As a side-note, my Mac Mini is a Mac Mini Core 2 (1.83 GHz) with 1 GB of RAM and an 80 GB hard drive.

  1. Download the Ubuntu Server disc image and burn it to a CD. I chose downloading via BitTorrent. Also, I downloaded the 64-bit version (torrent filename: ubuntu-9.04-server-amd64.iso.torrent), although the 32-bit version should work just fine. Make sure you seed for a while after you download your disc image!

  2. You will need to partition your Mac Mini hard drive, to create some space for the Ubuntu installation. If your Mac Mini has Mac OS X 10.5 (Leopard), you can use the Boot Camp Assistant to create a partition. Unfortunately, you won't be able to use Boot Camp if your Mac Mini is running Mac OS X 10.4 or an older version. When starting the Boot Camp Assistant, you will be asked to specify the size for your new partition. You'll need at least 10 GB of free space in your hard drive to do this. Depending on how much hard drive space you have available, create a partition. Once completed, the Boot Camp Assistant will ask if you would like to restart to begin installing your new operating system. Don't do this just yet. Quit the Boot Camp Assistant.

Note: I was having problems creating a partition, even though I had plenty of free space on my hard drive. The reason was because my hard drive was apparently too fragmented, and there were some files that couldn't be moved to create the new partition. Since I have a 500 GB external drive and use Time Machine to back everything up, I decided it would be best to just do a clean install of Mac OS X 10.5. Once Leopard was installed, I created the new partition using Boot Camp Assistant without any problems.

  1. Before restarting your Mac Mini, you will need to install a boot manager called rEFIt. rEFIt will help install Ubuntu easily, and makes selecting between Mac OS X and Linux after installation a breeze. To install rEFIt, download the Mac disk image (.dmg) file. Once the image is mounted, install the boot manager by executing the rEFIt.mpkg file. After installation, to make sure the boot manager was properly installed, there should be a directory named /efi in the root directory of your system. Open the Terminal application on your Mac Mini, and execute the following commands to properly install the boot manager (You will be prompted for your password):
cd /efi/refit ./enable-always.sh
  1. After rEFIt is installed, insert the Ubuntu Server CD you created and restart your Mac Mini. When rebooting, you'll immediately notice the rEFIt boot manager screen. This boot manager should recognize the Ubuntu Server CD (marking it with the ubiquitous Linux penguin logo). Select this option, and the Ubuntu installation process should begin.

  2. Installing Ubuntu is beyond the scope of this post, but it's pretty easy to install if you have never done it before. Don't be intimidated by the command-line look of the installation process! Just following the instructions and everything should be installed in no time. There were a few things I had to do differently in my case:

  • When the Ubuntu partitioner starts, it will show all available partitions in the hard drive, including the partition for Mac OS X. You'll recognize the difference between the Mac OS X partition and the one you created using the Boot Camp Assistant by looking at the format of the partition (Mac OS X uses the HFS format, while the one you created is using the FAT32 format). Since I wanted to use a different format for this partition (ext3), I selected the FAT32 partition and deleted it. Once deleted, you'll see 'Free Space' where your partition used to be. Select the free space, and the partitioner should ask if you want to let it create the necessary partitions. This is the easiest way to set up your new partition for Ubuntu.
  • After installing the operating system, the Ubuntu installer will ask where you want to install its boot manager, GRUB. Since we don't want to over-write rEFIt that's install on the drive's Master Boot Record, we need to install the GRUB boot manager in the boot record of the new partition. So where the installer prompts you to write the location where GRUB should be installed, write hd(0,2), which is the location of the new partition (provided you only have the Mac OS X partition and the new Linux partition).
  1. If everything went smoothly, your Mac Mini will eject the CD and reboot. rEFIt will be on display once again, this time letting you choose to boot Mac OS X or Linux. Select Linux, and after all of Ubuntu's processes start, you'll be presented with a prompt. Congratulations, you have Ubuntu 9.04 installed in your Mac Mini!

I'm sure that installing any other Linux distribution will be more or less the same. Keep in mind that since I installed the server edition of Ubuntu (command-line only), I have no idea if video, sound, wireless connectivity (I connected my Mac Mini to my router using a Cat-6 cable) or other things will work properly in a Mac Mini. I'm sure the Ubuntu community (and the Linux community in general) have solved most common issues by now. If I install a different Linux distribution using a GUI, I'll write about it and let everybody know.