How To Run Linux On Mac

How To Run Linux On Mac

Reading time1 min
#Linux#Mac#Technology#DualBoot#Virtualization#Ubuntu

How to Run Linux on a Mac: Practical Options and Engineering Caveats

Running Linux on Apple hardware can unlock workflow portability, enable access to CLI tooling not native to macOS, and dramatically extend the usable lifespan of older Macs. But Apple’s approach to firmware and chipsets—especially from T2 onward—introduces several interoperability complications that engineers should anticipate.

Summary Table

MethodHardware SupportData RiskPerformanceTypical Use Cases
Dual Boot (manual)Intel Mac onlyHigh (if misconfigured)NativeCI builds, heavy workloads
Virtual MachineIntel & Apple SiliconLowModerate/LowExperimentation, dev
Live USB (no install)Intel Mac onlyNoneLowerTesting, rescue, demos

1. Dual Boot Linux and macOS: Manual Bootloader Modification

Apple dropped Boot Camp Linux support years ago. Still want full native performance? You’ll be interacting with EFI firmware directly. Here’s a walk-through for an Intel Mac (macOS Ventura 13.x, example hardware: 2015 MacBook Pro).

Pre-Install Checklist

  • Recent Ubuntu ISO (e.g., 22.04 LTS)
  • 16GB+ USB 3.0 stick (slower media will bottleneck install)
  • Free space: 40GB minimum realistic partition size
  • Verified backup (Time Machine or full disk clone with SuperDuper!/Carbon Copy Cloner)
  • Optionally: rEFInd boot manager for ease of boot choice

Practical Steps

1. Shrink macOS Partition

  • Open Disk Utility, select main APFS container, reduce size by at least 40GB.
  • APFS resizing is non-destructive, but failures do occur. Confirm backup integrity before proceeding.

2. Burn the Linux ISO

  • Convert the ISO (example: Ubuntu 22.04) to IMG:

    hdiutil convert -format UDRW -o ~/ubuntu.img ~/Downloads/ubuntu-22.04-desktop-amd64.iso
    
  • Identify USB device:

    diskutil list
    
  • Unmount, then write image (replace diskN—mistakes here can wipe your macOS boot volume):

    diskutil unmountDisk /dev/diskN
    sudo dd if=~/ubuntu.img.dmg of=/dev/rdiskN bs=4m
    diskutil eject /dev/diskN
    

3. Adjust Security Features

  • Macs with T2 chip require Secure Boot modification:

    • Reboot, hold Cmd+R (Recovery), open Startup Security Utility.
    • Set Secure Boot to “No Security”, allow booting external media.
  • For 2018+ models, SIP (System Integrity Protection) may also interfere; consider:

    csrutil disable
    

4. EFI Boot & Installation

  • Reboot, hold Option (⌥), select the USB stick labeled “EFI Boot”.
  • At GRUB menu, select “Try Ubuntu”.
  • Run installer; at partitioning, do not overwrite macOS. Instead, use “Something else” — manually target only your new partition.

Known Issue: On some MacBook Air/Pro models, internal Wi-Fi is unsupported out-of-box. Be ready with a USB Ethernet adapter or secondary device.

5. Bootloader Fix

  • After install, macOS Secure Boot/EFI may not recognize the Ubuntu install.

  • Install rEFInd from macOS:

    brew install --cask refind
    sudo refind-install
    
  • On reboot, use rEFInd menu to select Linux or macOS.


2. Running Linux in a VM: No Partitioning Required

Modern Apple Silicon (M1/M2+) and Intel Macs both support virtualization, though with some caveats:

Virtualization PlatformApple Silicon SupportComment
UTMYesAccepts aarch64 Linux ISOs only
Parallels DesktopYesPaid software
VirtualBox 7.x+Intel onlyFree, slow on GUI apps
VMware Fusion 13+BothFree for personal use

Example: Ubuntu 22.04 LTS in VMware Fusion 13

• Download Fusion 13 (https://customerconnect.vmware.com/)
• Create New VM > Custom > Point to ISO
• Allocate 4GB+ RAM and 2 vCPU for usable performance
• For Apple Silicon: must use ARM64 Ubuntu ISOs

Note: Nested virtualization (i.e., running Docker inside nested Ubuntu on Apple Silicon) is still limited. For most engineering workflows on ARM, expect to re-tool pipelines for ARM-native builds.

rEFInd Side Note

For advanced, multi-OS workflows, rEFInd can chainload multiple Linux distributions and Windows bootloaders from a single interface.


3. Running Ubuntu Live from USB: Fastest Path, Minimal Risk

  • Write ISO to USB as above
  • Reboot → hold Option (Intel only)
  • Select “EFI Boot”
  • At the prompt, select “Try Ubuntu”

This approach has critical limits: changes disappear at shutdown; Wi-Fi devices may be unsupported without a custom ISO (especially on Broadcom chipsets); no swap partition, so performance degrades rapidly with memory overhead.


Apple Silicon (M1/M2) Considerations

  • x86_64 distributions do not run natively. Use Ubuntu ARM64 ISOs.
  • Traditional dual boot is functionally impossible (no Boot Camp APIs, no GRUB handoff to macOS).
  • Projects like Asahi Linux provide experimental support—expect lack of GPU acceleration, spotty driver support, and hardware quirks. Example: basic framebuffer only; no Thunderbolt hot-plug or sleep mode reliability.
  • No recovery for overwritten macOS firmware unless using Apple Configurator 2 and a spare Mac.

Practical Example: Debugging a Failed Dual Boot

Symptom: Linux install completes, but selecting Linux via rEFInd or Option menu results in black screen or No bootable device.

Diagnosis steps:

  1. Boot into macOS, re-run refind-install.
  2. Mount the Linux partition, verify presence of /EFI/ubuntu/grubx64.efi.
  3. Confirm with bless:
    sudo bless --mount /Volumes/ESP --setBoot --file /Volumes/ESP/EFI/ubuntu/grubx64.efi --shortform
    
  4. Reset NVRAM (Cmd+Opt+P+R); retry boot.

Non-Obvious Tips

  • If you absolutely must persist live USB changes, use a tool like mkusb to create persistent storage overlays.
  • For disabling Mac hardware that isn’t supported (e.g., problematic Nvidia GPU dGPU on pre-2015 MacBook Pros): append nouveau.modeset=0 to the GRUB command line on boot.
  • Always keep a spare, bootable macOS USB installer available—macOS recovery over Wi-Fi is notoriously slow and unreliable in dual-boot failure scenarios.

Conclusion

Running Linux on a Mac is feasible, but frequently not straightforward. Intel Macs with deactivated Secure Boot provide best results. Apple Silicon support is advancing, but not mature for daily non-experimental use. Always validate compatibility for your specific model, and beware: routine macOS point updates may overwrite third-party bootloaders or kill boot entries without warning.


For additional model-specific quirks, driver workarounds, or alternative distributions such as Fedora or Debian, check recent changelogs and user forums—Apple changes hardware-level interoperability often and documentation lags behind.