Install Linux (Ubuntu 20.04) on M1/M2 Mac Silicon

Shubh Jain
6 min readApr 3, 2024
Ubuntu Focal Fossa

Hey there, fellow robotics enthusiasts and Linux users! So, you’ve got yourself one of those powerful M1 or M2 Macs, but you’re itching to run projects that run only on Linux, right? Fortunately, with the help of virtualization technology, it’s possible to run Linux on M1/M2 Macs. In this guide, we’ll explore how to set up Linux on your M1/M2 Mac using the UTM virtual machine.

What is UTM?

UTM stands for “Universal Terminal Machine,” an open-source virtualization tool designed for macOS and iOS. It enables users to run virtual machines on Apple Silicon devices, including M1 and M2 Macs. With UTM, you can emulate various operating systems, including Linux distributions, Windows, and more. You can download the UTM app for Mac from the official UTM download link.

Setting Up Linux on M1/M2 Macs using UTM:

Here’s a step-by-step guide (which looks long because I have tried to include pictures of every step in this guide) to installing Linux on your M1/M2 Mac using UTM:

  1. Download and Install UTM:
  • You can download the UTM app from the link given above or just search for UTM for Mac on Google to download it.
  • Once downloaded, open the DMG file and drag the UTM application to your Applications folder to install it.

2. Obtain a Linux Disk Image:

  • Choose a Linux distribution that you want to install. Popular choices include Ubuntu, Fedora, and Debian. We are gonna install Ubuntu 20.04 in this tutorial.
  • Since Ubuntu 20.04 desktop version for ARM 64 has been removed from the official website we will use a workaround to get that beautiful Ubuntu 20.04 desktop.
  • Download the server disk image for Ubuntu 20.04 (ARM 64 version) from here. Remember it’s only a server image so it will have only a command line interface. We will install the full desktop version in the upcoming steps.

3. Create a New Virtual Machine in UTM:

  • Open UTM from your Applications folder.
  • Click on the “+” button to create a new virtual machine.
  • Choose “Virtualize” option. So the difference between “Virtualize” and “Emulate” is that Virtualize virtualizes the machines that have native support for Apple silicon,i.e, ARM 64 chipset that’s why it is faster whereas Emulate can run other CPU architectures by virtualizing the required CPU architecture.
    (Believe me, I have tried emulate , it's shitty slow. So i would advise you to never go for that option if you do not have a very light OS running only command lines)
  • Select “Linux” Obviously.
  • Choose Boot from the ISO image and browse to the downloaded server image which we have downloaded in Step 2
  • Now allocate the required resources to the machine. I would highly recommend allocating half of your system’s resources (Not the storage obviously) to the virtual machine for the best performance. Try not to run any other application while working on your virtualized OS to conserve resources and boost performance, otherwise, your system may crash.
Add a Share directory to drag and drop files between your native system to the Virtualized OS

4. Start the Virtual Machine:

  • Once the configuration is complete, click “Create” to create the virtual machine.
  • Select the newly created virtual machine from the list and click “Start” to launch it.

5. Install Linux:

  • The virtual machine will boot from the Linux ISO image.
  • Follow the on-screen instructions to install Linux on the virtual disk.

Select the keyboard configuration and the network connection configuration.

You may leave the proxy adress field empty if you don’t want to use any HTTP proxy to access the outside world “content😗”.

Keep the mirror address as default in the next step and click done.
Select use the entire disk option in the next step

Select the file system given as it is and continue.
Create your ubuntu account profile in the next step to log in to your system.

You may select to use the open ssh server in the next step if you want!
Select any server snap which you may find useful or will be using for our project or work in the next window. Don’t worry you can install them later also if you want!!

Now your installation will start — →

Wait till it gets completed, it will ask you to reboot your machine once it’s done.

Close the machine after clicking reboot and remove the installation media, i.e., the iso file from VM settings then again start the machine.

Now login to your Ubuntu server and let’s start your favourite desktop environment installation.

6. Installing the Desktop Environment:

  • To install the Ubuntu desktop system (gnome 3), run:
    $ sudo apt install ubuntu-desktop
    OR use transitional package name for Gnome 3 desktop:
    $ sudo apt install ubuntu-gnome-desktop
    Run the following to install the Kubuntu Plasma Desktop/Netbook system (KDE) (I prefer this because it’s very light weighted and smooth ):
    $ sudo apt install kubuntu-desktop
    Want Lubuntu Desktop environment?, Try:
    $ sudo apt install lubuntu-desktop
    Execute the following command to install Xubuntu desktop system:
    $ sudo apt install xubuntu-desktop
  • After the desktop installation process is finished, simply reboot your system once more. Then, presto! You’ll find yourself seamlessly logged into your brand-new and pristine Ubuntu desktop.
Here’s mine KDE Plasma Desktop

Voila! You’ve successfully installed the complete desktop edition of Ubuntu 20.04. Now, you’re all set to proceed with installing your preferred Ubuntu packages and software, allowing you to dive into your work seamlessly.
I hope this guide has helped you in installing a working Ubuntu 20.04 installation for your Mac Silicon.

If you have any queries or errors in your installation, feel free to jot me an email on shubhjain10102003@gmail.com 😇.

--

--