The easiest way to get started is to download a pre-packaged Mininet/Ubuntu VM. This VM includes Mininet itself, all OpenFlow binaries and tools pre-installed, and tweaks to the kernel configuration to support larger Mininet networks.
(These instructions are for Mininet 2.2.0 - for earlier versions, go to the bottom of this page.)
Option 1: Mininet VM Installation (easy, recommended)
VM installation is the easiest and most foolproof way of installing Mininet, so it’s what we recommend to start with.
Follow these steps for a VM install:
Download the Mininet VM image.
Download and install a virtualization system. We recommend VirtualBox (free, GPL) because it is free and works on OS X, Windows, and Linux (though it’s slightly slower than VMware in our tests.) You can also use Qemu for any platform, VMware Workstation for Windows or Linux, VMware Fusion for Mac, or KVM (free, GPL) for Linux.
Sign up for the mininet-discuss mailing list. This is the source for Mininet support and discussion with the friendly Mininet community. ;-)
Run through the VM Setup Notes to log in to the VM and customize it as desired.
Follow the Walkthrough to get familiar with Mininet commands and typical usage.
Once you’ve completed the Walkthrough, you should have a clear idea for what Mininet is and what you might use it for. If you are interested in OpenFlow and Software-Defined Networking, you will want to complete the OpenFlow tutorial as well. Good luck, and have fun!
Option 2: Native Installation from Source
This option works well for local VM, remote EC2, and native installation. It assumes the starting point of a fresh Ubuntu (or, experimentally, Fedora) installation. (If you are upgrading from an older Mininet and/or OVS, see notes on removing old versions, below.)
We strongly recommend more recent Ubuntu releases, because they support newer versions of Open vSwitch. (Fedora also supports recent OVS releases)
To install natively from source, first you need to get the source code:
git clone git://github.com/mininet/mininet
Note that the above
git command will check out the latest and greatest Mininet
(which we recommend!) If you want to run the last tagged/released version
of Mininet, use:
git clone git://github.com/mininet/mininet git checkout -b 2.2.0 2.2.0
Once you have the source tree, the command to install Mininet is:
install.sh options include:
-a: install everything that is included in the Mininet VM, including dependencies like Open vSwitch as well the additions like the OpenFlow wireshark dissector and POX. By default these tools will be built in directories created in your home directory.
-nfv: install Mininet, the OpenFlow reference switch, and Open vSwitch
-s mydir: use this option before other options to place source/build trees in a specified directory rather than in your home directory.
So, you will probably wish to use one (and only one) of the following commands:
To install everything (using your home directory): install.sh -a To install everything (using another directory): install.sh -s mydir -a To install Mininet + user switch + OVS (using your home dir): install.sh -nfv To install Mininet + user switch + OVS (using another dir:) install.sh -s mydir -nfv
You can find out about other useful options (e.g. installing the wireshark dissector, if it’s not already included in your version of wireshark) using
After the installation has completed, test the basic Mininet functionality:
sudo mn --test pingall
Then continue with steps 3-5, above. If you run into errors, first consult the FAQ, Documentation, and mailing list archives to see if anything resembling your problem has been seen before and if there might be a possible solution. If those things don’t help and you still have problems that you cannot solve on your own (or with some help from Google :) ), you can request help on the friendly mininet-discuss mailing list.
Option 3: Installation from Packages
If you’re running a recent Ubuntu release, you can install the Mininet packages. Note that this may give you an older version of Mininet, but it can be a very convenient way to get started.
First, if you are upgrading or have upgraded from an earlier installation of Mininet (like 1.0) or a version of Open vSwitch which might have been compiled and stored in
/usr/local, make sure you remove any traces of earlier versions of Mininet and Open vSwitch from
sudo rm -rf /usr/local/bin/mn /usr/local/bin/mnexec \ /usr/local/lib/python*/*/*mininet* \ /usr/local/bin/ovs-* /usr/local/sbin/ovs-*
Then, to confirm which OS version you are running, run the command
Next, install the base Mininet package by entering only one of the following commands, corresponding to the distribution you are running:
Mininet 2.1.0 on Ubuntu 13.10: sudo apt-get install mininet Mininet 2.0.0 on Ubuntu 13.04: sudo apt-get install mininet Mininet 2.0.0 on Ubuntu 12.10: sudo apt-get install mininet/quantal-backports Mininet 2.0.0 on Ubuntu 12.04: sudo apt-get install mininet/precise-backports
(Note: Ubuntu 12.10 also has a Mininet 2.0.0d3 package, but you will want to install the one from quantal-backports, which is Mininet 2.0.0.)
After this completes, you should deactivate
openvswitch-controller if it is running:
sudo service openvswitch-controller stop sudo update-rc.d openvswitch-controller disable
Then you can test Mininet:
sudo mn --test pingall
If Mininet complains that Open vSwitch isn’t working, you may need to rebuild its kernel module:
sudo dpkg-reconfigure openvswitch-datapath-dkms sudo service openflow-switch restart
If you wish to go through the Mininet walkthrough, you will want to install additional software. The following commands
git clone git://github.com/mininet/mininet mininet/util/install.sh -fw
will install the OpenFlow reference switch, reference controller and Wireshark dissector.
(old) Mininet 1.0 Installation
You may be able to find a very old VM image on the Old Mininet downloads, page, though we don’t really recommend using it.
You can also use the archived
install-precise branch to install Mininet 1.0 on Ubuntu 12.04:
git clone git://github.com/mininet/mininet cd mininet git fetch git checkout -b install-precise origin/devel/install-precise util/install.sh -a
Make sure you are installing from the install-precise branch.