Operations 6 min read

How to Quickly Spin Up Ubuntu VMs with Multipass: A Step‑by‑Step Guide

This guide introduces Multipass, a lightweight cross‑platform VM manager, and walks through installing it, launching Ubuntu instances, checking status, accessing shells, and automating setup with cloud‑init, while also covering pause, restart, and deletion commands.

Java Captain
Java Captain
Java Captain
How to Quickly Spin Up Ubuntu VMs with Multipass: A Step‑by‑Step Guide

While VMware is a well‑known VM tool, it requires a paid license; Multipass offers a free, lightweight alternative that runs on Linux, Windows, and macOS.

Multipass

Multipass is a lightweight command‑line VM management tool that simplifies creating and managing Ubuntu instances.

Image
Image

Getting Started

Download and install Multipass from the official website for your operating system (example shown for Windows).

Image
Image

After installation, verify the version:

$ multipass version

Create an Ubuntu VM

List available Ubuntu images: $ multipass find The command returns a table of images, such as core18, core20, 16.04, 18.04, 20.04, etc.

Image               Aliases   Version   Description

Launch a new container named dg:

$ multipass launch --name dg
Launched: dg

Check the Ubuntu version inside the VM:

$ multipass exec dg -- lsb_release -d
Description:    Ubuntu 18.04.4 LTS

Managing the VM

List VMs after creation:

Name        State    IPv4          Image
dg          Running  192.168.24.5  Ubuntu 18.04 LTS

The VM is running with IP address 192.168.24.5.

Image
Image

Enter the VM shell : $ multipass shell dg Alternatively, use multipass exec for one‑off commands.

Pause / restart :

# pause
$ multipass stop dg
# start
$ multipass start dg

Delete / purge :

# delete
$ multipass delete dg
# purge
$ multipass purge dg

Automating Configuration

Use --cloud-init with a YAML file to run commands on first boot:

$ multipass launch --name ubuntu --cloud-init config.yaml

Example 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.deb

The runcmd section runs these commands when the container first starts.

Conclusion

After using Multipass for a while, it proves useful for quick Linux experiments and small database clusters, though it only supports Ubuntu images because it is developed by Canonical.

Related Links

Official site: https://multipass.run/ Documentation: https://multipass.run/docs/

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

CLIvmUbuntuCloud‑InitMultipass
Java Captain
Written by

Java Captain

Focused on Java technologies: SSM, the Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading; occasionally covers DevOps tools like Jenkins, Nexus, Docker, ELK; shares practical tech insights and is dedicated to full‑stack Java development.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.