4

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!

Charles
  • 50,943
  • 13
  • 104
  • 142
Milson
  • 1,525
  • 3
  • 15
  • 29
  • Which version of Mininet and Open vSwitch are you using? I just upgraded Open vSwitch to 2.1, and I get the same error. I guess it shouldn't be too hard to fix it. I found some instructions on https://github.com/mininet/mininet/wiki/Installing-new-version-of-Open-vSwitch but it seems that ovs changed the name of the ovs-controller binary (see release notes). – csl Apr 28 '14 at 20:24
  • My Mininet is 2.1 and yes I also upgraded the OVS to 2.1 and everytime I do : $ sudo mn *** Adding switches: 2014-04-28T23:45:28Z|00001|reconnect|WARN|unix:/usr/local/var/run/openvswitch/db.sock: connection attempt failed (Connection refused) ovs-vsctl: unix:/usr/local/var/run/openvswitch/db.sock: database connection failed (Connection refused) ovs-vsctl exited with code 1 *** Error connecting to ovs-db with ovs-vsctl Make sure that Open vSwitch is installed, that ovsdb-server is running, and that "ovs-vsctl show" works correctly. You may wish to try "service openvswitch-switch start". – Milson Apr 28 '14 at 23:46
  • Try starting Mininet with a remote controller, `sudo mn --controller=remote`. I think that should work. – csl Apr 29 '14 at 08:16
  • ya @csl that works fine with --controller=remote – Milson Apr 29 '14 at 18:25
  • Ok, well, then this question has been solved, I believe! :) – csl Apr 29 '14 at 18:42
  • By the way, I've sent an email about this issue on mininet-discuss: https://mailman.stanford.edu/pipermail/mininet-discuss/2014-April/004424.html – csl Apr 29 '14 at 18:43
  • Yes i got it thanks ! csl – Milson Apr 29 '14 at 19:52

3 Answers3

5

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!

csl
  • 10,937
  • 5
  • 57
  • 89
  • 1
    Thank @csl for your insight. I have tried this: http://gregorygee.wordpress.com/2013/08/20/upgrading-openvswitch-in-mininet-2-0-vm-to-ovs-1-10/ And Now want to remove OVS completely ? DO you have any suggestion how can I perform that? so that sudo mn without any additional controller can work fine like before? – Milson Apr 28 '14 at 23:43
  • If you want to remove it, the best way is to go to the source directory and run `make uninstall`. But you have to make sure that you also stop the services and remove the kernel module. See https://github.com/mininet/mininet/wiki/Installing-new-version-of-Open-vSwitch – csl Apr 29 '14 at 08:18
5

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
Jefferson
  • 529
  • 4
  • 9
  • You can just soft link it: `sudo ln -s /usr/bin/ovs-testcontroller /usr/bin/controller` – Pierz Jun 21 '18 at 09:35
2

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.

Greg
  • 473
  • 1
  • 4
  • 13
  • 1
    A fair point, but this only solves the install/uninstall part; not the problem with the missing (or renamed) binary in ovs 2.1. – csl Apr 29 '14 at 14:11
  • @Greg : install Open vSwtich using packaging scripts is it available with ubuntu 12.04 LTS ? – Milson Apr 29 '14 at 18:28
  • Ubuntu 12.04 comes with OVS 1.4.3. My blog post says how to create newer packages of OVS. As for the missing binary, it is unknown what Mininet will do going forward with the OVS controller. The latest Ubuntu 14.04 packages of OVS is 2.0.1, which still contains the ovs-controller. So once an Ubuntu release comes out that doesn't include ovs-controller, then Mininet will have to be updated. – Greg May 06 '14 at 17:28