The simplest way to run an Ubuntu Linux virtual machine on a new Apple M1 chip macOS machine is to use Multipass.
First, install Multipass:
$ brew install --cask multipass
There should be a primary VM instance available already.
To start the primary Ubuntu instance:
$ multipass start
It should show:
Show running instances:
$ multipass list
The output should be similar to:
Name State IPv4 Image primary Running 192.168.64.2 Ubuntu 20.04 LTS
Now we can SSH into the VM using:
$ multipass shell
You should see a prompt for the shell inside the Ubuntu VM:
Your Ubuntu VM is now ready to use!
Additionally, to mount a directory to access files from the host machine inside the VM, see this post: