This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Running Wireshark from Red Hat command line?

0

I am running Red Hat Enterprise Linux Server release 5.6 (x86_64), and I installed Wireshark 1.0.15.

I installed Wireshark by:

yum install wireshark

Now when I try running following command line:

wireshark -c 100 -k -Q -w –

I receive:

(wireshark:25796): Gtk-WARNING **: cannot open display:

Any ideas why it won't run from the command line? Do you need the GUI for Wireshark to work from the command line?

asked 11 Mar '13, 12:18

lakeland's gravatar image

lakeland
11112
accept rate: 0%


2 Answers:

0

Do you even have a $DISPLAY defined? Or do you intend to run it from a workstation? If you do you should make sure that the user running Wireshark (don't go with root here) has access right to the display server. Or allow the access at the workstation with xhost.

answered 11 Mar '13, 15:40

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

and on a sidenote: yes, you do need the GUI to run Wireshark, no matter if by icon click, file association or command line. If you want a command line tool, run tshark instead.

(11 Mar '13, 15:55) Jasper ♦♦

0

yum install wireshark

As far as I know, the GUI version package is called wireshark-gnome on RHEL 5.6, whereas the package wireshark contains only the CLI tools (tshark, dumpcap, etc.). So, please run this command

yum install wireshark-gnome

Then you should be able to start wireshark from the CLI.

Regards
Kurt

answered 11 Mar '13, 23:41

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

edited 11 Mar '13, 23:42