Canvas display on wsl

Im am trying to make root work on my windows 10 pc. I have a wsl and I work on ubuntu-20.04. The problem is that no matter what I’ve tried, I can’t display canvases when executing a program. I know for sure it is not the program’s fault but the fact that it seems very difficult to accesso to graphic applications via windows. I’ve also tried to use xming and other similar applications but I can’t use them properly and eventually I always end up at the starting point. Thanks to anyone who will be so kind to respond

Welcome to the ROOT forum! If you search the forum, you can find several topics about this kind of issue… For example:

and so on…

Thank you so much! I’ll be sure to check them to find a solution

(see also Complete ROOT Installation Instructions for WSL (Ubuntu 18.04 on Windows 10) for our unofficial guide to ROOT on WSL)

1 Like

I’m on Windows 11, WSL2 with Ubuntu 20.04 and Xming – some GUI objects work, but I’m having trouble specifically with canvases. TBrowser works perfectly, and some windows from code I’m using that have GUI sliders for peak fitting and stuff like that work perfectly, but canvases with graphs aren’t working. When I hover over the Xming taskbar icon, I can see there’s an instance called c1, but it’s empty, and I can’t actually make that window active – while I can for the other GUI windows that open with it, as well as TBrowser. Any updates on what might be causing this? I couldn’t find other forum posts about canvases in particular, just people whose GUIs aren’t working at all because of X11 installation problems.

What version of ROOT? In any case, try reinstalling Xming and also ROOT (use the precompiled binary for Ubuntu 20.04); if still not working, maybe try VcXsrv instead of Xming, and chcek out these tips:

I have version 6.26/06, and I installed from the pre-compiled library originally. I’ll try VcXsrv, thanks.
I already have the edited .bashrc (needed to add the export display line to get Xming to work in the first place), and yes I tick “Disable access control” using Xlaunch. Every other ROOT GUI I’ve run works (and some test X11 apps, like Xclock and Xeyes), except for TCanvas. I’ll try VcXsrv and reply back.

VcXsrv didn’t work either – nothing happened when I tried to open any X-app (including testers like Xeyes, nor the TBrowser), and yes I set the export display settings in .bashrc as recommended. The terminal just sat there like it was doing something, but the X server window never popped up, even though it was running after I launched it using XLaunch (and setting the Disable access control setting).

Trying WSLg – WSL’s new native GUI server – it’s kind of working, menus are offset. Same problem as ROOT on Windows 11 WSL2 / WSLg, but that apparently never got solved.

Besides the menus showing up in weird places, TBrowser is working though – can click things, open ROOT files, display histograms. I can also create a canvas now. So I’m going to call using WSLg a solution, for now.

Did you make sure VcXsrv was running? and with the settings I mentioned in my post? For me it worked (and still works) with the steps I followed there. You can also try removing and reinstalling Ubuntu (even WSL), maybe something went ‘crazy’ at some point and a fresh install will cure it :slight_smile:

Yes it was running – had the icon in the tray – and yes with the settings. (I had to use the same ones with Xming). A fresh install would mean several days of re-compiling things that were hard to get the settings right for in the first place! (I’m looking at you Geant4 :rage:)

Fortunately, WSLg seems to be working pretty well – except for the fact that I can only have a GUI open in one instance of the Ubuntu terminal. (For example, I can’t have TBrowser open in one terminal instance and open a canvas in another). Which is gonna be roughhhhh. Might just try and get the new Ubuntu Desktop going at this point! Not that I have any great love for Ubuntu’s GUI.

ETA: Okay I made a dumb, I forgot I hadn’t added the export DISPLAY=:0 to my .bashrc yet, so once I opened a new terminal, the WSL GUI wasn’t working at all because I hadn’t run the export command…modified the .bashrc, now everything is working.

If you go that way and since (like me) you don’t like the “standard” Ubuntu GUI, I would recommend Xubuntu instead :slight_smile: which uses the XFCE desktop environment.