Master Multipass: Quickly Spin Up Ubuntu VMs on Any OS
This guide walks you through installing Multipass, launching Ubuntu virtual machines, managing them with commands, and automating setup via cloud‑init, providing a lightweight, cross‑platform solution for developers and ops engineers.
Multipass
Multipass is a lightweight, cross‑platform virtual‑machine command‑management tool that runs on Linux, Windows, and macOS.
Getting Started
Download and install Multipass for your operating system; the example below uses the Windows installer.
Check Version
$ multipass versionCreate an Ubuntu VM
First, list available Ubuntu images: $ multipass find The command returns a list of images such as core18, 20.04, 18.04, etc.
Create a new instance named dg:
$ multipass launch --name dg
Launched: dgVerify the VM is running:
Name State IPv4 Image
dg Running 192.168.24.5 Ubuntu 18.04 LTSInspect the VM
Show detailed information about the instance:
$ 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.7MInteract with the VM
Open a shell inside the instance: $ multipass shell dg Or run a single command without entering the shell:
$ multipass exec dg -- lsb_release -d
Description: Ubuntu 18.04.4 LTSPause, Restart, and Delete
Pause the VM:
# pause
$ multipass stop dgRestart the VM:
# start
$ multipass start dgDelete (mark for removal) and purge (release resources):
# delete
$ multipass delete dg
# purge
$ multipass purge dgAutomate with Cloud‑Init
Use the --cloud-init flag to apply an initialization script when launching a VM:
$ multipass launch --name ubuntu --cloud-init config.yamlExample 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.debConclusion
Multipass provides a fast way to spin up Ubuntu environments for testing, small‑scale database clusters, or any Linux‑based experiment, though it currently supports only Ubuntu images because it is developed by Canonical.
Related Links
Official site: https://multipass.run/
Documentation: https://multipass.run/docs/
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
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.
