Multipass
- (Windows-only) Enable VM support with Hyper-V
Note to Windows users: Mininet does NOT currently work on WSL2 due to a missing component in the default WSL kernel that is required to support Open vSwitch, a dependency of Mininet.
(Windows-only) Enable Hyper-V
You will need to enable Hyper-V on your machine to run VMs on Windows.- Make sure you’re on a recent version of Pro, Education, or Enterprise edition of Windows. You can check this using the
winver
command. If you’re using the Home edition, you can obtain a free education license here. Follow the instructions to create an account using your UW credentials, then go to the “Microsoft Azure Education Hub” page and search for “Windows” in the list of available Software. Select either Windows 10 or 11 Education to obtain the product key. You can go to the activation settings page and enter the product key to upgrade your Windows version. - Run the following commands in PowerShell as an administrator.
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -All -NoRestart
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -NoRestart
- Restart your computer if the output from step 2 says
RestartNeeded: True
- Install multipass for your machine. Choose the recommended setup options. If Multipass doesn’t work on your machine, contact course staff on Ed for alternative solutions.
(Windows-only): Restart your computer after the install to ensure that necessary background services are running.
- Download cloud-init configuration for cse461-VM.
- Initialize VM using the cloud-init configuration file.
multipass launch --name mininet focal --cpus 2 --memory 3G --cloud-init cse461-config.yml
The launched VM should have the name mininet. 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 mininet
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>
VSCode in VM
- When staring Multipass VM, make sure the VM has at least 4 GB of memory:
If the VM is already launched, stop the VM, then change the memory of the VM with:multipass launch --name mininet --mem 4G
multipass set local.mininet.memory=4G
- Create a key pair for SSH login on your host machine (not the VM):
Skip by pressing enter when asked for password for convenience.ssh-keygen -f ~/.ssh/mininet-key
- On your host machine, copy the public key (
~/.ssh/mininet-key.pub
) to the VM:multipass transfer ~/.ssh/mininet-key.pub mininet:/home/ubuntu/.ssh/mininet-key.pub
- By running this command on your host machine, add public key to authorized_keys:
multipass exec mininet -- bash -c "cat ~/.ssh/mininet-key.pub >> ~/.ssh/authorized_keys"
- On your computer (outside the VM), adjust permission of the private key:
chmod 600 ~/.ssh/mininet-key
- In VSCode, make sure VSCode remote core functionality and SSH plugins are installed. Click on the remote icon in the left toolbar, then click on the plus sign in the SSH section. You will be prompted to enter a SSH login command to connect to the VM (NOTE: to find the IP of your vm, run the command
multipass list
):
Enter the command, then add the host to your local SSH config, and choose Linux as your remote machine type. If everything goes well, you should be able to start using VSCode for your Multipass VM now.ssh -i ~/.ssh/mininet-key ubuntu@[IP of VM]
If multipass fails: VMware Instructions (Please contact course staff on ed!)
- Make a broadcom account.
- Download VMware click download fusion or workstation.
- After installing VMware, download Ubuntu Desktop Image ISO from Canonical:
X86-64 (Ubunutu 20.04 Focal).
ARM64 (Ubuntu 24.04 Noble).
-
Create a new Linux virtual machine in VMWare, select the ISO image from the previous step when prompted for an installation image.
-
Start the VM, follow onscreen instructions to install Ubuntu. The VM will restart once it’s finished.
-
Open a terminal windows in Ubuntu, install any package updates using
sudo apt update && sudo apt upgrade -y
-
Install GuestVM support tools (Recommended for the VM desktop to scale correctly)
sudo apt install open-vm-tools-desktop
-
Feel free to delete the Ubuntu installer ISO file. You can now install mininet using the manual setup instruction below.
Mininet manual setup
If you run into any issues with the automate cloud-init setup, you can manually install packages and fetch starter code using the instructions below. We assume you're in the home directory of the Ubuntu VM.-
Install mininet and Python with apt
sudo apt-get update sudo apt-get install -y mininet python3 unzip net-tools xterm python3-pip
-
Install Python mininet
sudo pip3 install mininet
-
Fetch files from course website and clone pox repo
wget https://courses.cs.washington.edu/courses/cse461/25wi/projects/project2/resources/project2.zip unzip project2.zip rm project2.zip cd ~/ git clone https://github.com/noxrepo/pox.git sudo cp ~/461_mininet/pox/* ~/pox/pox/misc/