Ubuntu instance on MAC using Multipass

Ramachandran Mani
2 min readJul 17, 2021

Often we think of testing what we built on mac or windows in other linux environments such as ubuntu. But procuring one through AWS or any cloud is time consuming or not pocket friendly either.

Multipass comes to the rescue for such scenarios. This documentation would help you with setting up an Ubuntu instance on mac with ease

What is multipass ?

Its a tool that helps to create vm on mac or windows with just a single command

In this document, we are going to see the step by step creation of the VM and accessing the same.

Step one is to Download the installer from multipass site and execute the same. Verify if the installation is successful by opening the terminal on mac and execute the below command

multipass version

If you see the version displayed, you are good to start the creation of VM.

First step is to allow multipass to allow accessing the virtual box

sudo multipass set local.driver=virtualbox

Then create the instance

multipass launch --name myubuntubox

Here myubuntubox is the name of the instance. The instance creation would take around 4–5 mins.

Time for a coffee break

Now, your instance should be all set. To verify the version of ubuntu and its status try,

multipass ls

This will list all the VMs that has been created through multipass, don’t be surprised if you see just one instance.

The next step is to allow folders from mac to shared by the VM.

multipass mount /Users/xyz/mountfolder myubuntubox

Now lets connect to the instance

multipass shell myubuntubox

You should be now inside your Ubuntu VM. Perform all that you want to do. Once done, you can exit the instance, just by typing exit

But your instance will be still in running state. If you wish to stop the instance you can do so by

multipass stop myubuntubox

And if you do not need the instance anymore you can delete the instance by

multipass delete myubuntubox

Now the instance would still be in delete state and still the vm is residing somewhere on your mac. if you want to get rid of it completely, then

multipass purge

Also note that purge would only remove the deleted instances.

Hope this is helpful.

--

--

Ramachandran Mani

Blogs about day to day issues faced as a Developer. Twitter @chandrumani