How to run Ubuntu 22.04 VMs on Apple M1 ARM-based systems for free

Paul Robu
3 min readMay 6, 2022

--

There’s already a while since Apple announced their new M1 chip and the transition to Apple silicon for the entire Mac product line.
If you are switching now from their previous Intel-based systems and want to continue using Oracle VirtualBox for running some virtual machines for development or personal use, you are in for a surprise: VirtualBox supports only x86 hardware.

Ubuntu is available not only on x86 architectures, but also has ARM-based versions. So how to deploy an Ubuntu 22.04 virtual machine on the new M1?

One option is to install Multipass, from Canonical:

❯ brew install multipass

Starting with version 1.9.0+mac, Multipass includes an image for Ubuntu 22.04 LTS Jammy Jellyfish:

❯ multipass version
multipass 1.9.0+mac
multipassd 1.9.0+mac
❯ multipass find
Image Aliases Version Description
18.04 bionic 20220505 Ubuntu 18.04 LTS
20.04 focal,lts 20220419 Ubuntu 20.04 LTS
21.10 impish 20220309 Ubuntu 21.10
22.04 jammy 20220420 Ubuntu 22.04 LTS
anbox-cloud-appliance latest Anbox Cloud Appliance
charm-dev latest A development and testing environment for charmers
docker latest A Docker environment with Portainer and related tools
minikube latest minikube is local Kubernetes

To install it, simply run launch command and give the image name as parameter:

❯ multipass launch 22.04

This will deploy an Ubuntu image with the default resource configurations (do multipass launch — help for details). But if you plan to use the guest OS in graphical mode, better to increase the amount of available resources. Below example will launch a 22.04 Ubuntu VM named primary with 2 CPUs, 4 GB of RAM and 50 GB of disk space.

❯ multipass launch 22.04 -n primary -c 2 -m 4G -d 50G

Next, for installing a desktop environment (because the images used by Multipass don’t have a pre-installed graphical desktop), we connect into VM by running multipass shell VMname and start desktop installation:

❯ multipass shell 
Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.15.0–25-generic aarch64)

$ sudo apt update
$ sudo apt install ubuntu-desktop xrdp -y

Alternatively, below commands will install Kylin Desktop Environment (the official Chinese version of Ubuntu that also supports English) and an RDP server:

$ sudo apt update && sudo apt upgrade
$ sudo apt install ubuntukylin-desktop xrdp -y

Finally, with last command we either set a password for the default ubuntu OS user:

sudo passwd ubuntu

or create a new OS user that will be used for connecting in graphical mode:

sudo adduser username
sudo usermod -aG sudo username
Use “Microsoft Remote Desktop” application from the Mac App Store to connect to the VM in graphical mode.

To access the newly-installed desktop, first will have to discover the IP address of the VM, either by running “ip a” command within the Ubuntu shell, or by running “multipass list” on your Mac host.

Use the IP address to connect using applications like “Microsoft Remote Desktop”, that can be downloaded from App Store for free and you will be greeted with the Ubuntu 22.04 welcome page.

Welcome to Ubuntu 22.04! greeting screen
Ubuntu 22.04 welcome page on Multipass

Update:

As pointed out in a recent comment (thanks @Sashanavai), another option is to use UTM. Follow the steps at https://docs.getutm.app/guides/ubuntu/

Under the hood of UTM is QEMU, hence in addition to ARM64 architecture it can also emulate (lower performance) x86_64 operating systems: https://mac.getutm.app/gallery/

UTM running Ubuntu 22.04.1 desktop
UTM emulating Ubuntu 22.04.1 Desktop for Intel

--

--