Wireshark on ubuntu 20.4.1 WSL2 and AWS ubuntu instance

Viewed 4101

I'm trying to run wireshark on ubuntu 20.4 on the WSL2 on windows(pc). (I also tried this on a AWS instance Ubuntu and got the same error)

This is the error message I get when I try to run wireshark

qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt 
platform plugin "xcb" in "/opt/wireshark/libs/Qt/plugins/platforms" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb. Aborted

I ran export QT_DEBUG_PLUGINS=1 and got

Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/x86_64-linux- gnu/qt5/plugins/platforms/libqxcb.so"
Found metadata in lib /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so, metadata=
       {
            "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
            "MetaData": {
                "Keys": [
                    "xcb"
                ]
             },
            "archreq": 0,
            "className": "QXcbIntegrationPlugin",
            "debug": false,
            "version": 330752
         }
    
    
         Got keys from plugin meta data ("xcb")
         QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
         loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
         qt.qpa.xcb: could not connect to display
         qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "path/to/plugins" 
         even though it was found.
         This application failed to start because no Qt platform plugin could be 
         initialized. Reinstalling the application may fix this problem.

I've tried multiple solutions including https://askubuntu.com/questions/914664/cant-install-wireshark-failed-to-load-xcb-plugin, https://forum.qt.io/topic/93247/qt-qpa-plugin-could-not-load-the-qt-platform-plugin-xcb-in-even-though-it-was-found/8

i also tried setting all the permissions to 777 in the directory

i also tried unstalling and reinstall everything from scratch including ubuntu

I also tried running sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev

please help

P.S. I'm still a newbie and have no idea what I'm doing so please be straight forward and clear on what needs to be done... Thanks you,

2 Answers

Im not sure.. If you want use this application like (Wireshark,Etherape,etc), you have to install Remote Desktop Virtual like XRDP or win-kex in wsl2, why? Because that apps use interface right? Tutorial https://www.youtube.com/watch?v=AfVH54edAHU -> In the end video

So you can remote your Ubuntu like you install ubuntu distro on your PC. From there you can use wireshark or application that require interface.

Use root as login for the remote desktop, or if you want use another user, you can put "xhost +local:" on terminal before use "sudo wireshark".

Related