How to Run Ubuntu instances on M1-Based Mac

·

2 min read

How to Run Ubuntu instances on M1-Based Mac

I got a new laptop a few days ago and one of my concerns is the compatibility with my day to day work tools. One of them is to virtualize linux instances to emulate a local kubernetes cluster.

Surfing the internet, 99.9% of the results say that you can only do it with Parallels or VMware Fusion, the truth is that I am not a fan of these tools.

However I wanted to try with one of my favorite tools Multipass, which until then I used it with VirtualBox. Unfortunately VirtualBox does not work on M1-Based Mac.

https://ubuntu.com/blog/canonical-transforms-linux-on-mac#:~:text=Multipass%2C%20the%20quickest%20way%20to,as%20little%20as%2020%20seconds.

But I was surprised to discover that Canonical had already been working on a version for M1-Based Mac without Virtualbox as of Multipass version 1.18.

image.png

I tried it and in two steps I had an instance of ubuntu running on my m1 based mac.

Below I quote the two steps needed:

  1. Install Multipass for macOS at this link.

  2. Open the terminal and run:

$ multipass launch --name node1

image.png

Fifty seconds later ...

image.png

image.png

We can check the instance type with the following command:

$ multipass exec node1 -- lsb_release -a

image.png

We can also enter to our Ubuntu instance:

image.png

Do not forget to stop your instance when you are not using it, you can even delete it completely if necessary. With the following commands:

$ multipass stop node1
$ multipass delete node1
$ multipass purge

If you wish, you can adjust the resources assigned to your instance, to generate several of them. You can view the available properties when running a new instance with the following command:

$ multipass launch -h

image.png

I hope you find it helpful, thank you very much for reaching the end of the post :).

Happy hacking!

Did you find this article valuable?

Support Staz by becoming a sponsor. Any amount is appreciated!