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.
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.
Getting Started
Download and install Multipass from the official website for your operating system (example shown for Windows).
After installation, verify the version:
$ multipass versionCreate 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 DescriptionLaunch a new container named dg:
$ multipass launch --name dg
Launched: dgCheck the Ubuntu version inside the VM:
$ multipass exec dg -- lsb_release -d
Description: Ubuntu 18.04.4 LTSManaging the VM
List VMs after creation:
Name State IPv4 Image
dg Running 192.168.24.5 Ubuntu 18.04 LTSThe VM is running with IP address 192.168.24.5.
Enter the VM shell : $ multipass shell dg Alternatively, use multipass exec for one‑off commands.
Pause / restart :
# pause
$ multipass stop dg
# start
$ multipass start dgDelete / purge :
# delete
$ multipass delete dg
# purge
$ multipass purge dgAutomating Configuration
Use --cloud-init with a YAML file to run commands on first boot:
$ 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.debThe 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/
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.
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.
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.
