-1

I have a problem in mininet, I want to start Wireshark but it displays this message:

Error: XDG_RUNTIME_DIR not set in the environment.
Gtk-WARNING**: cannot open display
Exit 1 sudo wireshark

Can anyone help me?

techraf
  • 3,316
Kati Dev
  • 11
  • 1
  • 5

2 Answers2

0

From your host linux you can:

$ ssh mininet@mininet_ip -X

and then you can run wireshark on your host machine.

OR

$ startx # on mininet

0

Seemingly you started Wireshark with sudo wireshark. A detailed answer to similar problem is here. In short you should execute:

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR wireshark

Because typing it each time might be cumbersome, you should consider adding a shell alias to your environment. For bash add this to .bashrc:

alias ws='pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR wireshark'

and run ws for Wireshark.

techraf
  • 3,316