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.