Running Linux on your Mac: 2013 edition
Back about this time of year in 2009, I wrote a post that's remained a venerable favorite. Entitled "How to set up Ubuntu Linux on a Mac -- It's Easy and Free," the post described in full detail how those interested in learning more about one specific Linux distro could install Ubuntu in a virtual machine on their device. This post is an update to the original, with all-new instructions but still using the same framework -- Oracle VM VirtualBox, which is an open source virtualization environment, and Ubuntu Linux.
Why would you want to run Linux on your Mac, which features a Unix-based operating system in itself? Well, you may need to run Linux applications for your job as a system admin, or perhaps there's some specific app that some kind soul has written to run on a variety of Linux distributions but hasn't been ported to OS X yet. Whatever the reason, it's easy to do and you can put it on your resumé.
Step 1: Download VirtualBox
The first thing to do is get the Virtual Machine environment installed. Rather than use either VMware Fusion or Parallels Desktop, we're using the free Oracle VM VirtualBox. Download VirtualBox 4.2.16 for OS X Hosts here, and save it to a convenient spot on your Mac.
Step 2: Install VirtualBox
At this point you have a file with a name like "VirtualBox-4.2.16-86992-OSX.dmg" either in the Downloads folder or on the desktop. Double-click it to mount the installer image and this Finder window appears:
The instructions are right on the box! Double-click the VirtualBox.pkg icon, respond to the various prompts using the default values, and VirtualBox is installed in the Applications folder.
Step 3: Download Ubuntu
Now it's time to get the Linux distro that I used the last time -- Ubuntu. Yes, I know there are plenty of other distros out there to play with and that some are better than others, but for the purpose of this post I'm trying to make this as easy as possible for readers to just experiment. Head on over to this page in your favorite browser, and click on the download button for the Long-Term Support (LTS) edition -- that just means that version will be supported for a longer time. In this case, it was Version 12.04 LTS. By the way, if you have a fairly recent Mac that's running Lion, Mountain Lion, or even Mavericks, go ahead and select the 64-bit version of the operating system.
You'll be asked if you want to make a donation to help development of Ubuntu; that's up to you and you can also just try it for free, then donate later. The download will begin and several minutes later an .iso disk image file is stored on your Mac. This is used as an installation "disk" for Ubuntu.
Step 4: Launch VirtualBox and create a virtual machine
Pop into the Applications folder and launch VirtualBox. A blank "Oracle VM VirtualBox Manager" appears. Click on the New button in the upper left of the window to start creating a new virtual machine. The first window you'll see looks like this:
I typed in a very original name for my virtual machine: Ubuntu. You may call it George if you wish. The type of operating system is Linux, the version in this case is Ubuntu (64 bit). Click Continue. A screen appears asking for the amount of memory you wish to allot to your VM. VirtualBox recommended 512 MB, but I selected 1 GB because hey, RAM's good! Clicking Continue again, you're then asked if you want to add a virtual hard drive to the new machine. Use the default "Create a virtual hard drive now" radio button, and click "Create".
The next screen asks what kind of hard drive file type you would like to use. I chose the default VDI setting, and clicked yet again on Continue. Now you need to select the storage size of the virtual hard drive on your physical drive. Once again, select the default "Dynamically allocated" and click Continue.
VirtualBox needs to know the initial size of the new virtual hard drive and where you want to save it. I suggest using the default 8 GB setting, and default location -- in your user folder (the one with the house icon in Finder). You can select another location if you wish. Click Create to continue.
Guess what? You're back at the Oracle VM Virtual Box Manager. With your new virtual machine selected in the left sidebar, click the green Start arrow. As your virtual machine boots, it will want to be pointed at the installation media -- in this case, that's the Ubuntu distribution file. Mine was called "ubuntu-12.04.3-desktop-amd64.iso", but yours might be different dependent on the version number of the download. Select the distribution file by clicking on the folder icon, then using the standard OS X dialog to find and select it on your Mac. Once you're ready to go, click Start.
Step 5: Installing Ubuntu Linux
Pretty easy so far, right? It gets even easier now, since Ubuntu practically installs itself.
Here you have a choice -- you can either just try Ubuntu, which means that you're running it from the disk image, or you can install Ubuntu so that you can start installing apps and customize it. I suggest clicking the Install Ubuntu button.
The next screen checks to see if your computer has at least 4.5 GB of available drive space (we set it for 8 GB earlier) and is connected to the Internet. Chances are good that if you're reading this post on TUAW, you're connected to the Internet. I checked both the "Download updates while installing" and "Install this third-party software" boxes so that my virtual machine received any late-breaking security updates, then clicked Continue.
Next, an Installation type window appears. Since you've selected your virtual hard drive, make sure Erase disk and install Ubuntu is selected, and then click Continue. You should see something similar to this indicating that you're connected to a VBOX HARDDISK:
Click that Install Now button and you're on your way. You'll need to create a user for your virtual machine:
Put in your name, the name of the computer (if different), pick a username, and then select and confirm a password. If you don't care to log in every time you start the virtual machine, just select "Log in automatically" and click Continue. For me, I decided to require a password lo log in.
Now you are treated to an exciting slideshow of features while the Ubuntu installer does its magic. When it is complete, you're asked to restart the machine:
As soon as your virtual machine reboots, you're greeted with a login window (if you selected that option), and then move to to the Ubuntu Desktop using the Unity Desktop Environment:
At this point, you can choose to play around for a bit, browse the Ubuntu Software Center (think of it as Ubuntu's App Store), tweak settings, and otherwise make yourself at home. I would suggest, however, that before you do too much, that you make a few minor changes to your virtual machine. To do this, shut down your Ubuntu VM by clicking the little "power button" icon in the upper right corner of the window, then selecting Shut Down...
Step 6: Final Tweaks
Once you're safely back at the Oracle VM VirtualBox Manager, click on your Ubuntu virtual machine in the left sidebar and click the Settings button in the toolbar. What we need to do is change the boot order so that VirtualBox knows where to look for the virtual machine file on the Mac.
When the Ubuntu - System settings window appears, click the System tab:
See that second item below Base Memory titled Boot Order? Initially, it's going to show CD/DVD-ROM as the first item in the list. You want to change that by clicking on Hard Disk, then moving Hard Disk to the top of the list using the little arrows to the right of the boot device list. By the way, since your Mac doesn't have a floppy drive, uncheck that Floppy check box. In fact, you can do the same to CD/DVD-ROM as well if your Mac (like both of mine) doesn't have an optical drive.
I was surprised at how little time it took to set up the Ubuntu virtual machine this time compared with 2009. Of course, the iMac I installed it on is much faster than the one I used four years ago, and both VirtualBox and Ubuntu have gone through some changes as well. It boots a lot faster, too -- from the VirtualBox Manager, it takes just 8 seconds to get to the login screen.
Like I said earlier, you can choose to use any other Linux distribution if you wish to; I just chose Ubuntu because that's what I did four years ago. But this is a fun and educational way to learn all about another operating system, and if you choose not to make a contribution, it's also free.
Subscribe to Newsletter
Software Updatesmore updates
- Daylite 5 adds refinements to the business management app
- 1Password 4.5 for iOS gains features, slims down
- IFTTT for iPad brings service/device mashups to your favorite tablet
- Daily App: Rormix brings indie music videos to your iPhone and iPad
- Pebble updates its iOS app with new apps, sharing options and v2.1 fix
- PSA: Pebble for iOS v.2.1 update contains critical flaw that breaks the app - Update