Draw() method - No window pops up

Hello,
I have done the following:

i) installed Linux (Ubuntu 20.04.5 LTS) on Windows with WSL
ii) installed Xming e Xming-fonts (‘Public Domain Releases’)
iii) set the environment variable to use the graphic server at point ii):

cd $HOME
echo 'export DISPLAY="localhost:0"' >> $HOME/.bashrc
. $HOME/.bashrc

iv) installed ROOT (6.26/10):

sudo apt-get update
sudo apt-get install git dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev libxft-dev libxext-dev
wget https://root.cern.ch/download/root_v6.26.10.Linux-ubuntu20-x86_64-gcc9.4.tar.gz
sudo tar -xvf root_v6.26.10.Linux-ubuntu20-x86_64-gcc9.4.tar.gz -C /usr/local/
echo 'source /usr/local/root/bin/thisroot.sh' >> $HOME/.bashrc
. $HOME/.bashrc

After those steps I can successfully run ROOT.
So I run Xming in the background and try the first lines of code from the ROOT primer.
Everything works till I get to this:

TF1 f1("f1","sin(x)/x",0.,10.);
f1.Draw();

Upon entering the second line I get this message:

Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1

but no windows pop up.

Would you have any suggestions?
Thank you.

Can you display any utility? Try: xterm

Thank you for replying. I get this message upon entering xterm:

xterm: Xt error: Can't open display: localhost:0

So, it’s clearly not any ROOT problem.
You need to search WSL and/or Xming forums.

I understand. Thank you.

Instead of export DISPLAY="localhost:0, you can try these lines in your .bashrc (especially ff you have WSL2):

export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0
export LIBGL_ALWAYS_INDIRECT=1

See also the thread here.

Thank you for your reply. I have eventually resolved the problem by running the code in the document linked within the following answer: