Getting Started with Multipass: Installing, Creating, and Managing Ubuntu Virtual Machines
This article introduces Multipass, a lightweight cross‑platform virtual‑machine tool, and provides step‑by‑step instructions for installing it, locating Ubuntu images, launching and managing VMs, executing commands, pausing, deleting, and automating setup with cloud‑init, highlighting its convenience and Ubuntu‑only limitation.
Multipass is a lightweight, cross‑platform command‑line tool for managing Ubuntu virtual machines on Linux, Windows, and macOS, offered as a free alternative to paid solutions like VMware.
To begin, download the appropriate installer from the official Multipass website and install it on your operating system (the example uses Windows).
After installation, verify the installed version:
$ multipass versionFind the available Ubuntu images you can launch:
$ multipass find
Image Aliases Version Description
snapcraft:core18 20201111 Snapcraft builder for Core 18
snapcraft:core20 20201111 Snapcraft builder for Core 20
core core16 20200818 Ubuntu Core 16
core18 20200812 Ubuntu Core 18
16.04 xenial 20210128 Ubuntu 16.04 LTS
18.04 bionic 20210129 Ubuntu 18.04 LTS
20.04 focal,lts 20210223 Ubuntu 20.04 LTS
20.10 groovy 20210209 Ubuntu 20.10
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 ApplianceCreate a new Ubuntu VM named dg :
$ multipass launch --name dg
Launched: dgCheck the VM’s release information:
$ multipass exec dg -- lsb_release -d
Description: Ubuntu 18.04.4 LTSList all running VMs:
Name State IPv4 Image
dg Running 192.168.24.5 Ubuntu 18.04 LTSView detailed information about the VM:
$ multipass info --all
Name: dg
State: Running
IPv4: 192.168.24.5
Release: Ubuntu 18.04.4 LTS
Image hash: fe3030933742 (Ubuntu 18.04 LTS)
Load: 0.00 0.00 0.00
Disk usage: 1.5G out of 4.7G
Memory usage: 112.1M out of 985.7MEnter the VM’s shell:
$ multipass shell dgExecute a single command inside the VM without entering the shell:
$ multipass exec dg --Pause and restart the VM:
# pause
$ multipass stop dg
# start
$ multipass start dgDelete and permanently purge the VM:
# delete
$ multipass delete dg
# purge
$ multipass purge dgFor reproducible environments, use the --cloud-init flag with a YAML configuration file. Example launch with cloud‑init:
$ multipass launch --name ubuntu --cloud-init config.yamlSample config.yaml :
#cloud-config
runcmd:
- curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
- sudo apt-get install -y nodejs
- wget https://releases.leanapp.cn/leancloud/lean-cli/releases/download/v0.21.0/lean-cli-x64.deb
- sudo dpkg -i lean-cli-x64.debThe runcmd section runs the listed commands the first time the VM starts.
In summary, Multipass provides a fast way to spin up Ubuntu VMs for testing Linux commands, small database clusters, or other experiments, though it currently supports only Ubuntu images.
Architect's Tech Stack
Java backend, microservices, distributed systems, containerized programming, and more.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.