Again: Flair cannot connect to X

I am sorry to occupy the forum with a question only indirectly related to Fluka.
As some users before, I am also not able to connect Flair to the X-server.
I tried Xming and MobaXterm, adjusting the settings as here recommended in previous questions.
Unfortunately, all I got is the message "couldn’t connect to display “:0” "
I suspect that I forgot something more fundamental.
When things are correctly installed, does one simply evoke the command “flair” in the Ubuntu Terminal window ? For me, I receive the error message above, no matter if I give the command in the Ubuntu Terminal for a terminal opened in MobaXTerm.
I have duly exported the DISPLAY=:0 in .bashrc, with no success.
Can yo suggest another place to look for an installation error ?
Thank you all, Thomas

Dear Thomas,

could you check the log file of Xming? (Right click on the icon on the task bar, then select View Log)

What is written in the line after XdmcpRegisterConnection:?

Cheers,
Saheed

Dear Saheed,

I read in the logfile
XdmcpRegisterConnection: newAddress 172.18.240.1

I edited the file /etc/profile.d/wsl.sh in the way suggested to you last week (Flair can't connect to display using WSL2 ),
but then I receive from flair the error message
couldn’t connect to display “172.18.240.1:0”

Best regards, Thomas

Dear all,

I found a solution to my problem:
I copied the command

export DISPLAY="`grep nameserver /etc/resolv.conf | sed 's/nameserver //'`:0"

in .bashrc (instead of in wsl.sh, as previously suggested).
With this change, I can launch a terminal with MobaXTerm, from which I can successfully launch the GUI of flair !

Best regards, Thomas