Mininet VM Setup Notes
Mininet VM Setup Notes
The Mininet VM is meant to speed up Mininet installation, plus make it easy to run on non-
Linux platforms. The VM works on Windows, Mac, and Linux, through VMware, VirtualBox,
QEMU and KVM.
After downloading the VM, you’ll run a few steps to customize it for your setup. This won’t take
long.
VM Setup
Download the Mininet VM
The VM comes out to 1GB compressed and ~2GB uncompressed. It is an OVF (Open
Virtualization Format) virtual machine image which can be imported by most virtual machine
monitors.
Download and install a virtualization program such as: VMware Workstation for Windows or
Linux, VMware Fusion for Mac, VirtualBox ( free!, GPL) for any platform, or qemu ( free!,
GPL) for Linux. If you already have VMware, we find that it runs Mininet somewhat faster than
VirtualBox. However, VirtualBox is free to download and distribute, which is a definite
advantage!
Boot VM
Add the VM and start it up, in the virtualization program of your choice:
VirtualBox:
1. Usually you can just double-click on the .ovf file and import it.
2. If you get errors importing the .ovf file, you can simply create a new VM of the
appropriate type (e.g. Linux, Ubuntu 64-bit) and use the .vmdk file as the virtual hard
disk for the new VM.
3. Select “settings,” and add an additional host-only network adapter that you can use log in
to the VM image. Start the VM.
4. For more information on setting up networking in VirtualBox, you may wish to check out
these VirtualBox specific instructions
VMware may ask you to install VMware tools on the VM - if it asks, decline. Everything
graphical in the tutorial is done via X forwarding through SSH (in fact, the VM doesn’t have a
desktop manager installed), so the VMware tools are unnecessary unless you wish to install an
X11/Gnome/etc. environment in your VM.
Qemu/KVM:
For KVM:
The above commands will set up ssh forwarding from the VM to host port 8022.
Parallels: Use Parallels Transporter to convert the .vmdk file to an .hdd image that Parallels can
use, and then create a new VM using that .hdd image as its virtual drive. Start the VM.
Log in to VM
(some older VM images may use openflow/openflow instead) The root account is not enabled
for login; you can use sudo to run a command with superuser privileges.
SSH into VM
First, find the VM’s IP address, which for VMware is probably in the range 192.168.x.y. In the
VM console:
ifconfig eth0
Note: VirtualBox users who have set up a host-only network on eth1 should use
You may want to add the address to your host PC’s /etc/hosts file to be able to SSH in by name,
if it’s Unix-like. For example, add a line like this for OS X:
192.168.x.y mininet-vm
ssh -Y mininet@mininet-vm
If you’re running the VM under QEMU/KVM with -net user and the hostfwd option as
recommended above, the VM IP address is irrelevant. Instead you tell SSH to connect to port
8022 on the host:
Optional VM Customization
These commands are optional, and may be useful for your setup:
These steps let you log in via ssh without needing to enter a password. If you use the console
from your virtualization software natively, then this step isn’t needed.
Check for ~/.ssh/id_rsa or ~/.ssh/id_dsa. If you can’t find either of these files, then you’ll
want to generate an SSH key.
On a unix-like system (OS X or Linux - you’ll need other instructions for Windows) - on the
host, not the VM:
ssh-keygen -t rsa
To speed up future SSH connections, add your host’s public key to the new VM. Also on the
host, not the VM:
cd ~/ && mkdir -p .ssh && chmod 700 .ssh && cd .ssh && touch authorized_keys2
&& chmod 600 authorized_keys2 && cat ../id_rsa.pub >> authorized_keys2 &&
rm ../id_rsa.pub && cd ..
Mininet Walkthrough