Installing Linux alongside Apple macOS [Intel CPU ONLY]
Prepare mac for Linux Installation
(NOTE: Currently it only works on Intel CPU macs!)
- Open the Apple menu and go to System Setting > General > Storage to check that you have at least 25GB of space.
Make a backup of your Mac. You won't lose data by installing Linux in a dual boot partition. However, if something goes wrong, you may need to erase your entire Mac to fix it.
- For dual-boot Linux on a Mac, you need two extra partitions: one for Linux and a second for swap space. Ideally, you should set the swap partition to about half the RAM your Mac has. You can check how much memory you have by clicking on the Apple logo in the menu bar and choosing About This Mac from the dropdown.
- Open Disk Utility from the Applications > Utilities folder in Finder. Alternatively, you can use Spotlight search on your Mac to find it.
- In the top-left corner, select View > Show All Devices.
- Select the highest-level drive on your Mac, then click Partition.
- Use the plus (+) button to create a new partition and click Add Partition. Name it per Linux OS to be installed (i.e. "Ubuntu") and set the format to MS-DOS (FAT32). Give it as much space as you want to use for Linux (use at least 20000MB (25000MB preferred).
- Click Apply to create the partition.
- Repeat the steps above to create another partition. Name this partition SWAP and set the format to MS-DOS (FAT) again. Make the size match half the amount of RAM in your Mac—for example, 4GB, 8GB, or more.
- Click Apply to create the partition.
NOTE: If you can't create new partitions, it could be because FileVault is encrypting your Mac's drive. Go to System Settings > Network > FileVault to turn it off.
Install rEFInd for Better Boot Options (OPTIONAL, BUT RECOMMENDED)
-
The standard boot manager on your Mac doesn't always work with Ubuntu. This means you need to install a third-party boot manager instead, which will let you easily choose between macOS or Linux when you start your computer.
- Download rEFInd
-
Disable SIP (System Integrity Protection) in macOS:
- Turn off your mac, turn it back on and immediately hold Command + R keys on the keyboard until you see the Apple logo. Your Mac will boot into macOS Recovery after a while.
- Select the user that has administrator rights and click Next. Type the password of the account if prompted and select Continue.
- Click Utilities from the menu bar and choose Terminal. Alternatively, you can press the Command + Shift + T on your keyboard to launch the Terminal app.
- Type the following command and hit the Return key on your keyboard: csrutil disable.
- Press Y on your keyboard and hit the Return key.
- Enter your Mac's admin password if prompted, and press Return on your keyboard.
- Click the Apple logo in the menu bar and choose Restart to reboot your Mac.
- With SIP disabled, open Terminal from Applications > Utilities in Finder (or search for it using Spotlight).
- Open Finder in a separate window and navigate to the rEFInd download.
- Drag the refind-install file into your Terminal window and press Return (or Enter).
- When prompted, enter your administrator password and press Return again.
- Re-enable SIP by following the same steps outlined above to get into macOS Recovery. But instead of typing csrutil disable, type the following code in Terminal and hit the Return key: csrutil enable
- Next time you restart your Mac, the rEFInd menu should appear automatically. But if it doesn't, hold Option while booting up to load your boot manager.
Allow Booting From an External Drive
If you own an Intel Mac made between 2018 and 2020, it likely has a T2 security chip. This can cause problems when booting from a USB drive. To solve this, you'll need to take some extra steps. You can ignore this part if your Mac doesn't have a T2 chip:
- Turn on your Mac while holding Command + R, and release the keys as soon as you see the Apple logo. This will boot you into macOS Recovery.
- Enter the password for a user you have access to. Keep in mind that it should be an administrator account.
- Select Utilities > Startup Security Utility from the menu bar. You'll once again be prompted to enter your administrator password.
- Under Secure Boot, select the No Security option, and under Allowed Boot Media, select Allow booting from external or removable media.
- Boot Linux From Your USB Installer: Restart your Mac while holding the Option key and reinsert the USB flash drive directly into your computer. When the boot loader appears, use the arrow keys to select the Linux Boot EFI option and hit Return (or Enter).
- Linux loading screen should appear, followed by the Linux desktop. Use this opportunity to test Linux on your Mac LIVE. Note that because Linux is running from your USB flash drive, it may be slow. Since Linux can't use your Mac's Wi-Fi by default, use an Ethernet adapter to connect to the internet.
- Double-click "Install [[LINUX OS]] XXXXXXX" shortcut on desktop.
- Follow the on-screen prompts to choose your language and keyboard layout. Select Normal installation and check the box next to Install third-party software. You need to connect your Mac to the internet using an Ethernet cable to install this software, which makes functions like Wi-Fi and Bluetooth work. Then, click Continue.
If prompted, choose to keep your partitions mounted.
Option 1: Dual Boot Linux With macOS (RECOMMENDED)
- From the Installation type screen, select Something Else and click Continue. On the next screen, you need to identify and select the Linux (i.e. "Ubuntu") partition you created. Unfortunately, there are no recognizable partition names, so look for a device with fat32 in the name that matches the partition size in MB.
- Double-click to select it and choose Use as: Ext4 journaling file system. Set the Mount point to / and check the box to Format the partition. Click OK. In the popup alert, click Continue to write previous changes to the disk.
- Now, identify your SWAP partition, which should also have fat32 in the name. Double-click it and choose to Use as: swap area, then click OK. Open the Device for boot loader installation dropdown menu and select your Linux (i.e. "Ubuntu") partition again. The name should match what you selected for it from the table above.
- Take a moment to ensure you selected the correct partitions, then click Install Now. Click Continue in the popup alert to confirm you want to write changes to those disks. Finally, follow the on-screen prompts to choose your time zone and create a user account, then wait for the installation to complete.
Option 2: Replace macOS With Linux
- From the Installation type screen, select Erase disk and install Ubuntu.
NOTE: This erases everything from your Mac, including the operating system and the recovery partition!
- When you're ready, click Install Now and select your disk. Follow the on-screen prompts to set the correct time zone and create a user account, then wait for the installation to complete.