The easiest way to start Ubuntu VM on Mac M1

Puneeth Prakash
4 min readJun 18, 2024

--

In this blog post, we will see how to use the Multipass tool to create Ubuntu VMs on your Mac M1.

Multipass tool can also be installed on Windows OR Linux machines.

Step 1:

  • Download and install multipass from the following link:

Link: https://multipass.run/install

or open a terminal and just run:

brew install multipass

Step 2:

  • Once it is installed successfully, open a terminal and run the command “multipass version” to get the multipass version installed. You can then run the “multipass help” to see the list of options available.

Run the “multipass find” command without any arguments, to list all the available images.

Run the “multipass list” command to list the available instances or snapshots.

This will show any running / stopped / deleted instances that you have created.

multipass launch” command will launch the latest Ubuntu build available.

multipass stop <instance_name>” will stop the instance.

multipass delete <instance_name>” can be used to delete an instance.

multipass recover <instance_name>” can be used to recover a deleted instance.

A deleted instance can only be started after it is recovered.

multipass purge” command will purge all the deleted instances. (stopped instances will not be affected by this command).

multipass info <instance_name>” will give all the information about an instance.

From the above output, you notice that multipass assigned 1 CPU, around 1GB of RAM, and 5GB of disk space by default.

This may not be sufficient in most cases, especially when you are trying to run a kubernetes cluster on these VMs, which needs a minimum of 2CPUs and 1700 MB RAM.

You can use the following command to set custom CPU, RAM, HDD and also assign a name for the instance (here I am setting 2 CPUs, 4GB of RAM, 50GB of HDD and a custom instance name — node1):

multipass launch --name node1 --cpus 2 --memory 4G --disk 50G

and if you want to launch a specific version of Ubuntu, then specify the alias next to the launch command as shown below:

multipass launch 22.04

You can login to the instance using “multipass shell <instance_name>“ command.

Use the transfer option to transfer a file from a host machine to an instance or vice-versa:

multipass transfer <file_to_transfer_from_host_machine> <instance_name>:<destination_file_name_on_instance>

or

multipass transfer <instance_name>:<file_to_transfer_from_instance> <destination_file_name_on_host_machine>

The above commands are helpful when you want to transfer individual files, but you could also mount a location from host machine to instance:

multipass mount <location_on_host> <instance_name>:<destination_location>

By default, there is no GUI for the Ubuntu instances created using multipass.

You can easily install it using the following command:

multipass shell <instance_name>

sudo apt update

sudo apt install ubuntu-desktop xrdp -y

sudo passwd ubuntu

sudo reboot

Use “Microsoft Remote Desktop” application on your mac to connect to your Ubuntu VM:

--

--

Puneeth Prakash
Puneeth Prakash

Written by Puneeth Prakash

I work as a Subject Matter Expert in FMW at Oracle. This blogging space is to share my learning experiences. Views expressed here are solely my own.

No responses yet