How to install Ubuntu Linux on Mac OS X

Ubuntu is a computer operating system based on the Debian Linux distribution and distributed as free and open source software, using its own desktop environment. It is named after the Southern African philosophy of ubuntu ("humanity towards others"). Ubuntu is designed primarily for use on personal computers, although a server edition also exists. There are other distribution of Linux like Fedora, Mandriva, Open SUSE, Cent OS, etc. but Ubuntu stands out among them because of its graphical user interface and its free to use.




The following article explains how to dual-boot Ubuntu and Mac OS X on an Intel Mac.



Dual-Boot: Mac OSX and Ubuntu


OSX.png Linux.png

Quick steps


  1. Install rEFIt and make sure it is working (you should get a boot chooser on startup)
  2. Use Bootcamp or Disk Utility to create a partition at the end of the disc. Don’t worry about what format, just make it the size you want for Ubuntu and your swap partition. If you you are using OS X Lion which comes with Bootcamp 4.0 you will need to use the Disk Utility. Boot Camp 4.0 will only allow you to resize to install Windows 7.
  3. Boot the Ubuntu desktop CD, and select "Try Ubuntu. Start the partition editor (gparted) under System > Adminstration. Use gparted to delete the partition you just made in OS X. It should be the last partition on the disc and follows after the HFS+ partition (OS X). Deleting it will leave an area called unallocated. This is free space, and exactly what you want. Use gparted to manually partition the space on your drive for Ubuntu. First create a SWAP area of about 1GB. Then the rest of the unallocated area format as EXT4. Apply changes and take note the label of the EXT4 partition such as /dev/sda3.
  4. Start the Ubuntu Installer from the desktop icon. When prompted, choose to manually partition. Select the EXT4 partition and click change. Select to use the space as EXT4 and root (/) as the mount point. You will also want to check the box to format the partition.
  5. Reboot when done with the install, and in the rEFIt menu, choose the partition tool. It will attempt to sync the partition tables on your disk. Then SHUTDOWN the computer (not reboot), and start it again. You should be able to boot to Ubuntu now. If it seems to freeze on the tux logo, completely shutdown again and try one more time.

Detailed How-To


Installing rEFIt


INSTALL rEFIt! You don’t HAVE to use it once you get Ubuntu up and running, but until then, you will need to install it because You will need it after installing to sync partitions, once you have done that and Ubuntu works, then you can uninstall it. You can even burn a rEFIt CD if you prefer. If you do not see the rEFIt boot menu when starting your Mac on the second reboot (It takes two reboots to apear after using the package installer), it is not installed properly!

Partitioning


The first thing we need to do is repartition your Mac’s hard drive. Of course, we would like to do this non-destructively (without wiping out the partition you have already). With Leopard and later versions of Mac OS X, this is quite easy as Apple has provided a nifty little tool that will shrink your OSX partition and create a Windows partition in the freed space (which we can convert to Linux partitions later). BootCamp is probably the easiest way to accomplish what you need. After partitioning with BootCamp, it will ask if you want to install Windows now or later, choose Later.
bootcamp-300x230.png
Mac's OS X DiskUtility can also shrink the OS X partition and add partitions in a single step. It cannot create Linux format partitions though, so if you choose this route, you should create “free space” or an “MS-DOS(FAT)” format partition, which can be modified later.
diskutility-300x263.png
At this point, we are really just allocating the space you want for Ubuntu. The actual Linux partitions will be created later during the installation.
For pre-Leopard OS X, there are no such tools. BootCamp does not run, and DiskUtility will only allow you to create more partitions if you wipe out all the current partitions. However, the underlying commandline utility still exists.
Here's a usage example. Let’s say you want to resize your OS X partition to 200GB and leave the rest of the disk free (for Ubuntu of course). You would open a terminal and type the following, followed by the "Return" key.
sudo diskutil resizeVolume disk0s2 200G

You can read more on diskutil by typing 'diskutil help' in your OS X terminal.

The Ubuntu LiveCD


You can download the Ubuntu Desktop Edition ISO from ubuntu.com/download. (You can choose 32-bit or 64-bit, the choice is yours. If you want to see the pros and cons, you can check read this.)
NOTE: Core Duo machines (early Mactels) are 32-bit only! Core 2 Duo machines can use 32-bit or 64-bit ISOs.
An ISO is an “image” of a CD-ROM. You do not burn an ISO onto a CD like you do with pictures or music. Instead, you burn the image onto a disc. It's kind of like mixing Cool-Aid. You don't just drop the packet (ISO) into the water (disc), you must open the packet and dump the contents into the water.
ISO images can be burned with Apple's Disk Utility or other burning apps. You should burn the CD as slow as you can to increase its “bootableness”.

Boot your Mac from the CD


Put the Ubuntu LiveCD in your Mac and reboot.
When the rEFIt menu comes up You should get the option to boot from the Ubuntu CD. If you do not see this option, try pressing the Option key while booting your computer. On a Mac, the "c" key will instruct the Mac to attempt booting off of a CD/DVD.
On the Ubuntu CD’s boot menu, select your keyboard language, then choose to "Try Ubuntu". This will start a LiveCD Ubuntu session, which make no changes to your Mac.
Booting into Ubuntu this way takes many minutes, including a minutes-long period where Ubuntu appears to have locked up on the boot menu. Most likely it has not. Just wait! note I had to set the boot option to nomodeset. If you press function f6 at the boot options screen you can choose that option. Note 2: I had to press function f6 when I saw a man and keyboard.
Once booted, you have a Ubuntu desktop. Start gparted (partitioning tool) by navigating to System > Adminstration > Partition Editor.
If you previously created an “ms-dos” style partition using Boot Camp, you should use gparted to delete this partition. It will be located after an EFI partition (hidden in OSX) and an HFS+ partition (HFS+ is OS X's filesystem). Deleting the new partition leaves “free space” on the disk for the Ubuntu install. Use gparted to manually partition the space on your drive for Ubuntu. First create a SWAP area of about 1GB. Then the rest of the unallocated area format as EXT4. Apply changes and take note the label of the EXT4 partition such as /dev/sda3.

Start Installing


Back on the Ubuntu LiveCD desktop, start the Ubuntu Installer from the desktop icon. When prompted, choose to manually partition. Select the EXT4 partition and click change. Select to use the space as the EXT4 filesystem and root (/) as the mount point. You will also want to check the box to format the partition. On the last dialog of the installer, be sure to click the “Advanced” button and choose to install the boot loader (grub) to your root Ubuntu partition, for example /dev/sda3. This will be the only partition with the EXT4 file system.
When the installer is finished, reboot.
step7.png

Fix the Partition Tables


There is a bug in the installer that causes a problem on Macs. FIXME: Describe problem? It can be fixed with rEFIt.
Reboot to the rEFIt menu and select the “partition tool”. rEFIt will ask if you would like to sync your partition tables. Say Yes and let it do it’s magic. (If you don't have an English keyboard, note that the keys "Z" and "Y" are swapped in the partition tool.) If you see the error "GPT partition of type 'Unknown' found, will not touch this disk" instead of the 'yes' prompt, follow the instructions in comment #6 of this threadand make sure to install gptsync_0.13-10 or higher.
  • rEFIt may not offer to sync your partition tables, but just show the error and leave no option but a return to the main menu. For suggestions on other ways to fix the table, see the discussion at Ubuntu on MacBookPro - difficulties w partition tables.
  • if you have errors such as "GPT partition of type 'Unknown' found, will not touch this disk." or "analysis inconclusive" as explained in this thread, then you have to use gdisk to rebuild the partition table. This is best explained in this post - boot a live Ubuntu CD (the instructions say this is also possible from an OS X terminal), install and run the gdisk tool as the instructions say.
After it is done, SHUTDOWN your Mac (not reboot) and startup again. You should now be able to boot into Ubuntu. If you select the Linux Icon in rEFIt, and it freezes on the grey Tux logo, shutdown again and try one more time.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Recent Post