A new technology I found recently was Ubuntu Multipass. It allows you to spin up Ubuntu VMs on demand and is incredibly easy to use. This post will be about installing and basic usage of Ubuntu Multipass.

Installation

Multipass can be installed using snap.

sudo snap install multipass

Creating Instances

Creating a multipass Ubuntu instance is a single command.

dan@ubuntu-test:~$ multipass launch --name firstinstance
Launched: firstinstance

Running Commands

To run a command on an instance you can use the following command.

multipass run vm_name -- command here

So for example you can run bash to get an interactive shell in the instance.

multipass run firstinstance -- bash

Cloud-Init

An awesome part about multipass is the ability to use cloudinit configurations with these instances. It’s incredibly easy too. The --cloud-init argument will use your cloud-init configuration during the startup.

multipass launch --name numbertwo --cloud-init clout-init.yml

Instance Management

List Instances

multipass list

Stop Instances

multipass stop instance_name

Start Instances

multipass start instance_name

Delete Instances

multipass delete instance name
multipass purge

Other Images

To find other images use the following command.

multipass find

Sample output:

xadlien@swift3x:~$ multipass find
Image                       Aliases           Version          Description
snapcraft:core18            18.04             20201111         Snapcraft builder for Core 18
snapcraft:core20            20.04             20210921         Snapcraft builder for Core 20
snapcraft:core              16.04             20210929         Snapcraft builder for Core 16
core                        core16            20200818         Ubuntu Core 16
core18                                        20211124         Ubuntu Core 18
18.04                       bionic            20220104         Ubuntu 18.04 LTS
20.04                       focal,lts         20220111         Ubuntu 20.04 LTS
21.04                       hirsute           20220113         Ubuntu 21.04
21.10                       impish            20220111         Ubuntu 21.10
daily:22.04                 devel,jammy       20220114         Ubuntu 22.04 LTS
appliance:adguard-home                        20200812         Ubuntu AdGuard Home Appliance
appliance:mosquitto                           20200812         Ubuntu Mosquitto Appliance
appliance:nextcloud                           20200812         Ubuntu Nextcloud Appliance
appliance:openhab                             20200812         Ubuntu openHAB Home Appliance
appliance:plexmediaserver                     20200812         Ubuntu Plex Media Server Appliance
anbox-cloud-appliance                         latest           Anbox Cloud Appliance
minikube                                      latest           minikube is local Kubernetes

To user one of the other images specify the image name at the end of the launch command.

multipass launch --name dev 21.10

Sources

Some great sources for this info can be found here:

Issues

I’ve had a lot of issues with multipass recently where it won’t start instances or would just hang. When I CTRL+C out of the delete command and list again it shows the instance as deleted and I was able to launch another instance.