NS-3 - NetAnim error: qt.qpa.xcb: could not connect to display localhost:0.0

2k Views Asked by At

I'm using WSL with 'xrdp & xfce4' running to access X-Server. I'm trying to run 'NetAnim' for NS-3, using Qt5.

As soon as I run:

$ ./NetAnim

It gives an output:

qt.qpa.xcb: could not connect to display localhost:0.0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" 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 (core dumped)

I've tried:

export DISPLAY=0:0

Still gives the same output.

2

There are 2 best solutions below

0
On BEST ANSWER

Got it solved! What I did is:

  1. Enabled Virtualization in BIOS.
  2. Reset the WSL.
  3. Upgraded WSL1 to WSL2.
  4. Set WSL: 2 as default, <deb_pack>: 2 default.

Using WSL2 doesn't really make fuss with Qt.

0
On

You probably hit a well known but poorly documented WSLv1 issue: it cannot parse the ABI-tag properly and crashes. https://github.com/Microsoft/WSL/issues/3023

It can be solved by stripping away the tag with the following command (requires sudo)

find /lib /usr/lib /usr/libexec -name 'libQt5Core.so' | xargs strip --remove-section=.note.ABI-tag