Reputation: 135
I'm using mininet version 2.1.0. My setup is such that I've to run the mininet command from a remote machine, e.g.,
ssh -X user@IP python mininet.py
X11 forwarding seems to be fine. X forwarding does not work from the mininet shell only, but it works from the SSH shell.
However, I'm unable to run xterm command on mininet. I'm not getting any output after running the xterm command.
mininet> pingall
*** Ping: testing ping reachability
h1 -> h2 h3
h2 -> h1 h3
h3 -> h1 h2
*** Results: 0% dropped (6/6 received)
mininet> xterm h1
mininet> h1 xterm
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted in
this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm: Xt error: Can't open display: %s
When I start the mininet from my local machine, xterm works and opens up a new window.
Where should I look for xterm related logs in such case?
I've already spent over a day on this. I also updated mininet version to the latest 2.2.1, but still no success.
Thanks in advance!
Upvotes: 9
Views: 27638
Reputation: 1
It was resolved this issue by installing xterm for Ubuntu:
apt-get install xterm
mininet@mininet-vm:~$ sudo -E mn
Upvotes: 0
Reputation: 69
For all those who came to this post looking for answers to how to run
mininet> xterm h1
while using the python CLI.
I found a StackOverflow post here where @Misho Janev answers this problem.
In my case, I was able to at least get a result when I did
echo $DISPLAY
It was empty in my mininet-vm but gave a output localhost:10 in my ssh terminal that I was using locally in my PC through WSL (windows 10) where I ran the mininetVM.
The steps in the post worked for me and I was able to use
mininet> xterm h1
Flawlessly!!!
STEPS:
xauth list $DISPLAY
sudo -s
xauth add LINE_YOU_COPIED_IN_STEP1
Upvotes: 1
Reputation: 89
you have to set display first, from a remote machine (i assume your windows PC), install xming server to set and display MININET code results, >> run xlunch >> select the display number>> then use ssh or putty to log in and showresults in selected display, it worked fine for me.
Upvotes: 0
Reputation: 101
when I moved to Ubuntu 18.04, Mininet xterm stopped working. all I did was to install xterm "sudo apt install xterm" in Ubuntu. after that I started mininet (sudo mn) and called mininet>xterm h1. the xterm window popped up as usual. hope this will help.
Upvotes: 9
Reputation: 91
The reason "h1 xterm" command is not working under the mininet console is:
two important xterm related environment variables ( $XAUTHORITY , $DISPLAY ) are not passing over to the mininet console, if you run : "h1 echo $DISPLAY $XAUTHORITY" ; both variables will return blank.
In order to keep the host environment variables unchanged, add -E argument to the mn command. "sudo -E mn" , and then you will be able to run "h1 xterm" successfully.
Upvotes: 9