How to Install and Dual Boot Linux and Mac OS

Getting Linux running on your Mac

The Mac is an excellent platform for running not only the Mac OS, such as macOS Sierra but also Windows and Linux. The MacBook Pro is a popular platform for running Linux.

Under the hood, Mac's hardware is remarkably similar to most of the parts used in modern PCs. You'll find the same processor families, graphics engines, networking chips, and a great deal more.

Running Windows on a Mac

When Apple changed from PowerPC architecture to Intel, many wondered if the Intel Macs could run Windows. Turns out, the only real stumbling block was getting Windows to run on an EFI-based motherboard instead of the then much more common BIOS-based designs.

Apple even lent a hand to the effort by releasing Boot Camp, a utility that included Windows drivers for all the hardware in the Mac, the ability to assist a user in setting up the Mac for dual booting between the Mac OS and Windows, and an assistant for partitioning and formatting a drive for use by the Windows OS.

Person using Mac desktop to run Ubuntu Linux
Lifewire / Alison Czinkota

Running Linux on a Mac

If you can run Windows on a Mac, you should be able to run just about any OS that is designed for the Intel architecture, right? In general, this is true, although, as with many things, the devil is in the details. Many Linux distributions can run nicely on a Mac, though there can be challenges to installing and configuring the OS.

Level of Difficulty

This project is for advanced users who have the time to work through issues that may develop along the way and are willing to reinstall the Mac OS and their data if problems occur during the process.

There may not be any huge issues, but the potential exists. Be prepared, have a current backup, and read through the whole process before installing Ubuntu.

Installation and Drivers

Live Ubuntu Desktop

Coyote Moon, Inc.

The issues that arise when getting a Linux distribution working on a Mac usually revolve around two problem areas: getting an installer to work correctly with the Mac and finding and installing all the needed drivers so the essential parts of the Mac work. This can include locating the drivers required for Wi-Fi and Bluetooth, as well as the drivers needed for the graphics system your Mac uses.

It's a shame Apple doesn’t provide generic drivers that could be used with Linux, along with a basic installer and assistant as it has done with Windows, but until that happens, you have to tackle the installation and configuration issues yourself.

This guide can help you get a favorite Linux distribution working on a Mac and introduce you to resources that can help you track down the drivers you need or solve installation issues you may come across.

Ubuntu

There are many Linux distributions you can choose from for this project including Debian, MATE, elementary OS, Arch Linux, OpenSUSE, Ubuntu, and Mint. This guide uses Ubuntu, mainly because of the active forums and support available from the Ubuntu community and the coverage of Ubuntu provided online.

Why Install Ubuntu on Your Mac?

There are a ton of reasons to want Ubuntu or your favorite Linux distribution running on your Mac. You may want to broaden your technology chops, learn about a different OS, or have one or more specific apps you need to run. You may be a Linux developer and realize that the Mac is the best platform to use, or you may simply want to try out Ubuntu.

No matter the reason, this guide helps you install Ubuntu on your Mac and enable your Mac to easily dual boot between Ubuntu and macOS. This method for dual-booting can easily be expanded to triple booting or more.

What You Need

You need several things before you can start:

  • A recent backup — Use Carbon Copy Cloner or a similar utility to clone an external bootable drive that includes a copy of the Recovery HD volume. After you have a working clone, disconnect it from your Mac to ensure that the clone backup isn't accidentally erased during the Ubuntu installation.
  • A Mac with 2GB of RAM and a 2 GHz dual-core processor — These are the bare minimums; more RAM and faster processor speeds or additional processor cores are helpful. The installation described here is on a 2014 27-inch Retina iMac running macOS Sierra, but the process should work for any Mac released after 2011. If you plan to use an older Mac, you should still be able to install Ubuntu, but you need to pay attention to how the boot process works for older hardware. If you have problems getting your older Mac to work with Ubuntu, stop by the Ubuntu forums and search for install guides for your Mac model.
  • A 2GB or larger USB flash drive — The flash drive is used as a bootable Ubuntu installer that contains not only the basic installer but also a live version of Ubuntu that you can run directly from the USB flash drive without modifying anything on your Mac. This is a great way to test whether your Mac and Ubuntu can get along.
  • A USB keyboard and mouse — You need a USB-based keyboard and mouse because it's highly likely that the Ubuntu Bluetooth drivers will need to be installed or updated before a wireless keyboard or mouse can work.
  • 25GB free drive space — This is the minimum size recommended for the desktop version of Ubuntu; more space to work with can be a benefit.
  • Ubuntu 16.04.1 LTS — This is the current stable version of Ubuntu that was available when we started this project. Later versions should work as well. Check the release notes for any specific changes that may affect installation or use on your Mac.

Create a Live Bootable USB Ubuntu Installer for Mac OS

Unetbootin Live USB creation tool
UNetbootin simplifies the creation of a Live USB Ubuntu installer for your Mac.

Coyote Moon, Inc.

The first task in installing and configuring Ubuntu on your Mac is to create a live bootable USB flash drive that contains the Ubuntu Desktop OS. Use this flash drive to not only install Ubuntu but also to confirm that Ubuntu can run on your Mac. You should be able to boot Ubuntu directly from the USB stick without having to perform an install. This lets you check basic operations before you commit to altering your Mac's configuration to accommodate Ubuntu.

Preparing the USB Flash Drive

One of the first stumbling blocks you may encounter is how the flash drive should be formatted. Many folks mistakenly believe the flash drive needs to be in a bootable FAT format, requiring the partition type to be Master Boot Record, and the format type to be MS-DOS (FAT). While this may be true of installations on PCs, your Mac is looking for GUID partition types for booting, so the USB flash drive must be formatted for use on the Mac.

The following process completely erases any data you have on the USB flash drive.

  1. Insert the USB flash drive and launch Disk Utility, which is located at /Applications/Utilities/.
  2. Locate the flash drive in Disk Utility's sidebar. Select the actual flash drive and not the formatted volume that may appear just below the flash drive's manufacturer name.
  3. Click Erase in the Disk Utility toolbar.
  4. Set the Erase options as follows: Name: UBUNTU, Format: MS-DOS (FAT), Scheme: GUID Partition Map.
  5. Click Erase.
  6. When the process is complete, click Done.
  7. Before you leave Disk Utility, make a note of the flash drive's device name. Make sure the flash drive named UBUNTU is selected in the sidebar, and look for the entry labeled Device in the main panel. You should see the device name, such as disk2s2, or similar. Write down the device name. You need it later.
  8. Quit Disk Utility.

UNetbootin Utility

The UNetbootin utility creates the live Ubuntu installer on the USB flash drive. UNetbootin downloads the Ubuntu ISO, converts it to an image format the Mac can use, creates the boot chain needed by the installer for the Mac OS, and then copies it to the USB flash drive.

  1. UNetbootin can be downloaded from the UNetbootin GitHub site. Select the Mac OS X version even if you're using macOS Sierra. The utility downloads as a disk image, with the name unetbootin-mac-625.dmg. The actual number in the file name may change as newer versions are released.
  2. Locate the downloaded UNetbootin disk image. It is probably in your Downloads folder.
  3. Double-click the .dmg file to mount the image on your Mac's desktop. The UNetbootin image opens. You don’t need to move the app to your Applications folder, although you can if you want. The app works just fine from within the disk image.
  4. Launch UNetbootin by right-clicking on the unetbootin app and selecting Open from the popup menu. Use this method to launch the app because the developer isn't a registered Apple developer, and your Mac's security settings may prevent the app from launching. This method of launching the app bypasses the basic security settings without having to go into the System Preferences to change them.
  5. Your Mac's security system will still warn you about the developer of the app being unrecognized and ask if you really want to run the app. Click Open.
  6. A dialog box opens, saying osascript wants to make changes. Enter your administrator password and click OK.
  7. The UNetbootin window opens. UNetbootin supports creating the live USB installer for Linux using an ISO file you previously downloaded, or it can download the Linux distribution for you. Do not choose the ISO option. UNetbootin is currently unable to create a Mac-compatible bootable USB drive using a Linux ISO you download as the source. It can, however, properly create the bootable USB drive when it downloads the Linux files from within the app.
  8. Make sure Distribution is selected and then use the Select Distribution drop-down menu to pick the Linux distribution you want to install on the USB flash drive. For this project, select Ubuntu.
  9. Use the Select Version drop-down menu to select 16.04_Live_x64, the version that is compatible with 64-bit architecture. Some early Intel Macs used 32-bit architecture, and you may need to choose the 16.04_Live version instead. If you’re adventurous, select the Daily_Live or Daily_Live_x64 versions, which have the most current beta version of Ubuntu. This can be helpful if you have issues with the live USB running correctly on your Mac or with drivers such as Wi-Fi, Display, or Bluetooth not working.
  10. The UNetbootin app should now list the type (USB Drive) and Drive name that the Ubuntu live distribution will be copied to. The Type menu should be populated with USB Drive, and the Drive should match up to the device name you made a note of earlier when you were formatting the USB flash drive. After you confirm that UNetbootin has the proper distribution, version, and USB drive selected, click the OK button.
  11. UNetbootin downloads the selected Linux distribution, creates the live Linux install files, creates the bootloader, and copies them to your USB flash drive.
  12. When UNetbootin finishes, you may see the following warning: The created USB device will not boot off a Mac. Insert it into a PC, and select the USB boot option in the BIOS boot menu. You can ignore this warning as long as you used the Distribution option and not the ISO option when creating the bootable USB drive.
  13. Click the Exit button.

The live USB flash drive containing Ubuntu has been created and is ready to try out on your Mac.

Creating a Ubuntu Partition on Your Mac

Use Disk Utility to Partition for a Ubuntu Volume
Disk Utility can partitionan existing volume to make room for Ubuntu.

Coyote Moon, Inc.

If you plan on permanently installing Ubuntu on your Mac while keeping the Mac OS, you need to create one or more volumes specifically for housing the Ubuntu OS.

The process is simple. You use Disk Utility to partition an existing volume, such as your Mac's startup drive, to make room for a second volume. You could also use an entire drive other than your startup drive, to house Ubuntu, or you could create another partition on a non-startup drive. There are lots of choices.

Just to add another option, you could also install Ubuntu on an external drive connected via USB or Thunderbolt.

Ubuntu Partitioning Requirements

You may have heard that Linux OSes need multiple partitions to run at their best; one partition for disk swap space, another for the OS, and a third for personal data.

While Ubuntu can use multiple partitions, it's also capable of being installed in a single partition, which is the method used here. You can always add a swap partition later from within Ubuntu.

Why Create Just One Partition Now?

You're going to use the disk partitioning utility included with Ubuntu to create the needed storage space. What you need the Mac's Disk Utility to do is define that space, so it's easy to select and use when installing Ubuntu. Think of it this way: when you get to the point in the Ubuntu installation where the drive space is assigned, you don’t want to choose the existing Mac OS drive accidentally, or any of the Mac OS data drives you use. Creating the space erases any information on the selected volume.

Instead, you create a volume with an easy-to-identify name, format, and size that stands out when it comes time to select a volume for the Ubuntu installation.

Use Disk Utility to Create the Ubuntu Install Target

If you're going to use an existing partition, take a look at these two guides for resizing and partitioning:

Partitioning, resizing, and formatting any drive can result in data loss. Make sure you have a current backup of any data on the selected drives involved.

If you're using a Fusion Drive, the Mac OS imposes a limit of two partitions on the Fusion volume. If you've already created a Windows Boot Camp partition, you won't be able to add a Ubuntu partition as well. Consider using an external drive with Ubuntu instead.

If you plan on using an entire drive for Ubuntu, use the formatting guide:

No matter which of the guides you use, the partition scheme should be GUID Partitioning Map, and the format can be MS-DOS (FAT) or ExFat. The format will change when you install Ubuntu. Its purpose is only to make it easy to identify which disk and partition you use for Ubuntu later in the install process.

Give the volume a meaningful name, such as UBUNTU and make a note of the partition size you make. Both pieces of information are helpful in identifying the volume later during the Ubuntu install.

Using rEFInd as Your Dual-Boot Manager

rEFInd boot manager for Mac OS
rEFInd allows your Mac to boot from multiple operating systems, including OS X, Ubuntu, and others.

Coyote Moon, Inc.

So far, you've worked on getting your Mac ready to receive Ubuntu and prepared a bootable installer you can use for the process. Now you need to take steps to be able to dual boot your Mac into the Mac OS as well as the new Ubuntu OS.

Boot Managers

Your Mac already comes equipped with a boot manager that lets you choose between multiple Mac or Window OSes that may be installed on your Mac. You can invoke the boot manager at startup by holding down the Option key, such as is described in the Using the OS X Recovery Disk Assistant guide.

Ubuntu comes with its own boot manager, called GRUB (GRand Unified Boot Loader). You'll use GRUB shortly when you run through the installation process.

Both of the boot managers available to use can handle the dual-booting process; they can even handle more OSes than just two, but the Mac's boot manager won’t recognize the Ubuntu OS without a bit of fiddling, and the GRUB boot manager just particularly easy to use.

Instead, make use of a third-party boot manager called rEFInd. rEFInd can handle all the Mac's booting needs, including letting you select the Mac OS, Ubuntu, or Windows, if you happen to have it installed.

Installing rEFInd

rEFInd is easy to install; a simple Terminal command is all that's needed if you're using OS X Yosemite or earlier. OS X El Capitan and later has an additional security layer called SIP (System Integrity Protection). In a nutshell, SIP prevents ordinary users, including administrators, from changing system files, including preference files and folders the Mac OS uses for itself.

As a boot manager, rEFInd needs to install itself within areas protected by SIP, so if you're using OS X El Capitan or later, you'll need to disable the SIP system before proceeding.

Disabling SIP

  1. Use the instructions in the Using the OS X Recovery Disk Assistant guide to restart your Mac using the Recovery HD.
  2. Select Utilities Terminal from the menus.
  3. In the Terminal window that opens, enter the following: csrutil disable
  4. Press Enter or Return.
  5. Restart your Mac.
  6. Once you have the Mac desktop back, launch Safari and download rEFInd from SourceForge at rEFInd beta, an EFI boot manager utility. When the download completes, you can find it in a folder named refind-bin-0.10.4. (The number at the end of the folder name may change as new versions are released.) Open the refind-bin-0.10.4 folder.
  7. Launch Terminal, located at /Applications/Utilities/.
  8. Arrange the Terminal window and the refind-bin-0.10.4 Finder window so that both can be seen.
  9. Drag the file named refind-install from the refind-bin-0.10.4 folder to the Terminal window.
  10. In the Terminal window, press Enter or Return.
  11. rEFInd is installed on your Mac.
    Optional but recommended:
    1. Turn SIP back on by entering the following in Terminal: csrutil enable.
    2. Press Enter or Return. 
  12. Close Terminal.
  13. Shut down your Mac. (Do not restart. Use the Shut Down command.)

Using the Live USB Drive to Try out Ubuntu on Your Mac

Live Ubuntu Desktop
The Live Ubuntu Desktop is a good way to ensure your Mac can run Ubuntu without many issues.

Coyote Moon, Inc.

The live USB for Ubuntu you created earlier can be used for permanently installing Ubuntu on your Mac and for trying out Ubuntu without installing the OS. You can jump to an installation, but try Ubuntu first. The main reason is that you may discover problems before committing to a full install.

Some of the issues you may find include the install of live USB not working with your Mac graphics card. This is one of the more common problems Mac users face when installing Linux. You may also find out that your Wi-Fi or Bluetooth isn't operating. Most of these issues can be corrected after the install, but knowing about them ahead of time lets you do a little research from your familiar Mac environment. You can track down the issues and possibly acquire needed drivers or at least know where to get them before the installation.

Trying out Ubuntu on Your Mac

Before you try booting to the live USB drive you created, there's a bit of preparation to perform.

  • Make sure the Live USB flash drive is connected directly to one of your Mac's USB or Thunderbolt ports. Do not use a USB hub, as it's common for the Live USB flash drive to fail to show up when connected via a hub.
  • Make sure you have a USB keyboard and USB mouse connected to your Mac. Another of the common issues is missing Bluetooth drivers, which prevent your wireless keyboard and mouse from being used.
  • If possible, connect your Mac to your home network via a wired Ethernet port. This is for the same reason as the wireless keyboard or mouse. The Wi-Fi drivers may need to be updated or added to get your wireless network working.

If you're ready, let's give it the boot.

  1. Shut down or restart your Mac. If you installed rEFInd, the boot manager automatically appears. If you chose not to use rEFInd, then as soon as your Mac starts to boot up, hold down the Option key. Keep holding it down until you see the Mac's boot manager display a list of available devices you can start up from.
  2. Use the arrow keys to select either the Boot EFI\boot\... entry (rEFInd) or the EFI Drive entry (Mac boot manager) from the list. If you don’t see an EFI Drive or Boot EFI\boot\... in the list, shut down and make sure the live USB flash drive is connected directly to your Mac. You may also want to remove all peripherals from your Mac, except the mouse, keyboard, USB live flash drive, and wired Ethernet connection.
  3. After you select the Boot EFI\boot\... or EFI Drive icon, press Enter or Return on the keyboard.
  4. Your Mac will boot using the live USB flash drive and present the GRUB 2 boot manager. You'll see a basic text display with at least four entries:
    1. Try Ubuntu without installing it.
    2. Install Ubuntu.
    3. OEM install (for manufacturers).
    4. Check disc for defects.
  5. Use the arrow keys to select Try Ubuntu without installing and then press Enter or Return.
  6. The display goes dark for a short time and then displays a Ubuntu splash screen, followed by the Ubuntu desktop. The total time for this should be 30 seconds to a few minutes. If you must wait longer than five minutes, there's likely a graphics problem. If your display remains black, you never leave the Ubuntu splash screen, or the display becomes unreadable, you likely have a graphics driver problem. You can fix this by modifying the Ubuntu boot loader command as outlined below.

Modifying the GRUB Boot Loader Command

  1. Shut down your Mac by pressing and holding the Power button.
  2. After the Mac shuts down, restart and return to the GRUB boot loader screen using the instructions above.
  3. Select Try Ubuntu without installing but do not press the Enter or Return key. Instead, press the 'e' key to enter an editor that allows you to make changes to the boot loader commands.
  4. The editor contains a few lines of text. You need to modify the line that reads:
    linux/casper/vmlinuz.efi file=/cdrom/preseed/Ubuntu.seed boot=casper quiet splash ---
  5. Between the words 'splash' and '---' insert the following:
    nomodeset
  6. The line should end up looking like this:
    linux   /casper/vmlinuz.efi file=/cdrom/preseed/Ubuntu.seed boot=casper quiet splash nomodeset ---
  7. To make the edit, use the arrow keys to move the cursor to the location just after the word splash and then type nomodeset. There should be a space between splash and nomodeset and a space between nomodeset and ---.
  8. Press F10 to boot with the new settings.

The changes you just made are not saved. They're used just this one time. Should you need to use the Try Ubuntu without installing option in the future, you'll need to edit the line once again.

Adding nomodeset is the most common method of correcting a graphics issue when installing, but it's not the only one. If you continue to have display issues, you can try the following:

Determine the make of the graphics card your Mac uses. You can do this by selecting About This Mac from the Apple menu. Look for the text Graphics, make a note of the graphics being used, and then use one of the following values instead of nomodeset:

nvidia.modeset=0

radeon.modeset=0

intel.modeset=0

If you're still having problems with the display, check the Ubuntu forums for issues with your specific Mac model.

Now that you have a live version of Ubuntu running on your Mac, check to make sure your Wi-Fi network is working, as well as Bluetooth if needed. 

Installing Ubuntu on Your Mac

Partitioning the drives for installing Ubuntu
After locating the 200 GB volume you previously formats as FAT32, you can change the partition to EXT4 and set the mount point as Root (/) for the installation of Ubuntu on your Mac.

Coyote Moon, Inc.

By now, you have a working live USB flash drive that contains the Ubuntu installer, your Mac configured with a partition ready to be used for installing Ubuntu, and an itchy mouse finger just waiting to click on the Install Ubuntu icon you see on the live Ubuntu desktop.

Install Ubuntu

  1. If you're ready, double-click the Install Ubuntu icon.
  2. Select the language to use and then click Continue.
  3. Allow the installer to download updates as needed, for both the Ubuntu OS as well as drivers you may need. Place a check mark in the Download Updates while installing Ubuntu check box and in the Install third-party software for graphics and Wi-Fi hardware, Flash, MP3, and other media check box. Click the Continue button.
  4. Ubuntu offers a number of installation types. To install Ubuntu on a specific partition, select Something Else from the list and then click Continue.
  5. The installer presents a list of storage devices connected to your Mac. You need to find the volume you created using the Mac's Disk Utility. Because the device names are different, use the size and format of the volume you created. After you locate the correct volume, use the mouse or arrow keys to highlight the partition and then click the Change button.
    Note: Ubuntu shows the partition size in megabytes (MB), while the Mac displays the size as gigabytes (GB). 1GB equals 1000MB.
  6. Use the Use as drop-down menu to select the file system to use, preferably the ext4 journaling file system.
  7. Use the Mount Point drop-down menu to select the forward slash (/), which is called the root. Click the OK button.
  8. You may be warned that selecting a new partition size has to be written to the disk. Click the Continue button.
  9. With the partition you just modified selected, click the Install Now button.
  10. You may be warned that you did not define any partition to be used for swap space, but you can add swap space later. Click the Continue button.
  11. You are notified that the changes you made are about to be committed to the disk. Click the Continue button.
  12. Select a time zone from the map or enter a major city in the field. Click Continue.
  13. Choose the keyboard layout and click Continue.
  14. Set up your Ubuntu user account by entering your name, a name for the computer, a username, and a password. Click Continue.
  15. The installation process will start, with a status bar displaying the progress. When the installation completes, you can click the Restart button.

You now have a working version of Ubuntu installed on your Mac.

After the restart completes, you may notice that the rEFInd boot manager is now operating and displays the Mac OS, the Recovery HD, and the Ubuntu OS. You can click on any of the OS icons to select the operating system you want to use.

Click the Ubuntu icon.

If after restarting you have issues, such as missing or nonfunctional devices (Wi-Fi, Bluetooth, printers, or scanners), check with the Ubuntu community for tips about getting all your hardware working.