Multipass

MAC download

We downloaded multipass through brew

$ brew install --cask multipass

Linux and Windows download

https://multipass.run/

Download VM

We want to download Ubuntu 20.4

Lets make multipass can downkoad Ubuntu 20.4 image through the internet.

In a shell

$ multipass find

Image                       Aliases           Version          Description
snapcraft:core18            18.04             20201111         Snapcraft builder for Core 18
snapcraft:core20            20.04             20210921         Snapcraft builder for Core 20
18.04                       bionic            20220523         Ubuntu 18.04 LTS
20.04                       focal,lts         20220505         Ubuntu 20.04 LTS
21.10                       impish            20220309         Ubuntu 21.10
22.04                       jammy             20220506         Ubuntu 22.04 LTS
anbox-cloud-appliance                         latest           Anbox Cloud Appliance
charm-dev                                     latest           A development and testing environment for charmers
docker                                        latest           A Docker environment with Portainer and related tools
minikube                                      latest           minikube is local Kubernetes

We can see Ubuntu 20.04 on this line:

20.04                       focal,lts         20220505         Ubuntu 20.04 LT

This means that we can use the alias focal to download the image. Run the following command:

$ multipass launch --name=mininet focal

Launched: mininet

This will create a randomly generated in this case prudent-escargot

We can verify this name with multipass list:

$ multipass list

Name                    State             IPv4             Image
mininet	                Running           192.168.64.3     Ubuntu 20.04 LTS

Entering the shell

To ssh into the VM run the following (Look at the bottom of the page for the instruction)

$ multipass shell <NAME>

Installing mininet

#!/bin/bash

QTR=24wi

sudo apt-get update
sudo apt-get install -y mininet python3 unzip net-tools xterm 
sudo apt install python3-pip
sudo pip3 install mininet


wget https://courses.cs.washington.edu/courses/cse461/$QTR/assignments/project2/project2.zip
unzip project2.zip

# install Pox
cd ~/
git clone https://github.com/noxrepo/pox.git

# Move the project file to the right repo
sudo cp ~/461_mininet/pox/* ~/pox/pox/misc/

Congratulations you are done with the important stuff!

Other important commands

Pausing and playing the VM

To stop VM from running:

$ multipass stop <NAME>

To start VM again

$ multipass start <NAME>

Deleting the VM

To delete VM space off your machine

$ multipass delete <NAME>

SSH Access to the multipass VM

First generate a public-private key pair (if you dont already have one) and place the public key in the multipass VM. This will allow you to get SSH access to the VM and make X11 forwarding a bit easier

To put your public key in the VM multipass exec mininet -- bash -c "echo `cat ~/.ssh/<public_key>.pub` >> ~/.ssh/authorized_keys"

Use multipass list to get the IP address of the VM and how you should be able to SSH into it. ubuntu is the default user. ssh ubuntu@<ip_address> -X

We use the -X command to enable X11 forwarding. You much have an X11 server running on your machine. For macos, we recommend XQuartz for Windows Xming, and for Linux xorg and openbox via APT.