Getting started Multipass

Getting started

Your first five minutes with Multipass should give you a sense of how much fun it is to have a lightweight cloud handy, free of charge, on your workstation. Let’s launch a few LTS instances, list them, exec a command or script inside the instance, use cloud-init and clean up old instances.

Launch an instance (by default you get the current Ubuntu LTS)
multipass launch --name ubuntu-lts

Run commands in that instance, try running bash (logout or ctrl-d to quit)
multipass exec ubuntu-lts -- lsb_release -a

Pass a cloud-init metadata file to an instance on launch see using cloud-init with multipass for more details
multipass launch -n ubuntu-lts-custom --cloud-init cloud-config.yaml

See your instances
multipass list

Stop and start instances
multipass stop ubuntu-lts ubuntu-lts-custom
multipass start ubuntu-lts

Clean up what you don’t need
multipass delete ubuntu-lts-custom
multipass purge

Find alternate images to launch with multipass
multipass find

Get help
multipass help
multipass help <command>

Now don’t forget you still have ubuntu-lts running :slight_smile:

1 Like

that’s really interested topic, thanks.

1 Like

How to navigate primary instance?

> multipass list

Name                    State             IPv4             Image
primary                 Stopped           --               Ubuntu 20.04 LTS
ubuntu-lts              Stopped           --               Ubuntu 20.04 LTS

> multipass sh

Starting primary  Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-60-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Tue Jan 12 16:08:29 +07 2021

  System load:  0.67              Processes:               117
  Usage of /:   31.4% of 4.67GB   Users logged in:         0
  Memory usage: 18%               IPv4 address for enp0s2: 192.168.64.4
  Swap usage:   0%

 * Introducing self-healing high availability clusters in MicroK8s.
   Simple, hardened, Kubernetes for production, from RaspberryPi to DC.

     https://microk8s.io/high-availability

0 updates can be installed immediately.
0 of these updates are security updates.


Last login: Tue Jan 12 09:54:24 2021 from 192.168.64.1
ubuntu@primary:~$ exit
logout

> multipass list

Name                    State             IPv4             Image
primary                 Running           192.168.64.4     Ubuntu 20.04 LTS
ubuntu-lts              Stopped           --               Ubuntu 20.04 LTS

> multipass stop

> multipass list

Name                    State             IPv4             Image
primary                 Stopped           --               Ubuntu 20.04 LTS
ubuntu-lts              Stopped           --               Ubuntu 20.04 LTS
1 Like