# Help configuring Wireshark capabilities

**URL:** <https://forum.systemcrafters.net/t/help-configuring-wireshark-capabilities/1100>\
**Category:** Guix\
**Created:** [November 1, 2024, 3:33am UTC](https://forum.systemcrafters.net/t/help-configuring-wireshark-capabilities/1100 "2024-11-01T03:33:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PuercoPop](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/puercopop/32/585_2.png) [@PuercoPop](https://forum.systemcrafters.net/u/PuercoPop)\
**Post date:** [November 1, 2024, 3:33am UTC](https://forum.systemcrafters.net/t/help-configuring-wireshark-capabilities/1100/1 "2024-11-01T03:33:57Z")

</div>

Hi,

After installing Wireshark in Guix, one is unable to use it as the dumpcap executable needs to be given some capabilities using setcap ([CaptureSetup/CapturePrivileges - Wireshark Wiki](https://wiki.wireshark.org/capturesetup/captureprivileges#setting-network-privileges-for-dumpcap-if-your-kernel-and-file-system-support-file-capabilities))

Guix provides the [privileged programs](https://guix.gnu.org/manual/devel/en/html_node/Privileged-Programs.html) API to accomplish that. Although although all the uses of the record I found where about setting the setuid of the program, not specific capabilties.

I’m trying to do that as part as _home_ service. The goal being that it could be upstreamed so that guix users can have a working Wireshark out of the box. However I’m having trouble referring to the dumpcap executable in the Wireshark package. Any pointers?

[https://git.sr.ht/~puercopop/glue/tree/b7e5215b767e7aee487f7ac0039385a4fe90c67f/item/src/glue/services/wireshark.scm](https://git.sr.ht/~puercopop/glue/tree/b7e5215b767e7aee487f7ac0039385a4fe90c67f/item/src/glue/services/wireshark.scm)

```shell
puercopop@kraken ~/src/glue
$ ./pre-inst-env guix home container src/conf/home-scratch.scm
guix home: error: no target of type 'privileged-program' for service 'wireshark-home-service-type'

```

---

<div class="post-metadata">

**Author:** ![irandms](https://avatars.discourse-cdn.com/v4/letter/i/8e8cbc/32.png) [@irandms](https://forum.systemcrafters.net/u/irandms)\
**Post date:** [November 1, 2024, 12:03pm UTC](https://forum.systemcrafters.net/t/help-configuring-wireshark-capabilities/1100/2 "2024-11-01T12:03:24Z")

</div>

Unfortunately I don’t have a pointer for you in regards to the privileged programs API; instead, I found this mailing discussion reply from Ludovic, which implies that one should prefer to one-shot run wireshark as sudo from the command line, rather than go through setuid which could weaken overall security: [Re: Running Wireshark as non-root](https://lists.gnu.org/archive/html/help-guix/2016-11/msg00046.html)

Unfortunately for me, I get “could not connect to display” errors even when trying to do that under Sway. It seems like the package doesn’t just work out of the box straightforwardly.

Wireshark working under sway as non-root (or even as root…) is one of the few things that eludes me after half a year of trying Guix out casually.

---

<div class="post-metadata">

**Author:** ![theesm](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/theesm/32/175_2.png) [@theesm](https://forum.systemcrafters.net/u/theesm)\
**Post date:** [November 2, 2024, 2:39am UTC](https://forum.systemcrafters.net/t/help-configuring-wireshark-capabilities/1100/3 "2024-11-02T02:39:25Z")

</div>

> Unfortunately for me, I get “could not connect to display” errors even when trying to do that under Sway.

Use `sudo -E guix shell wireshark -- wireshark` (`-E` is to preserve environment, as otherwise the context wireshark is run in has no knowledge of the display env variable, hence the error) or better, add the display variable to `env_keep` in your `/etc/sudoers` file (if I don’t forget, I’ll provide a configuration example for this tomorrow).
