Multipass is a desktop tool for managing Ubuntu Server VMS. In this article, you will learn how to set up an Ubuntu Server VM using Multipass. Multipass helps you quickly create and manage Ubuntu Server virtual machines.

A, install,

The official website for Multipass is multipass.run/, and we can download the Linux/Windows/Mac version. Select a version to install. Note that VirtualBox must be installed before installing Windows.

Second, the use of

1. View the help information

See the help

multipass --help
#or
multipass -h
Copy the code

See help for a launch directive

multipass launch --help
#or
multipass launch -h
Copy the code

2. Create an instance

Create an instance using the latest LTS image

multipass launch --name ubuntu
Copy the code

View available images

multipass find
Copy the code

Create an instance using the specified LTS version image

Multipass launch --name Ubuntu1 18.04Copy the code

3. Operation example

Enter the shell terminal of the instance

#If the corresponding instance is not running, it will actively run the corresponding instance
multipass shell ubuntu
Copy the code

Execute the shell command of the instance

#View the instance version. If the instance is not running, an error will be displayed
multipass exec ubuntu -- lsb_release -a
Copy the code

4. View and manage instances

View the VM instance list

multipass list
Copy the code

Stop and start the instance

#Stop Ubuntu and Ubuntu 1
multipass stop ubuntu ubuntu1
#Start the ubuntu
multipass start ubuntu
Copy the code

Clear the instances that are not needed

multipass delete ubuntu1
multipass purge
Copy the code

Use –all pairs to operate on all instances

#Start all instances
multipass start --all
#Stop all instances
multipass stop --all
#Delete all instances
multipass delete --all
Copy the code