You are not logged in.

#1 2024-12-10 22:50:40

Deshio
Member
Registered: 2024-12-10
Posts: 4

wireshark-qt won't launch it's gui with elevated permissions

I recently switched from using Plasma to using Hyprland and tried to launch wireshark with root privileges but instead I got these error messages and program ceased to run.
https://prnt.sc/3cS4nVYDN8Ks
It's odd because when I try to launch it without the privileges its all alright and works.
Does anyone know possible solutions? I would be thankfull ^^

Last edited by Deshio (2024-12-10 22:52:30)

Offline

#2 2024-12-10 23:06:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,673

Re: wireshark-qt won't launch it's gui with elevated permissions

The solution is to not run wireshark as root.
https://wiki.archlinux.org/title/Wiresh … privileges

The errors are because sudo drops the environment and wireshark doesn't know what display server to connect to.
That's ok - whenever you feel like you need to run some GUI a root/sudo, you made an earlier mistake that lead to that conclusion.
Just don't. Step back and look for the solution that does not involve running some GUI as root.

Online

#3 2024-12-10 23:08:45

Deshio
Member
Registered: 2024-12-10
Posts: 4

Re: wireshark-qt won't launch it's gui with elevated permissions

seth wrote:

The solution is to not run wireshark as root.
https://wiki.archlinux.org/title/Wiresh … privileges

The errors are because sudo drops the environment and wireshark doesn't know what display server to connect to.
That's ok - whenever you feel like you need to run some GUI a root/sudo, you made an earlier mistake that lead to that conclusion.
Just don't. Step back and look for the solution that does not involve running some GUI as root.

Thanks for the quick reply!
Won't it affect how the program works although?

Offline

#4 2024-12-13 17:18:50

Deshio
Member
Registered: 2024-12-10
Posts: 4

Re: wireshark-qt won't launch it's gui with elevated permissions

Also when I run it with root permissions on KDE plasma it surprisingly works hmm/

Offline

#5 2024-12-13 17:29:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,673

Re: wireshark-qt won't launch it's gui with elevated permissions

If you're using eg. kdesu it might simply preserve the relevant environment, but this is still wrong and wireshark will work fine as long as dumpcap has the proper permissions and you user is member of the wireshark group. The GUI doesn't need elevated privileges at all.

Online

#6 2024-12-16 10:45:29

Deshio
Member
Registered: 2024-12-10
Posts: 4

Re: wireshark-qt won't launch it's gui with elevated permissions

Wireshark requires permissions simply because it captures network packets and stuff so it's not about the GUI.
Alright, it's werid because when I login as root and run the application it works fine.
I know it's not recommended to do it this way but I hope some one one day will have the solution.

Offline

#7 2024-12-16 12:03:55

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,513
Website

Re: wireshark-qt won't launch it's gui with elevated permissions

When you installed, pacman wrote:

NOTE: To run wireshark as normal user you have to add yourself into wireshark group

https://gitlab.archlinux.org/archlinux/ … e=heads#L3


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#8 2024-12-16 12:46:46

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,673

Re: wireshark-qt won't launch it's gui with elevated permissions

Since we'd been there I guess also https://deepl.com/

it's werid because when I login as root and run the application it works fine

There's also absolutely nothing weird about that:

seth wrote:

The errors are because sudo drops the environment and wireshark doesn't know what display server to connect to.

what doesn't happen when you run the entire session as root - what you're not supposed to do either.

Online

Board footer

Powered by FluxBB