Software & Apps Linux 204 204 people found this article helpful How to Install and Dual-Boot Linux and macOS Getting Linux running on your Mac by Tom Nelson Writer Tom Nelson is an engineer, programmer, network manager, and computer network and systems designer who has written for Other World Computing,and others. our editorial process Facebook Twitter Tom Nelson Updated on June 28, 2020 Linux Switching from Windows Tweet Share Email The Mac is an excellent platform for running not only the latest macOS (Catalina), 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 Windows computers. You'll find the same processor families, graphics engines, networking chips, and a great deal more. As of right now, you cannot install Linux on the internal SSD of a newer MacBook Pro or Mac Pro (2018 or later). You can still install on an external drive, however. Running Linux on a Mac Many Linux distributions can run nicely on a Mac, though there can be challenges to installing and configuring the OS. Alison Czinkota / Lifewire 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 macOS and their data if problems occur during the process. Be prepared, have a current backup, and read through the whole process before installing Ubuntu. Installation and Drivers 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 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 plenty of reasons for having Ubuntu run on a Mac, including the ability to broaden your technology chops, learn about a different OS, and run one or more OS-specific apps. 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. 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 recent backup of all your data, disconnect it from your Mac to ensure that the clone backup isn't accidentally erased during the Ubuntu installation.A Mac with at least 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 since 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. This version can run directly from the USB flash drive without modifying anything on your Mac. It 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. If you're using a MacBook, you probably don't have to worry.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.The latest stable Ubuntu: Check the Ubuntu website for the latest version and for any specific changes that may affect installation or use on your Mac. Download the Ubuntu version to your Mac. Create a Live Bootable USB Ubuntu Installer for macOS 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. Prepare the USB Flash Drive The following process completely erases any data you have on the USB flash drive. Insert the USB flash drive and launch Disk Utility, which is located at /Applications/Utilities/. 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. Select Erase in the Disk Utility toolbar. Set the Erase options to the following: Name: UBUNTUFormat: MS-DOS (FAT) Select Erase. When the process is complete, select Done. Before you leave Disk Utility, note 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. 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. Download the macOS version of UNetbootin from the UNetbootin GitHub website. The utility downloads as a disk image, with the name unetbootin-mac-677.dmg. The actual number in the file name will change as newer versions are released. Locate the downloaded UNetbootin disk image. It is likely in your Downloads folder. 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. Launch UNetbootin with a double click. You may need to drop into System Preferences > Security & Privacy and select Open Anyway. Enter your administrator password and select OK. 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. 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. Use the Select Version drop-down menu to select 18.04_Live_x64 or 19.10_Live_x64, the version that is compatible with 64-bit architecture. 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. Select OK. UNetbootin downloads the selected Linux distribution, creates the live Linux install files, creates the bootloader, and copies them to your USB flash drive. This may take a while. When UNetbootin is done, select Exit. You may receive 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. 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 If you plan on permanently installing Ubuntu on your Mac while keeping the macOS, you need to create one or more volumes specifically for housing the Ubuntu OS. The process is simple: Use Disk Utility to partition an existing volume, such as your Mac's startup drive, to make room for a second volume. You can also use an external disk. 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: Disk Utility: How to Resize a Mac Volume (OS X El Capitan or Later)Partition a Drive with OS X El Capitan's Disk Utility 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, macOS 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, consult this formatting guide: Format a Mac's Drive Using Disk Utility (OS X El Capitan or later) 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 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 macOS 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 Windows operating systems 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 than two OSes, but the Mac's boot manager won’t recognize the Ubuntu OS without a bit of fiddling, and the GRUB boot manager isn't particularly easy to use. Instead, make use of a third-party boot manager called rEFInd. rEFInd can handle all of the Mac's booting needs, including letting you select macOS, Ubuntu, or even 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 Restart your Mac while holding down the command (cloverleaf) and R keys (command+R). Keep holding both keys down until the Apple logo appears. Wait for the Recovery screen to load. Open Terminal, which can be found under /Applications/Utilities/. In the Terminal window that opens, enter the following: csrutil disable Press Enter or Return on your keyboard. Restart your Mac by typing reboot into the Terminal, or use the menus on the Recovery screen. Once you have the Mac desktop back, download rEFInd from SourceForge at rEFInd beta, an EFI boot manager utility. Open the refind-bin-0.12.0 (or later) folder from your Downloads folder. Open Terminal, which can be found under /Applications/Utilities/. Arrange the Terminal window and the refind-bin-0.10.4 Finder window so that you can see both. Drag refind-install from the refind-bin-0.10.4 folder to the Terminal window. In the Terminal window, press Enter or Return. rEFInd is installed on your Mac. Optional but recommended: Turn SIP back on by entering csrutil enable in Terminal. Then press Enter or Return. Close Terminal. Use the Shut Down command to shut down your Mac. Using the Live USB Drive to Try out Ubuntu on Your Mac The live USB for Ubuntu you created earlier can be used for permanently installing Ubuntu on your Mac. You can also use it to try out Ubuntu without installing the OS. It's a good idea to try Ubuntu first because 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. 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 common issue is missing Bluetooth drivers, which prevent your wireless keyboard or mouse from working.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 using a USB-C equipped Mac, like the latest Macbook Pros, you may have problems seeing the Live Ubuntu USB disk you created with UNetbootin via an adapter. You can try a flash drive that connects directly to USB-C, or a different adapter, like Apple's own USB-C to USB Adapter. If you're ready, let's give it the boot. 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. 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. After you select the Boot EFI\boot\... or EFI Drive icon, press Enter or Return on the keyboard. 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: Try Ubuntu without installing it.Install Ubuntu.OEM install (for manufacturers).Check disc for defects. Use the arrow keys to select Try Ubuntu without installing and then press Enter or Return. 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 Shut down your Mac by pressing and holding the Power button. After the Mac shuts down, restart and return to the GRUB boot loader screen using the instructions above. Select Try Ubuntu without installing but do not press the Enter or Return key. Instead, press the 'e' key on your keyboard to enter an editor that allows you to make changes to the boot loader commands. 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 --- Between the words 'splash' and '---' insert the following: nomodeset 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 ---. The line should end up looking like this: linux /casper/vmlinuz.efi file=/cdrom/preseed/Ubuntu.seed boot=casper quiet splash nomodeset --- 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=0radeon.modeset=0intel.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 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. If you're ready, select or double-click the Install Ubuntu icon. Select the language to use, then select Continue. Allow the installer to download updates as needed, for both the Ubuntu OS as well as drivers you may need. Place a checkmark in the Download Updates while installing Ubuntu checkbox and in the Install third-party software for graphics and Wi-Fi hardware, Flash, MP3, and other media checkbox. Select Continue. Ubuntu offers a number of installation types. To install Ubuntu on a specific partition, select Something Else from the list, then select Continue. 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 select Change. Ubuntu shows the partition size in megabytes (MB), while the Mac displays the size as gigabytes (GB). 1GB equals 1000MB. Use the Use as drop-down menu to select the file system to use, preferably the ext4 journaling file system. Use the Mount Point drop-down menu to select the forward-slash ( / ), which is called the root. Select OK. You may be warned that selecting a new partition size has to be written to the disk. Select Continue. With the partition you just modified selected, select Install Now. You may be warned that you did not define any partition to be used for swap space, but you can add swap space later. Select Continue. You are notified that the changes you made are about to be committed to the disk. Select Continue. Select a time zone from the map or enter a major city in the field. Select Continue. Choose the keyboard layout and select Continue. Set up your Ubuntu user account by entering your name, a name for the computer, a username, and a password. Select Continue. The installation process will start, with a status bar displaying the progress. When the installation completes, you can select Restart. 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 macOS, 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. Select 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.