# Draw() method - No window pops up

**URL:** <https://root-forum.cern.ch/t/draw-method-no-window-pops-up/52538>\
**Category:** Newbie\
**Created:** [November 28, 2022, 8:55pm UTC](https://root-forum.cern.ch/t/draw-method-no-window-pops-up/52538 "2022-11-28T20:55:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![oscar1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/35a633/32.png) [@oscar1](https://root-forum.cern.ch/u/oscar1)\
**Post date:** [November 28, 2022, 8:55pm UTC](https://root-forum.cern.ch/t/draw-method-no-window-pops-up/52538/1 "2022-11-28T20:55:47Z")

</div>

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):

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

```

iv) installed ROOT (6.26/10):

```auto
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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [November 28, 2022, 8:59pm UTC](https://root-forum.cern.ch/t/draw-method-no-window-pops-up/52538/2 "2022-11-28T20:59:25Z")

</div>

Can you display any utility? Try: `xterm`

---

<div class="post-metadata">

**Author:** ![oscar1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/35a633/32.png) [@oscar1](https://root-forum.cern.ch/u/oscar1)\
**Post date:** [November 28, 2022, 9:03pm UTC](https://root-forum.cern.ch/t/draw-method-no-window-pops-up/52538/3 "2022-11-28T21:03:07Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [November 28, 2022, 9:05pm UTC](https://root-forum.cern.ch/t/draw-method-no-window-pops-up/52538/4 "2022-11-28T21:05:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![oscar1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/35a633/32.png) [@oscar1](https://root-forum.cern.ch/u/oscar1)\
**Post date:** [November 28, 2022, 10:06pm UTC](https://root-forum.cern.ch/t/draw-method-no-window-pops-up/52538/5 "2022-11-28T22:06:57Z")

</div>

I understand. Thank you.

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [November 29, 2022, 8:39am UTC](https://root-forum.cern.ch/t/draw-method-no-window-pops-up/52538/6 "2022-11-29T08:39:18Z")

</div>

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

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

```

See also the thread [here](https://root-forum.cern.ch/t/root-on-windows-11-wsl2-wslg/48348/7).

---

<div class="post-metadata">

**Author:** ![oscar1](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/35a633/32.png) [@oscar1](https://root-forum.cern.ch/u/oscar1)\
**Post date:** [November 29, 2022, 10:52am UTC](https://root-forum.cern.ch/t/draw-method-no-window-pops-up/52538/7 "2022-11-29T10:52:09Z")

</div>

> [@dastudillo](#):
>
> rt DIS

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

> <https://stackoverflow.com/questions/63246287/configure-xming-display-on-wsl2/63645008#63645008>
