Multipass is a cross-platform, lightweight Ubuntu virtual machine (VIM) manager that runs on Linux, Windows, and macOS. It builds cloud-style Ubuntu VMs, allowing developers to quickly set up a new Ubuntu environment with a single command.
Intended as a development tool, here are some of the key benefits of using Multipass:
- Setting up a local development environment and testing can be time-consuming, but Multipass simplifies the process by automating all setup and teardown.
- Developers can use Multipass to generate fresh, customized Linux development environments on any machine and to prototype cloud installations.
- Multipass is the quickest way for Mac and Windows users to acquire an Ubuntu command line on their PC.
- New Ubuntu users can employ Multipass as a sandbox to experiment with new features without messing up their host computer or having to dual boot.
It is crucial to highlight that Multipass runs a VM with low overhead by using KVM on Linux, Hyper-V on Windows, and HyperKit on macOS. VirtualBox can also be used on Windows and macOS. And Multipass will automatically retrieve and update images for you.
Furthermore, Multipass has a growing library of images that allow you to launch purpose-built VMs or bespoke VMs you’ve customized yourself via its robust cloud-init interface.
This guide shows how to install and use Multipass on a Linux operating system.
Install Multipass on Linux
Multipass is available as a snap package, thus making it easy to install on the most popular Linux distribution that supports snaps.
To install Multipass on your computer, you must have Snap installed on the system, if not, use the right set of commands for your Linux distribution.
Install Multipass on Ubuntu
$ sudo apt update $ sudo apt install snapd $ sudo snap install multipass
Install Multipass on Linux Mint
$ sudo rm /etc/apt/preferences.d/nosnap.pref $ sudo apt update $ sudo apt install snapd $ sudo snap install multipass
Install Multipass on Debian
$ sudo apt update $ sudo apt install snapd $ sudo snap install core $ sudo snap install multipass
Install Multipass on Fedora
$ sudo dnf install snapd $ sudo ln -s /var/lib/snapd/snap /snap $ sudo snap install multipass
Install Multipass on RHEL
$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm [RHEL 9] $ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm [RHEL 8] $ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm [RHEL 7] $ sudo dnf upgrade $ sudo subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms" $ sudo yum update $ sudo yum install snapd $ sudo systemctl enable --now snapd.socket $ sudo ln -s /var/lib/snapd/snap /snap $ sudo snap install multipass
Install Multipass on openSUSE
$ sudo zypper addrepo --refresh https://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_15.2 snappy $ sudo zypper --gpg-auto-import-keys refresh $ sudo zypper dup --from snappy $ sudo zypper install snapd $ sudo systemctl enable --now snapd $ sudo snap install multipass
Install Multipass on Arch Linux
$ git clone https://aur.archlinux.org/snapd.git $ cd snapd $ makepkg -si $ sudo systemctl enable --now snapd.socket $ sudo ln -s /var/lib/snapd/snap /snap $ sudo snap install multipass
After installing multipass on your machine, you can use it to run Ubuntu instances locally from your command line, as explained in the sections that follow.
Find Available Ubuntu Images
Run the following multipass command to see a list of available multipass images from which you can download and create an instance:
$ multipass find
Download Ubuntu Image
Once you’ve identified which Multipass image to use, use the launch
command to download, create, and launch a local Ubuntu instance from it.
This example demonstrates how to use the Ubuntu 22.04 image:
$ multipass launch 22.04
launch failed: Another virtual machine manager is currently running. Please shut it down before starting a Multipass instance.
To proceed, shut down the other virtual machine. Then try running multipass again.
If your launch command was successful, the Ubuntu image was downloaded, and the local Ubuntu instance was created and started, the instance should have a name randomly generated by Multipass. As indicated in the screenshot, the instance name, in this case, is validating-goat.
The new instance is launched by default with 1 CPU, 1GB of RAM, and 5GB of storage space.
List all Available Instances
The multipass list
command lists all the created local instances and some of their properties:
$ multipass list
You can use the info
command to display information about an instance, such as its state, IP address, release, image hash, number of CPU(s), load, disk usage, memory usage, and mounts, as seen in the following screenshot:
$ multipass info validating-goat
Open Shell in Ubuntu Instance
To launch a shell in a running instance (for example, validating-goat), use the shell
command:
$ multipass shell validating-goat
After launching a shell into a running instance, you can run commands on it normally. For example, you can update the apt package index on it as shown.
$ sudo apt update
Start or Stop Instances
To stop or start an instance, use these commands, respectively:
$ multipass stop validating-goat $ multipass start validating-goat
Delete a Local Instance
To delete a local instance, whether it is in running or stopped, use the delete
command as shown.
$ multipass list $ multipass delete exalted-meerkat
Start an Instance with Custom Settings
You can also launch an instance with customized specifications (such as name, number of CPU(s), RAM size, and disk size as shown.
$ multipass launch 22.04 --name tecmint-test --memory 1G --disk 10G --cpus 2 $ multipass info tecmint-test
Run a Web Server in Your Ubuntu Instance
Let’s look at how to use your local Ubuntu instance. This example shows how to install and run a basic NGINX web server as shown:
$ multipass shell tecmint-test $ sudo apt update $ sudo apt install nginx
After installing NGINX, the service should be started automatically (this is a known behavior on on Ubuntu and its derivatives). Use the following systemctl command to ensure that it is up and running:
$ systemctl status nginx
Now use your running instance’s IP address (which you can get from the list of local instances) to make a request to NGINX and view the default welcome web page, as shown in the following screenshot.
Uninstall Multipass on Linux
To remove Multipass from your computer, run the following command:
$ sudo snap remove multipass
For more information about Multipass command-line options, run the following command:
$ multipass -h
You’ve successfully installed Multipass and learned how to use it to launch and manage Ubuntu instances on your computer quickly, efficiently, and reliably.
For any comments, please contact us using the feedback form below.
The above is the detailed content of Multipass - Run Virtual Ubuntu Instances in Linux. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

There are three ways to create empty files in the command line: First, the simplest and safest use of the touch command, which is suitable for debugging scripts or placeholder files; Second, it is quickly created through > redirection but will clear existing content, which is suitable for initializing log files; Third, use echo"> file name to create a file with an empty string, or use echo-n""> file name to avoid line breaks. These three methods have their own applicable scenarios, and choosing the right method can help you complete the task more efficiently.

Are you looking for good software to write mathematical equations? If so, this article provides the top 5 equation editors that you can easily install on your favorite Linux distribution.In addition to being compatible with different types of mathema

Eclipse is a free integrated development environment (IDE) that programmers around the world use to write software, primarily in Java, but also in other major programming languages using Eclipse plugins.The latest release of Eclipse IDE 2023?06 does

Linux administrators should be familiar with the command-line environment. Since GUI (Graphical User Interface) mode in Linux servers is not commonly installed.SSH may be the most popular protocol to enable Linux administrators to manage the servers

Linux has a rich collection of commands, and while many of them are powerful and useful for various tasks, there are also some funny and whimsical commands that you can try out for amusement. 1. sl Command (Steam Locomotive) You might be aware of the

LXD is described as the next-generation container and virtual machine manager that offers an immersive for Linux systems running inside containers or as virtual machines. It provides images for an inordinate number of Linux distributions with support

PPA is an important tool for Ubuntu users to expand their software sources. 1. When searching for PPA, you should visit Launchpad.net, confirm the official PPA in the project official website or document, and read the description and user comments to ensure its security and maintenance status; 2. Add PPA to use the terminal command sudoadd-apt-repositoryppa:/, and then run sudoaptupdate to update the package list; 3. Manage PPAs to view the added list through the grep command, use the --remove parameter to remove or manually delete the .list file to avoid problems caused by incompatibility or stopping updates; 4. Use PPA to weigh the necessity and prioritize the situations that the official does not provide or require a new version of the software.

Gogo is a remarkable tool to bookmark directories inside your Linux shell. It helps you create shortcuts for long and complex paths in Linux. This way, you no longer need to type or memorize lengthy paths on Linux.For example, if there's a directory
