Running a Ubuntu VM on a Mac M1
If you’re brand-new to Python and Ansible, you might be a bit reluctant to install a bunch of packages and Ansible collections on your production laptop to start building your automation skills. The usual recommendation I make to get past that hurdle is to create a Ubuntu virtual machine that can be destroyed every time to mess it up.
Creating a virtual machine is trivial on Linux and MacOS with Intel CPU (install VirtualBox and Vagrant). The same toolset no longer works on newer Macs with M1 CPU (VMware Fusion is in tech preview, so we’re getting there), but there’s an amazingly simple alternative: Multipass by Canonical.
Here’a three-step process to getting a running Ubuntu VM on your Mac:
- Install Multipass with
brew install --cask multipass
- Start the primary Ubuntu VM instance with
multipass start. Once the VM is started, your home directory is mapped into the
Homefolder of the home directory of
- Connect to the VM with
- Enjoy ;)
- multipass is just a nice wrapper around the built-in MacOS hypervisor.
- You’ll get an ARM version of Ubuntu. It looks like nobody solved the problem of running x86 virtual machines on M1 silicon yet.
[email protected]:~$ uname -a Linux primary 5.4.0-99-generic #112-Ubuntu SMP Wed Feb 2 17:13:12 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
- I added multipass as an option to the Create a Simple Ansible Test Environment.
Or.... just use https://mac.getutm.app and voila, a little UI around Hypervisor.Framework.
three are many videos and many other sources: eg installing windows: https://www.youtube.com/watch?v=FWT5RGt26Ag
UTM uses qemu, and qemu has Hypervisor.Framework support, done
Interesting... it looks like I could run x86 network devices (VMs) on Apple silicon. Have to check that out ;)
Thanks a million for the pointer!
i'm running (or trying to) Ubuntu 20.04 x86 in a Macbook pro M1 using UTM... It works but performance is horrible I'm not able to use it like that :(
Performance might not be that good though. Not like native speed for sure.
Get Parallels Desktop VM. Every flavor of Linux runs like a charm on the ARM64 architecture. And Windows 11 too.