A quick, down-and-dirty guide to installing Linux on an iMac

Linux on a Macintosh is a classic feat, and not always an easy one to accomplish. It's full of undocumented behavior and unsupported hardware. For example, linux-m68k doesn't run on any LC series Macintosh, a bug which is mentioned almost nowhere.

That said, if you really want to do it, I won't stand in your way. The distribution which I'll be using for this guide is Debian, which is usually the best supported on the PowerPC. The main alternative is Yellow Dog Linux; however, I have not achieved success with it. I'll stick with Debian for now.

Installation Media

Installation CDs can be made that the Mac will boot and install from; however, they frequently don't work properly, due to the differences in iMac hardware. My preferred method is a hard disk boot and Internet install. If your CD works, then the process is simple: boot from the CD (by holding 'C') and follow the instructions below.

Doing the Hard Disk Tango

Starting with a clean drive is the only way to go, really: If you want to preserve any Mac files, back them up first. Boot from your Mac install CD and use Drive Setup. Don't choose any of the Linux partition schemes that Apple recommends. They're awful, and you want to do this using the Debian installer anyway. Instead, make one Mac partition.

Now, make a choice. If you want to keep a bootable Mac drive on your system, make the Mac drive take up only the space that you don't need for the Linux system. If you plan on keeping only Linux, make it whatever size you want. Either way, it needs to be big enough for the base system (preferably OS 9) and Internet tools.

Getting Ready to Install

iMacs are NewWorld Macs, which means that they are remarkably easy to boot into other systems. What you need to do is establish some boot configuration files. Log on to ftp.debian.org and browse to /debian/dists/stable/main/disks-powerpc/current/powermac. (This address should remain valid, using Debian's dynamic directory structure.) Download the following files to the top level of your hard drive:

  • yaboot
  • yaboot.conf
  • linux.bin
  • images-1.44/root.bin
This is all you need to start the install under normal circumstances. Restart your computer.

As the computer boots (before you even see the grey screen), hold Command-Option-O-F until a white screen appears. This is the Open Firmware prompt, the guts behind your iMac. You need to use it to boot from yaboot, a specially designed Mac script that loads Linux into memory like a normal MacOS.

What you need to type will vary slightly. Assuming that you're still using the original hard disk that shipped with your iMac, you should have to type

boot ultra0:,\yaboot

where ultra0: is the device path to your hard drive. Most of the time it is "ultra0". Sometimes "hd" will work. SCSI drives use "sd". Sometimes you will need a partition number, in the format sd:0, or ultra0:8, or whatever. Try using the "printenv" and "dev / ls" commands to find how the system refers to your hard drive. Or just use trial and error.

If all goes well, the machine will boot to a white-on-black yaboot prompt. Pushing Tab will disable the automatic choice and allow you to look at your options. Type "install". If it doesn't work, try "install-safe".

The Debian installer will load. Congratulations. You're done with the weird part.

The Installation

Follow the instructions. Configure your keyboard. Partition your hard disk. Oh, wait!

Partition your Hard Disk

Debian will actually tell you what I'm about to say, but I'll say it again. If you want to keep your Mac volume, you should NOT initialize your partition table. If you want just Linux, feel free. The command is 'i'.

Add Linux partitions as your preferred partitioning scheme provides. Apple's schemes recommend /home, /var, /opt, and /usr partitions; you can do whatever you want. Leave EVERY Apple partition in its original location if you want to have a Mac drive. Otherwise, don't bother.

Go through the installation. It works pretty much the same way everywhere, assuming you have the network. If not, you'll have to get creative or produce thousands of installation disks. Debian will do all the work for you.

First Boot

Breathe deep. Cross your fingers. The way that the installation treats your hard disk, you won't even see the Happy Mac anyway. It'll boot straight into a black Linux screen. Hopefully. Otherwise, you've got some trouble. Maybe you should start over.

Setting Up X Windows

The iMac cannot be configured properly by XF86Config. If you look on the Internet, you can find a file called XF86Config.imac, which can replace your existing configuration file. You may have to fiddle with it a little bit due to the PCI location of the iMac video card, but for some it works without any modification. Of course, run dselect to install all the needed packages.

Things That Will Cause You Pain

Monitor geometry - So far, I haven't been able to find a way to adjust the NVRAM so that the monitor's geometry can be fixed; mine seems to be a little off in text mode.

Sound - Setting up sound is a whole new node in itself.

Anyway, if everything went well, you're now an awesome Linux/Mac User. Congratulations.