# Opening the graph window in root

**URL:** <https://root-forum.cern.ch/t/opening-the-graph-window-in-root/60119>\
**Category:** ROOT\
**Created:** [July 5, 2024, 12:24am UTC](https://root-forum.cern.ch/t/opening-the-graph-window-in-root/60119 "2024-07-05T00:24:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roy\_Wajda](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/roy_wajda/32/37062_2.png) [@Roy\_Wajda](https://root-forum.cern.ch/u/Roy_Wajda)\
**Post date:** [July 5, 2024, 12:24am UTC](https://root-forum.cern.ch/t/opening-the-graph-window-in-root/60119/1 "2024-07-05T00:24:47Z")

</div>

* * *

root [0] TF1 f1(“func1”,“x”,0,10)  
(TF1 &) Name: func1 Title: x  
root [1] f1.Draw()  
Info in TCanvas::MakeDefCanvas\>: created default TCanvas with name c1  
root [2]

Im trying to get started with ROOT. Im using bash, with ubuntu on WSL.  
I tried to open a graph but nothing happens when i type that code.

_ROOT Version:_ 6.32.02  
_Platform:_ Ubuntu on WSL  
_Compiler:_ cmake?

* * *

---

<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:** [July 5, 2024, 1:56am UTC](https://root-forum.cern.ch/t/opening-the-graph-window-in-root/60119/2 "2024-07-05T01:56:51Z")

</div>

You also have to install an X server (e.g. VcXsrv) and run Xlaunch before opening the Ubuntu window. See here for configuration:

> [@ROOT on Windows 11 WSL2 / WSLg](https://root-forum.cern.ch/t/root-on-windows-11-wsl2-wslg/48348/7):
>
> So I tried staying with WSL2 and using VcXsrv, and it works fine, as far as I have tested. I don’t know if behind curtains WSL is complaining for having 2 GUI servers, but it seems to work slight_smile Just for completeness, when using WSL2 and VcXsrv (don’t know with Xming), adding these lines to .bashrc is needed: export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2\>/dev/null):0 export LIBGL\_ALWAYS\_INDIRECT=1 but is not enough (in either Windows 10 or 11). When starti…

---

<div class="post-metadata">

**Author:** ![ferhue](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ferhue/32/29462_2.png) [@ferhue](https://root-forum.cern.ch/u/ferhue)\
**Post date:** [July 5, 2024, 9:56am UTC](https://root-forum.cern.ch/t/opening-the-graph-window-in-root/60119/3 "2024-07-05T09:56:16Z")

</div>

An alternative is to install ROOT directly on Windows, then you do not need to care about a WSL / X server, etc.

---

<div class="post-metadata">

**Author:** ![Roy\_Wajda](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/roy_wajda/32/37062_2.png) [@Roy\_Wajda](https://root-forum.cern.ch/u/Roy_Wajda)\
**Post date:** [July 7, 2024, 12:03am UTC](https://root-forum.cern.ch/t/opening-the-graph-window-in-root/60119/4 "2024-07-07T00:03:16Z")

</div>

Can I use Xming, and if I do how do I connect the X server to root

---

<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:** [July 7, 2024, 6:38am UTC](https://root-forum.cern.ch/t/opening-the-graph-window-in-root/60119/5 "2024-07-07T06:38:16Z")

</div>

It should be very similar, if not the same configuration as for VcXsrv; just try it and if it’s not the same, check the Xming documentation for the equivalent features.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [July 21, 2024, 6:38am UTC](https://root-forum.cern.ch/t/opening-the-graph-window-in-root/60119/6 "2024-07-21T06:38:30Z")

</div>

Closed on July 21, 2024, 6:38am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
