How to Install and Run Linux on a Mac
In this article
Yes, you can install and run Linux on a Mac. The easiest and safest way is to use a virtual machine (like UTM or VirtualBox) — this lets you run Linux inside macOS without touching your current system. If you want Linux as the only OS, you can dual-boot using Apple's Boot Camp (on Intel Macs) or replace macOS entirely, but that's more involved. This guide covers both the virtual machine route (recommended for most) and the dual-boot route for Intel Macs.
What You'll Need
- A Mac (Intel or Apple Silicon). Steps differ — see notes below.
- At least 20 GB of free disk space (more if you plan to install many packages).
- A USB drive (8 GB or larger) if you plan to dual-boot or create a live USB.
- An internet connection to download the Linux ISO and virtual machine software.
- For dual-boot on Intel Macs: a copy of the Linux ISO (e.g., Ubuntu, Linux Mint, Fedora) and Apple's Boot Camp Assistant (already on your Mac).
- For Apple Silicon Macs: UTM (free) or Parallels Desktop (paid) — these support ARM versions of Linux, like Ubuntu for ARM.
Step-by-Step
Method 1: Run Linux in a Virtual Machine (Recommended)
- Choose your virtual machine software. For Intel Macs: VirtualBox (free) or UTM (free). For Apple Silicon: UTM (free) or Parallels Desktop (paid). Download and install the software from the official website.
- Download a Linux ISO. Go to the official website of your chosen distribution (e.g., ubuntu.com, linuxmint.com, getfedora.org). Download the ISO file. For Apple Silicon, choose the ARM64 version (e.g., Ubuntu for ARM).
- Create a new virtual machine. Open your VM software. Click “New” or “Create”. Give it a name (e.g., “Ubuntu”). Choose the OS type as Linux and select the version that matches your ISO (e.g., Ubuntu 64-bit).
- Allocate resources. Set memory (RAM) — at least 2 GB, but 4 GB is better. Set CPU cores — at least 2. Set disk size — at least 20 GB. You can adjust later.
- Attach the ISO. In the virtual machine settings, find the storage or CD/DVD option. Browse to the Linux ISO you downloaded and attach it as a virtual optical drive.
- Start the virtual machine. Click “Start”. The VM will boot from the ISO. You'll see a Linux boot menu. Choose “Try or Install Linux” (or similar).
- Install Linux. Follow the on-screen installer. Choose your language, keyboard layout, and when asked about installation type, select “Erase disk and install Linux” (this only affects the virtual disk, not your Mac). Complete the installation, then reboot the VM. Remove the ISO from the virtual drive when prompted.
- Run Linux. After reboot, you'll be at the Linux login screen. Log in with the username and password you created. You're now running Linux on your Mac, inside a window.
Method 2: Dual-Boot with Boot Camp (Intel Macs Only)
- Check your Mac model. Boot Camp only works on Intel Macs. Apple Silicon Macs (M1/M2/M3) do not support Boot Camp. To check, click the Apple menu > About This Mac. If it says “Intel” you're good. If it says “Apple M1” or similar, use Method 1.
- Back up your data. Dual-booting involves partitioning your hard drive. Back up important files to Time Machine or an external drive.
- Download the Linux ISO. Choose a distribution that supports Mac hardware well — Ubuntu and Linux Mint are good choices. Download the ISO from the official site.
- Create a bootable USB drive. Use a tool like Etcher (free) to write the ISO to a USB drive. Insert the USB, open Etcher, select the ISO, select the USB, and click “Flash”. This will erase the USB drive.
- Open Boot Camp Assistant. Go to Applications > Utilities > Boot Camp Assistant. Click “Continue”.
- Partition your drive. Boot Camp Assistant will ask you to partition your Mac's drive. Drag the divider to set the size of the Windows/Linux partition. For Linux, you'll need at least 20 GB. Click “Install”.
- Reboot and install Linux. After partitioning, your Mac will restart. Hold the Option (Alt) key during startup to see the boot menu. Select the USB drive. You'll see the Linux installer. Choose “Install Linux” and follow the prompts. When asked about installation type, select “Something else” to manually partition the space you created with Boot Camp. Create a root (/) partition and a swap partition. Install the bootloader to the root partition (not the whole disk).
- Finish and reboot. After installation, restart your Mac. Hold Option to choose between macOS and Linux. You can set the default in System Preferences > Startup Disk.
Common Mistakes
- Downloading the wrong architecture. Apple Silicon Macs need ARM64 Linux, not the standard x86_64. Downloading the wrong one will not boot.
- Giving too little RAM or disk space. Linux needs at least 2 GB RAM and 20 GB disk to run comfortably. Less than that causes slow performance or installation failure.
- Forgetting to remove the ISO after installation. If you don't eject the ISO, the VM will keep booting into the installer instead of the installed system.
- Using Boot Camp on Apple Silicon. Boot Camp is not supported on M1/M2/M3 Macs. Trying to use it will fail.
- Overwriting macOS accidentally. When installing Linux in a dual-boot, if you select “Erase disk” instead of “Something else”, you'll wipe your entire Mac. Always choose manual partitioning.
Tips
- Use a virtual machine first. It's non-destructive and you can try multiple Linux distributions without risk.
- Enable shared folders. In UTM or VirtualBox, you can set up a shared folder to easily move files between macOS and Linux.
- Install Guest Additions (VirtualBox) or SPICE tools (UTM). These improve display resolution, mouse integration, and clipboard sharing.
- For dual-boot, keep macOS as the default. You can change the startup disk in System Preferences to avoid accidentally booting into Linux.
- Use a lightweight distribution if your Mac is older. Xubuntu or Lubuntu run better on older hardware.
Troubleshooting
If Linux does not boot in the virtual machine
- Check that the ISO is not corrupted — re-download it.
- Make sure you selected the correct architecture (ARM64 for Apple Silicon, x86_64 for Intel).
- Increase the RAM allocated to the VM (at least 2 GB).
- In VirtualBox, enable EFI (Settings > System > Motherboard > Enable EFI) for some distributions.
If the installation fails halfway
- Ensure you have enough disk space — the virtual disk should be at least 20 GB.
- Try a different distribution — some have better hardware compatibility.
- Check your internet connection — some installers download updates during installation.
If you can't see the boot menu on a dual-boot
- Restart and hold the Option (Alt) key immediately after the chime. If that doesn't work, try holding it before pressing the power button.
- Make sure the USB drive is properly flashed and is FAT32 or exFAT formatted.
If Linux runs very slowly
- Increase RAM and CPU cores in the VM settings.
- Use a lighter desktop environment (e.g., XFCE instead of GNOME).
- Close other apps on macOS to free up resources.
Frequently Asked Questions
Can I run Linux on an Apple Silicon Mac (M1/M2/M3)?
Yes, but you must use a virtual machine like UTM or Parallels. You cannot dual-boot via Boot Camp on Apple Silicon. Download the ARM64 version of your chosen Linux distribution.
Will Linux damage my Mac?
No, if you use a virtual machine. For dual-boot, as long as you follow the partitioning steps carefully and don't erase the macOS partition, your data is safe. Always back up first.
Which Linux distribution is best for a Mac?
Ubuntu and Linux Mint are the most user-friendly. For older Macs, Xubuntu or Lubuntu are lighter. For Apple Silicon, Ubuntu for ARM is a good choice.
Can I go back to macOS after installing Linux?
Yes. If you used a virtual machine, just delete the VM. If you dual-booted, you can use Boot Camp Assistant to remove the Linux partition and restore the drive to a single macOS volume. Always back up first.
Do I need to pay for any software?
No. VirtualBox, UTM, and all major Linux distributions are free. Parallels is paid but has a free trial. Boot Camp Assistant is built into macOS.
Can I access my macOS files from Linux?
In a virtual machine, you can use shared folders. In a dual-boot, you can mount the macOS partition from Linux (read-only by default) using the terminal. Be careful not to write to it to avoid data corruption.