X11 connection rejected because of wrong authentication in Mininet

Viewed 2557

I am getting this message whenever I run xterm from within mininet:

mininet> xterm h1
mininet> X11 connection rejected because of wrong authentication.

However, if I run it as:

mininet@mininet-vm:~$ xterm

It shows the window as normal.

I only experience this issue with Mininet running on virtual box with ubuntu 20.04.02.

With other ubuntu version (14.04.06), xterm works fine.

Any help on this would be appreciated..

2 Answers

Had a similar issue at some point. The problem was that when you are running the mininet console you do that as root and not as the ssh'ed user - mininet in your case. I vaguely remember resolving it by creating .Xauthority files and giving the root user and the mininet user permissions to them... Can't remember the whole procedure now, hopefully this would give you a clue.

Page #27 of this document suggests a possible resolution.

What they suggest is:

  1. As your non-root user do xauth list $DISPLAY. This should return a line describing the display. in my case, ubuntu-bionic/unix:0 MIT-MAGIC-COOKIE-1 SOME_HASH. Copy that line.

  2. Now, log-in as the super user sudo -s

  3. Authorize that display information for the root user xauth add LINE_YOU_COPIED_IN_1.

  4. That should be it

If you see an error about .Xauth not existing follow this link to create one and go back to step 1.

In my case I followed page 27 from the file TEL3214- Computer Communication Networks

It is as: inside the mininet-vm

  1. xauth list $DISPLAY, it will display something like this

    SDN-i386/unix:10 MIT-MAGIC-COOKIE-1 1603e2caa81a3a6f50245bb17cf9e546

  2. sudo -s

  3. xauth add SDN-i386/unix:10 MIT-MAGIC-COOKIE-1 1603e2caa81a3a6f50245bb17cf9e546

If you get an error like xauth: file /home/marty/.Xauthority does not exist Then do this simple step => touch /root/.Xauthority. And, repeat 3.

  1. That's all
Related