Getting Started With Multipass – Running Ubuntu VMs

Multipass gives you Ubuntu VMs on demand for any workstation. It is a tool developed by canonical that allows you to launch Ubuntu virtual machines on your local machine.

In this guide we will explore how to use multipass, from installing to launching vms and deleting if not needed.

# Install Multipass

You can use snap to install ubuntu. Use these commands:

sudo snap install multipass
sudo usermod -a -G microk8s ${USER}

# Launching a virtual machine

Upon installing multipass, you will get the multipass command in your terminal. Use this to launch the default ubuntu. By default, the LTS version of ubuntu will be launched – Ubuntu 20.04

multipass launch --name my-vm

# Using cloud-init file

Pass a cloud-init metadata file to an instance on launch like this:

multipass launch -n bar --cloud-init cloud-config.yaml

# Customize memory and disk size

You can use these arguments to specify the memory and disk size requirements:

multipass launch --name microk8s-vm --mem 4G --disk 40G

# Execute commands in the instance

Use the exec command to run commands inside the instance like in the following example:

multipass exec foo -- lsb_release -a

# Logging into the VM

If you want to SSH into the VM, use these commands:

multipass shell microk8s

# List instances

To see the list of instances launched by multipass, use this command:

multipass list

# Starting andn stopping the instances

Use this command to stop the instance

multipass stop foo bar

Use this command to start the instance:

multipass start foo

# Deleting instances

When no longer needed, you can clean up what you don’t need. The delete comand will not remove everything, so there is a purge command:

multipass delete bar
multipass purge

# Launching instances other than default

Find alternate images to launch with multipass:

multipass find

# Getting help

Use these commands to see the available options with multipass:

multipass help
multipass help <command>
comments powered by Disqus
Citizix Ltd
Built with Hugo
Theme Stack designed by Jimmy