{"action":"created","issue":{"url":"https://api.github.com/repos/mininet/mininet/issues/529","labels_url":"https://api.github.com/repos/mininet/mininet/issues/529/labels{/name}","comments_url":"https://api.github.com/repos/mininet/mininet/issues/529/comments","events_url":"https://api.github.com/repos/mininet/mininet/issues/529/events","html_url":"https://github.com/mininet/mininet/issues/529","id":89942397,"number":529,"title":"Problem in running Mininet in docker","user":{"login":"imehrdad2012","id":2661392,"avatar_url":"https://avatars.githubusercontent.com/u/2661392?v=3","gravatar_id":"","url":"https://api.github.com/users/imehrdad2012","html_url":"https://github.com/imehrdad2012","followers_url":"https://api.github.com/users/imehrdad2012/followers","following_url":"https://api.github.com/users/imehrdad2012/following{/other_user}","gists_url":"https://api.github.com/users/imehrdad2012/gists{/gist_id}","starred_url":"https://api.github.com/users/imehrdad2012/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imehrdad2012/subscriptions","organizations_url":"https://api.github.com/users/imehrdad2012/orgs","repos_url":"https://api.github.com/users/imehrdad2012/repos","events_url":"https://api.github.com/users/imehrdad2012/events{/privacy}","received_events_url":"https://api.github.com/users/imehrdad2012/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-21T18:16:58Z","updated_at":"2015-06-22T02:42:56Z","closed_at":null,"body":"Hello,\r\n\r\nI am trying to run the mininet within an ubuntu container using docker. However, I cannot run any of the examples successfully. These are the commands I have used:\r\n1) sudo docker run -it --name=\"ubuntu_ovs\" ubuntu:latest /bin/bash\r\n2) root@66167533a128:/# sudo apt-get update\r\n3) root@66167533a128:/# sudo apt-get install mininet\r\n4) root@66167533a128:/# sudo apt-get install git\r\n5) root@66167533a128:/# git clone git://github.com/mininet/mininet.git\r\n6) root@66167533a128:/# cd mininet/examples\r\n7) root@66167533a128:/mininet/examples# sudo python nat.py\r\n\r\nI get the following errors for all examples in the folder. Do you have any idea what the problem is?\r\n\r\n*** Error setting resource limits. Mininet's performance may be affected.\r\n*** Creating network\r\n*** Adding controller\r\n*** Adding hosts:\r\nh1 h2 h3 h4\r\n*** Adding switches:\r\ns1\r\n*** Adding links:\r\nTraceback (most recent call last):\r\n  File \"nat.py\", line 104, in <module>\r\n    net = TreeNet( depth=1, fanout=4 )\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/topolib.py\", line 36, in TreeNet\r\n    return Mininet( topo, **kwargs )\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/net.py\", line 164, in __init__\r\n    self.build()\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/net.py\", line 357, in build\r\n    self.buildFromTopo( self.topo )\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/net.py\", line 344, in buildFromTopo\r\n    self.addLink( src, dst, srcPort, dstPort, **params )\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/net.py\", line 287, in addLink\r\n    return cls( node1, node2, **defaults )\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/link.py\", line 362, in __init__\r\n    link=self, **params1  )\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/link.py\", line 45, in __init__\r\n    node.addIntf( self, port=port )\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/node.py\", line 355, in addIntf\r\n    moveIntf( intf.name, self )\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/util.py\", line 202, in moveIntf\r\n    srcNode=srcNode, printError=printError )\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/util.py\", line 167, in retry\r\n    while not fn( *args, **keywords ) and tries < retries:\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/util.py\", line 186, in moveIntfNoRetry\r\n    links = dstNode.cmd( 'ip link show' )\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/node.py\", line 283, in cmd\r\n    self.sendCmd( *args, **kwargs )\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/node.py\", line 229, in sendCmd\r\n    self.write( cmd + '\\n' )\r\n  File \"/usr/lib/python2.7/dist-packages/mininet/node.py\", line 182, in write\r\n    os.write( self.stdin.fileno(), data )\r\nOSError: [Errno 32] Broken pipe\r\n\r\nThese are also the outputs after running ovs service start and restart. I can manually add ovs instances without any problem.\r\nroot@66167533a128:/mininet/examples# sudo service openvswitch-switch restart\r\n * Killing ovs-vswitchd (788)\r\n * Killing ovsdb-server (778)\r\nnice: cannot set niceness: Permission denied\r\n * Starting ovsdb-server\r\n * Configuring Open vSwitch system IDs\r\nnice: cannot set niceness: Permission denied\r\n * Starting ovs-vswitchd\r\n * Enabling remote OVSDB managers\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mininet/mininet/issues/comments/113984624","html_url":"https://github.com/mininet/mininet/issues/529#issuecomment-113984624","issue_url":"https://api.github.com/repos/mininet/mininet/issues/529","id":113984624,"user":{"login":"imehrdad2012","id":2661392,"avatar_url":"https://avatars.githubusercontent.com/u/2661392?v=3","gravatar_id":"","url":"https://api.github.com/users/imehrdad2012","html_url":"https://github.com/imehrdad2012","followers_url":"https://api.github.com/users/imehrdad2012/followers","following_url":"https://api.github.com/users/imehrdad2012/following{/other_user}","gists_url":"https://api.github.com/users/imehrdad2012/gists{/gist_id}","starred_url":"https://api.github.com/users/imehrdad2012/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imehrdad2012/subscriptions","organizations_url":"https://api.github.com/users/imehrdad2012/orgs","repos_url":"https://api.github.com/users/imehrdad2012/repos","events_url":"https://api.github.com/users/imehrdad2012/events{/privacy}","received_events_url":"https://api.github.com/users/imehrdad2012/received_events","type":"User","site_admin":false},"created_at":"2015-06-22T02:42:56Z","updated_at":"2015-06-22T02:42:56Z","body":"Thanks Bob for your help. I really appreciate it. Unfortunately, the code hangs at ifconfig. If I do hit Control+C, it stays there forever. \r\n\r\n1- After I hit Control-C, I get the following output:\r\nroot@a3c769c17cbd:/# mn --test pingall -v debug\r\n*** errRun: ['which', 'controller']\r\n/usr/local/bin/controller\r\n  0*** errRun: ['grep', '-c', 'processor', '/proc/cpuinfo']\r\n32\r\n  0*** Setting resource limits\r\n*** Error setting resource limits. Mininet's performance may be affected.\r\n*** Creating network\r\n*** Adding controller\r\n*** errRun: ['which', 'mnexec']\r\n/usr/bin/mnexec\r\n  0*** errRun: ['which', 'ifconfig']\r\n/sbin/ifconfig\r\n  0*** c0 : ('unset HISTFILE; stty -echo; set +m',)\r\nunset HISTFILE; stty -echo; set +m\r\n*** errRun: ['which', 'telnet']\r\n/usr/bin/telnet\r\n  0*** c0 : ('echo A | telnet -e A 127.0.0.1 6633',)\r\nTelnet escape character is 'A'.\r\nTrying 127.0.0.1...\r\ntelnet: Unable to connect to remote host: Connection refused\r\n*** Adding hosts:\r\n*** errRun: ['which', 'mnexec']\r\n/usr/bin/mnexec\r\n  0*** errRun: ['which', 'ifconfig']\r\n/sbin/ifconfig\r\n  0^C\r\n\r\nKeyboard Interrupt. Shutting down and cleaning up...\r\n\r\n*** Removing excess controllers/ofprotocols/ofdatapaths/pings/noxes\r\nkillall controller ofprotocol ofdatapath ping nox_core lt-nox_core ovs-openflowd ovs-controller udpbwtest mnexec ivs 2> /dev/null\r\nkillall -9 controller ofprotocol ofdatapath ping nox_core lt-nox_core ovs-openflowd ovs-controller udpbwtest mnexec ivs 2> /dev/null\r\npkill -9 -f \"sudo mnexec\"\r\n*** Removing junk from /tmp\r\nrm -f /tmp/vconn* /tmp/vlogs* /tmp/*.out /tmp/*.log\r\n*** Removing old X11 tunnels\r\n*** errRun: ['pkill', '-9', '-f', 'mnexec.*socat']\r\n  1*** Removing excess kernel datapaths\r\nps ax | egrep -o 'dp[0-9]+' | sed 's/dp/nl:/'\r\n***  Removing OVS datapaths\r\novs-vsctl --timeout=1 list-br\r\novs-vsctl --timeout=1 list-br\r\n*** Removing all links of the pattern foo-ethX\r\nip link show | egrep -o '([-_.[:alnum:]]+-eth[[:digit:]]+)'\r\nip link show\r\n*** Killing stale mininet node processes\r\npkill -9 -f mininet:\r\n*** Shutting down stale tunnels\r\npkill -9 -f Tunnel=Ethernet\r\npkill -9 -f .ssh/mn\r\nrm -f ~/.ssh/mn/*\r\n*** Cleanup complete.\r\n\r\n2- Similarly this command (mn --test pingall -v debug) also does not run properly. It seems Mininet cannot completely create the topology to perform the ping operation (take a look at the above output).\r\n\r\n3- These are my kernel information: Linux a3c769c17cbd 3.13.0-53-generic #89-Ubuntu SMP Wed May 20 10:34:39 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux / Distributor ID:Ubuntu Description:\tUbuntu 14.04.2 LTS Release:\t14.04 Codename:\ttrusty.\r\n\r\n4-  It seems the output of the command is not what we expect (see below). Do you have any pointer why this happens?\r\n\r\nroot@a3c769c17cbd:/# sudo mnexec -n ip link show\r\nunshare: Operation not permitted\r\n\r\nThanks a lot!\r\n"}}