10

I used to run wireshark on ubuntu 17.04 with

~/$ sudo wireshark

but now (just after update to 17.10) when I write the same I get an error

~/$ sudo wireshark

    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
    Invalid MIT-MAGIC-COOKIE-1 keyQXcbConnection: Could not connect to display :0
Mateusz Filipiuk
  • 111
  • 1
  • 1
  • 7

2 Answers2

11

work around

~$ xhost +si:localuser:root
~$ sudo wireshark

Why don't gksu/gksudo work with Wayland?

Germán
  • 111
  • 2
  • Other root applications are broken on Wayland too (see [bug 1713313](https://bugs.launchpad.net/bugs/1713313) and [bug 1713311](https://bugs.launchpad.net/bugs/1713311) ). – N0rbert Oct 25 '17 at 17:33
7

Really you do not need to launch WireShark as root. Please read official page.

In brief you should do:

sudo chgrp wireshark /usr/bin/dumpcap
sudo chmod o-rx /usr/bin/dumpcap
sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/dumpcap
sudo usermod -a -G wireshark $USER

Then log-out and log-in again.

N0rbert
  • 97,162
  • 34
  • 239
  • 423