How to set up Ubuntu Linux on a Mac -- it's easy and free
I received a private tweet from a reader the other day, who asked a question about a previous post in which I had installed Windows 7 RC1 on a Mac using Sun's VirtualBox. The tweet asked, "You did a post about installing Win 7 on the Mac for free. How about Linux?," which set up a challenge. Not only can you install Linux distributions on a Mac using VirtualBox, but it's extremely easy to do.
Why would you want to run Linux on a Mac? There are probably a few good reasons -- learning about a different OS, using software that's not available on the Mac platform, or for a Linux class in school. While you can create a bootable partition on your Mac and boot Linux from it, I prefer to do things the lazy way. In this short how-to post, I'll demonstrate how I installed Ubuntu Linux 9.04, also known as "Jaunty Jackalope."
Step 1: Download and install VirtualBox
To get a free copy of Sun's excellent VirtualBox VM environment, point your browser to http://www.virtualbox.org/wiki/Downloads. Choose the link for Intel Macs (sorry, it doesn't run on those old PowerPC Macs), and click the download link. When the download is done, mount the disk image and follow the simple installation instructions. You'll end up with a VirtualBox icon in your Applications folder.
Step 2: Download the Ubuntu ISO
Visit http://www.ubuntu.com/getubuntu/download. The download page should recognize that you're browsing from a Mac and offer the Intel Mac ISO image. Choose a download host close to your geographical location from the pop-up menu, then click the Begin Download button to start transferring the file to your Mac. Choose to Save the ISO file rather than Open or mount it.
Be sure to remember where you saved the ISO file, as you'll need it shortly.
Step 3: Launch VirtualBox
From your Applications folder or Dock, launch VirtualBox. If you haven't launched it before, you'll be asked to register the application. In the other window that appears, you'll see something similar to this:
No virtual machines are visible, since you haven't created any yet. We'll do that next.
Step 4: Create a new virtual machine
See that New button in the screenshot above? Click on it. What's going to appear is the New Virtual Machine Wizard. When it appears, click the Next button and this dialog appears:
Here's where we're going to tell VirtualBox that we want to create a new Ubuntu Linux virtual machine. Type a name for your virtual machine in the Name box, then select the Operating System (Linux) and Version (Ubuntu) from the pop-up menus. Note that you can choose from a variety of Ubuntu distributions, including Debian, OpenSUSE, Red Hat, or even "Other," so if you prefer or need to run another distro, you probably can. For the purposes of this example, I chose 32-bit Ubuntu (my next experiment will be to try 64-bit).
When you've chosen the OS and Version, click Next.
Step 5: Select the base memory for the virtual machine
You need to set a base amount of memory that can be used by the virtual machine (see below). I selected the recommended base amount of 384 MB, then clicked the Next button.
Step 6: Create a new hard disk
Don't worry, you're not really creating a new physical hard disk; like the Linux machine you're creating, it's virtual. This hard disk will take up space on your physical drive, so make sure that you have enough free space to create the hard disk and still have enough capacity to continue to store your documents. You can save the virtual disk on an external disk drive if you want to. To start the process of creating the new virtual disk, take the default settings that are listed on the dialog below:
Clicking the Next button brings up another wizard; the Create New Virtual Disk Wizard. Click Next again, and the following dialog appears:
To make things easy and also take up the least amount of space on your physical hard disk, select Dynamically expanding storage as the type. With this setting, the virtual hard disk will gradually take up more space on your physical disk as needed. Click Next. On the following dialog, you can choose the location and size of the virtual hard drive. The maximum size is 2 TB, perfect if you have a Drobo! For most of us, though, choosing the recommended amount of 8 GB is probably enough. Remember, though -- your virtual hard disk can only grow as large as the amount you select on this dialog:
After selecting the maximum amount of hard drive space you want, click Next, and then click Finish on the final screen to build your virtual hard disk. At this point, you're almost done. On the summary display that appears (see below), check the settings and then click Finish if you're ready to build your virtual Ubuntu Linux machine.
Once you've clicked the Finish button, you've set up the framework in which your virtual machine is going to live. You still need to load Ubuntu Linux.
Step 7 -- Preparing to load Linux
VirtualBox now shows that you have one virtual machine called Ubuntu Linux. It's currently "powered off," but we'll change that soon. You want to make sure that you have your Ubuntu Linux DVD image ready to load. That's the Ubuntu ISO image we saved earlier.
See where it says CD/DVD-ROM? Click on those letters and the following screen appears:
Check the Mount CD/DVD Drive, then click the ISO Image File radio button. At the present time, Ubuntu Linux doesn't know about that ISO disk image file that you downloaded earlier, so you'll need to click the folder icon to the right of where it says <no media>. That opens another dialog -- simply drag and drop your ISO file onto it an click the Select button. Now the dialog that you see in the screenshot above will show that you're telling VirtualBox to mount a DVD disk containing an ISO image file called ubuntu-9.04-desktop-i386.iso. Click the OK button.
Step 8 -- Loading Linux
At this point you're ready to rock and roll. You should be back at the VirtualBox list of virtual machines, with Ubuntu Linux on the launchpad ready to go:
And you're go for launch! Click the Start button. VirtualBox will start a new session, and a black screen appears. You should see a message telling you about how that session is going to capture your mouse movements and keyboard strokes:
What this is telling you is that when you click in the virtual machine window, all of your keystrokes and mouse clicks are going to be directed to the virtual machine, not your Mac. To control your Mac again, you just need to press the Command key to the left of your space bar.
Once you click OK, VirtualBox is going to run Ubuntu off of the virtual DVD. It looks something like this:
When you get to the Ubuntu screen, double-click the Install icon. The installer will ask you a few questions, such as the language you want Ubuntu to display (including Esperanto...), your location, and the type of keyboard you're using. Enter the appropriate answer, and then click Forward to move to the next installer screen. The fourth screen looks like this:
The installer wants to know where you want to put Ubuntu 9.04. The default values, shown above, should be perfect. You want to use the entire virtual drive that you created earlier. Click the Forward button. The next screen asks the musical question "Who Are You?"
Enter in your personal information, including your name, a password (twice), and a name for the virtual machine. Make the choice whether you want to type a password to log in, or just have Ubuntu log in automatically, and then click the Forward button. The next screen you see is a summary of all you have just set up. Click the Install button, and the actual Ubuntu installation process takes place.
Step 9 -- Update Ubuntu
Once the installation is completed, you'll either be asked to log in with your password, or if you set the installer to log you in automatically, you'll be at the Ubuntu Linux desktop. Since your network connection is already set up, the next thing that will happen is that Ubuntu will check for updates. This is the Ubuntu equivalent of the Software Update in Mac OS X.
By default, Ubuntu wants to download and install all software updates made since the distribution was first shipped. It is recommended to simply click the Install Updates button, which will download and install those updates for you. On my first-generation MacBook Air, this took about a half-hour and required a restart of the virtual machine at completion.
Step 10 -- Play!
Once the updates are done, it's time to play with your Ubuntu virtual machine. The user interface is somewhat different from that of Mac OS X, so you'll have to get used to it. You can read Ubuntu's built-in help files by clicking on the question mark icon in the menu bar.
While I will leave the task of learning Ubuntu Linux up to you, one thing I will point out is the Add/Remove Software item under the Applications menu. This is your portal to a large library of software, all of which you can download with a click or two. Think of this as the "App Store" for Linux.
You also have a full office suite installed on your virtual Linux machine. The word processor, spreadsheet, and presentation applications of OpenOffice are all pre-installed with Ubuntu, along with calendar and email functions.
While your Ubuntu Linux virtual machine won't replace your Mac or the applications on it, you can certainly learn a lot more about the Linux world and about virtual machines for free through this tutorial. Have fun!