QT 5 XCB not able to connect to display

1.2k Views Asked by At

I am on windows 11 using Ubuntu 22.04.1 LTS in Wsl. I have openFOAM installed and built aswell as paraview. Whenever I go to launch paraview in openFOAM I get this error:

qt.qpa.xcb: could not connect to display :0.0
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-username'
Segmentation fault (core dumped)

Maybe I need to set a different display? However, after several google attemps I have yet to find the command for that.

Thanks!

2

There are 2 best solutions below

3
On

Try the following:

  • Find the local IP address of your Windows machine by following these instructions. you can also use the command line prompt: Press Windows Key+R, type cmd and press Enter. In the command line prompt, type ipconfig.

  • For example, let's assume that after following the previous step you've found the local IP address to be 192.168.1.55

  • In WSL, run the following commands (replace the IP address with your own):

    export DISPLAY="192.168.1.55:0"
    paraview
    
  • If Paraview runs correctly, add the export command to your ~/.bashrc to make that change permanent:

    echo 'export DISPLAY="192.168.1.55:0"' >> ~/.bashrc
    
0
On

Follow s.ouchene's comment, and open the XLaunch, it works.

Download the VcXsrv installer. (if the above link does not work, go to the VcXsrv files page and download the latest vcxsrv-64.X.X.X.X.installer.exe file). Run XLaunch that was installed by VcXsrv. Open the “Extra settings” window and: a) Deselect (uncheck) “Native opengl”; b) Select “Disable access control”.