wayanjimmy
ENID

Learning Virtual Machine with Multipass

Why do we need Virtual Machines? #

Exploring something new is safer to do in an isolated environment first. For example, in recent weeks I’ve been exploring whether Podman can replace Docker in my daily workflow.

It would be very risky if I directly replace Docker with Podman. Instead, I can experiment first through a VM (Virtual Machine), perform testing with several conditions I need, such as:

If I can answer the questions above, then my confidence increases to be able to replace Docker with Podman, and in the process I don’t need to tinker with my Host machine configuration, because the stability of the Host Machine is very important for the smoothness of daily work.

Instead, what I tinker with is the VM because if it fails, I just destroy and create a new VM again, do several iterations, until I can answer all the questions above.

Why Multipass? #

As an Ubuntu user, Multipass already covers what I need:

Compared to Vagrant, I feel Multipass is an improvement!

How to create a VM #

For installation, you can check directly from the documentation. To create a VM use the command below.

bash
multipass launch devbox

devbox is the name of the VM that you can change, you can also configure many CPU, Memory and Storage allocated for this VM.

bash
multipass launch -c 2 -d 30G -m 2G --name devbox 24.04

The command above means create a VM with 2 CPU, 30 Giga Storage, 2 Giga Memory, with the name devbox and Ubuntu version 24.04

SSH into the VM #

To start tinkering into the VM, we need to ssh first

bash
multipass shell devbox

To start, try running htop

bash
htop

Run htop

from here you will get information that this VM’s CPU is limited to 2 cores, according to the specifications we made, right?

once in the VM we can start installing the application we want to tinker with.

bash
sudo apt update
sudo apt upgrade

Run htop

Let’s try installing podman and run the hello world container.

bash
sudo apt install -y podman podman-docker

Run Podman Hello World

Delete VM #

If you feel you’ve had enough playing with the VM, you can delete it, and purge to free up the storage previously claimed by the VM.

bash
multipass delete devbox
multipass purge

Conclusion #

Subscribe