Multipass
Follow the download instructions here. For Windows users, we recommend using WSL and then following the Linux install instructions. We’re found this provides the most seemless install experience.
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
We can verify this name with multipass list:
$ multipass list
Name State IPv4 Image
mininet Running 192.168.64.3 Ubuntu 20.04 LTS
To ssh into the VM run the following
$ multipass shell <NAME>
#!/bin/bash
QTR=25wi
sudo apt-get update
sudo apt-get install -y mininet python3 unzip net-tools xterm
wget https://courses.cs.washington.edu/courses/cse461/$QTR/projects/project2/resources/project2.zip
unzip project2.zip
# install Pox
cd ~/
git clone git@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!
To stop VM from running:
$ multipass stop <NAME>
To start VM again
$ multipass start <NAME>
To delete VM space off your machine
$ multipass delete <NAME>
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 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>
The process is much more difficult on Windows.
- In powershell, copy your public key to your clipboard
cat ~/.ssh/<public_key>.pub
- Now open WSL. First, run the following commands:
sudo apt install openssh-server
sudo service ssh start
sudo service ssh status // ensure the service is running
- Still inside WSL, open multipass VM multipass shell mininet
- Inside your multipass VM,
vi ~/.ssh/authorized_keys
and append your public key to the file - Now exit from your multipass VM back into WSL
- Inside WSL again, use multipass list to copy the IPv4 address associated with your ubuntu VM.
- In powershell again, run
ssh -J <wsl_username>@localhost ubuntu@<multipass_vm_ipv4>
. You can now SSH into your multipass VM from Windows. - In VS Code SSH extension, when prompted, enter the SSH command and voila!
- Once you’re done, it’s also best practice to do sudo service ssh stop for network security.
Whenever you attempt to reconnect via VS code, ensure that 1) WSL is running 2) ssh service is running in WSL 3) the multipass VM is running.