How to Run an Ubuntu Linux Virtual Machine on macOS running M1/M2 processor.

This guide will walk through the complete steps for configuring a Linux Ubuntu VM on M1/M2 Mac computers. To be precise, we will cover all the required steps to customize your first Linux VM to run in quickly.

Here are the steps at a high level before you start.

  • Install the Virtualization platform, UTM
  • Get an ARM-supported OS iso
  • Configure a Linux VM on M1/M2 mac
    • Getting started with UTM
    • Choose Virtualization option
    • Choosing the OS flavour
    • Linux VM Configuration
    • Hardware customization – Memory & CPU
    • Storage size settings
    • Shared Directory
    • Configuration Summary
    • Start the OS installation
    • Running the Ubuntu installer

Step #1 Install a Virtualization platform

Software Virtualization has two primary components:

  1. Host Machine, in our case, this is your m1 / m2-based macOS
  2. Guest Machine, also called Virtual Machine or VM – in our case, is Ubuntu Linux.

The virtualization platform facilitates the guest os, a Virtual environment. Here we use UTM, so you can run a complete sandbox environment inside your Virtual Machine without impacting any other files on your host-machine base OS.

We have chosen UTM for ARM-based macOS since it is an Open source and a free solution. (there are other platforms available, such as Parallels and VMware Fusion).

To start with:

  1. Download the free version of UTM virtualization software for your Apple silicon
  2. Install the UTM app on your macOS.

If you are using the UTM App on mac for the first time, I would recommend you to go to this article first:

Comprehensive guide to setup UTM on M1/M2 macOS

Step #2 Get an ARM-supported OS iso

You would require an ARM-supported Linux Operating system to run Linux on M1/M2-based Mac.

Ubuntu and many other OS currently support arm architecture, and we will use Ubuntu in this guide.

Step #3 Configuring a Linux VM on M1/M2 mac

VM config step #1 Getting started with UTM

Firstly, Open your UTM app, and open a new VM creation menu (the plus symbol)

As mentioned before, please refer to this complete guide on UTM if required. Here is a preview of what the UTM Virtual Machine app console looks like:

mac virtualization console - utm
UTM console macOS

UTM Virtualization on m1 mac

VM config step #2 Choose Virtualization option

New VM customization menu, select the Virtualize option.

VM Virtual vs emulate option selection
Linux VM – select full virtualization

VM config step #3Choosing the OS flavour

Under the Operating System selection, select Linux since we will be using Ubuntu Linux as our guest OS.

VM guest os selection
VM selection of OS type

VM config step #4 Linux VM Configuration

From here on, you will get an advanced Linux VM customization menu.

From the first page, map your Ubuntu iso file, as shown below.

UTM Virtualmachine, mapping the ISO image
Ubuntu ISO Mapping to the VM

You can download the latest version of Ubuntu ARM isos from the official pages, and links are given below.

VM config step #5 Hardware customization – Memory & CPU

Memory – Under Hardware, you can set the RAM – Memory. I recommend leaving it at the default value (4096 or 4GB).

CPU Selection – again, do not change this unless you are aware of the performance issue to your host OS if you add more virtual CPUs to the guest.

VM hardware settings
Memory and CPU Cores selection

VM config step #6 Storage size settings

I saw the default value is set to 64GB. If this is not suitable for you, you may change it. Please note the space you allocate here will be occupied by your host machine disk.

VM storage settings
VM Storage selection

VM config step #7 Shared Directory

UTM provides a feature to share your MacOS directory with the Linux Guest. I did not use this feature here in this guide for simplicity.

VM shared directory settings
Sharing directory between macOS host and Linux guest

VM config step #8 Configuration Summary

Finally, you will get a summarized view of your advanced VM configurations. You may edit it here, or a few options would be editable even after creating the VM.

VM configuration summary
Linux VM Config summary / editor

VM config step #9 Start the OS installation

Your Virtual Machine hardware is ready with this step. You may change the settings or start the installation.

VM Ubuntu ready to start
UTM Linux VM home page edit options

VM config step #10 Running the Ubuntu installer

When you are ready to start the OS installation, just click the play button and your OS installation menu will come, just like you are installing an OS on a physical computer.

Ubuntu VM starting the installation
m1 linux VM ubuntu installation

You can follow the OS installation menu options to complete the Ubuntu installation step. I recommend you choose the default options provided by the install Wizard if you are unsure of your changes.

FAQ: Can I change the VM hardware setting after the OS installation

Yes! When the VM is in the stopped state, you can change most of ( not all ) the VM configurations after the Guest OS iinstallation.

Related articles:

Conclusion

This how-to guide has covered all steps required to run an Ubuntu Virtual Machine on macOS m1/m2 ARM architecture using UTM Virtualization. My experiment used a MacBook Pro M2, with 16GB Memory and 512GB SSD. The Ubuntu VM performance is excellent. Good luck with your new Virtual Machine development environment!