Multipass is a very lightweight VM manager that can be used to launch & manage VMs with a single Linux command. It is available on Linux, macOS as well as Windows. On Windows, it used Hyper-V, on Linux, it uses KVM & on Mac it used HyperKit.

It can simulate a cloud environment with the support of cloud-init. It helps to create a new development or testing environment with ease. It also supports VirtualBox on macOS & Linux also. In this tutorial, we will learn how to install Multipass on Ubuntu.

Recommended Read: Multi-domain SSL Certificates: Everything You Need to Know!

Also Read: Use TERRAFORM for Google Cloud (GCP) – Create a VPC


Install Multipass on Ubuntu

To install Multipass on Ubuntu, we need to have SNAP package manager installed on our system, which comes installed in all the new Ubuntu OS. But in case you are still using an older version where it’s not installed, you can install it with the following command,

$ sudo apt-get install snapd

Now we can install Multipass on Ubuntu with the help of SNAP, with the following command,

$ sudo snap install multipass

We will now discuss some important multipass to manage the VMs using multipass.


Multipass Commands

1- List all available images

To list all the images that we can use, execute the following command,

$ multipass find

We can now choose the name of the OS that we want to launch.

 

2- To launch an instance

To  launch an instance using multipass, choose the OS version from the above-mentioned command & then launch it with the following command,

$ multipass launch 20.04

It will then create a Ubuntu 20.04 VM on our system.

3- List all the running multipass instances

To get the complete list of all the running multipass instances, use the following command,

$ multipass list

 

4- Stop a running instance

To stop a running instance, use the following command

$ multipass stop name_of_the_VM

 

5- Delete a running instance

To delete a running instance, use the following command,

$ multipass delete name_of_the_VM

Then we need to run another command to completely purge the instance,

$ multipass purge

 

6- Get detailed information on the running instance

We can get the name of the running instance using the above-mentioned command. Then we can use the name to get the detailed information for the running instance with the following command,

$ multipass info name_of_the_VM

 

7- SSH into the running multipass VM

To get the shell access of the running VM, use the following command,

$ multipass shell name_of_the_VM

 

8- Run single command inside the VM from outside

To only run a single command & not get the shell access, we can use the following command,

$ multipass exec name_of_the_VM  -- command

Example-

$ multipass exec name_of_the_VM –– ls -ltr

 

9- Get help

Above mentioned are some commands that we can use to manage multipass. We can also get help for multipass command or a subcommand,

$ multipass help

$ multipass subcommand help

With this, we complete our tutorial on how to install Multipass on Ubuntu. Please do send in any questions or queries using the comment box below.

If you think we have helped you or just want to support us, please consider these:-

Connect to us: Facebook | Twitter

Linux TechLab is thankful for your continued support.