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,