Milson
Milson

Reputation: 1575

Mininet OVS-Controller can 't be loaded and run

When ever I try to login SSH to my mininet VM from Host terminal it shows Permission denied error and even from within VM terminal where the Mininet is hosted using command:

sudo mn --topo single,3 --mac --switch ovsk --controller remote`

it shows the following error:

ubuntu@ubuntu:~$ sudo mn
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2
*** Adding links:
(h1, s1) (h2, s1)
*** Configuring hosts
h1 h2
*** Starting controller
Cannot find required executable ovs-controller.
Please make sure that it is installed and availabe in your $PATH:
(/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin/:/bin)
ubuntu@ubuntu:~$

So I can't continue using the SDN network! How can it be fixed manually and why this error happens!

Upvotes: 4

Views: 17179

Answers (3)

Jefferson
Jefferson

Reputation: 529

As pointer by csl above, You have to install openvswitch controller separately. In ubuntu that's what worked for me:

sudo apt-get install openvswitch-testcontroller
sudo cp /usr/bin/ovs-testcontroller /usr/bin/ovs-controller

Upvotes: 5

Greg
Greg

Reputation: 543

A cleaner way to install would have been to use the Ubuntu package upgrades. This would make future upgrades of OVS and removal easier. An example is at http://gregorygee.wordpress.com/2013/10/24/another-way-to-upgrade-open-vswitch-in-mininet/.

If you you installed Open vSwitch from source and want to remove it, then just go back to the source directory and run 'make uninstall'.

BTW, I have found that if you didn't have an installation of Open vSwitch on your system prior to installing from source, Open vSwitch installation would not include the system startup scripts, so you would have to install them manually. It's best to try and install Open vSwtich using packaging scripts.

Upvotes: 2

csl
csl

Reputation: 11368

I had the exact same problem when I upgraded to Open vSwitch 2.1. In the release notes of ovs (NEWS) I found this:

  - ovs-controller has been renamed test-controller.  It is no longer
     packaged or installed by default, because too many users assumed
     incorrectly that ovs-controller was a necessary or desirable part
     of an Open vSwitch deployment.

I also found test-controller under ./tests/test-controller (source distribution), so I just tried

sudo cp tests/test-controller /usr/bin/ovs-controller

and that works fine for me! I'm using Mininet 2.1 as well, but I had to do the above for it to work. Here's the output:

$ sudo mn --controller=ovsc
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2
*** Adding switches:
s1
*** Adding links:
(h1, s1) (h2, s1)
*** Configuring hosts
h1 h2
*** Starting controller
*** Starting 1 switches
s1
*** Starting CLI:
mininet> pingall
*** Ping: testing ping reachability
h1 -> h2
h2 -> h1
*** Results: 0% dropped (2/2 received)
mininet>

It's interesting that they discourage the use of test-controller, and even more so that Mininet seems to rely on it. Perhaps there is a better executable for this purpose?

Let me know if this works for you!

Upvotes: 5

Related Questions