TBrowser won't open


Please read tips for efficient and successful posting and posting code

ROOT Version: ROOT 6.22/00
Platform: Ubuntu shell
Compiler: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0


Hello,

Somehow the TBrowser don’t show up when I type “new TBrowser()” , but instead I get the following message:

root [0] new TBrowser()
Error in TGClient::TGClient: can’t open display “localhost:0.0”, switching to batch mode…
In case you run from a remote ssh session, reconnect with ssh -Y
(TBrowser *) 0x55b6b4e54b70

I have installed the Xming program and entered “export DISPLAY=localhost:0.0” in the bashrc file, but the problem persists.

Hi @fabstr ,
are you on Windows, using WSL? If yes please see Complete ROOT Installation Instructions for WSL (Ubuntu 18.04 on Windows 10) .

Also, can you run any graphical application besides ROOT?

Cheers,
Enrico

I have done everything on that link, but I still get the same error message.

I don’t know I only have root installed at the moment.

Ok, I’m assuming you are on WSL. Can you try running e.g. xclock ? You might have it already installed, if not I think you need a sudo apt install x11-apps. I would like to figure out whether this is a ROOT-specific problem or not.

Cheers,
Enrico

When I type xclock, I get the following message:

Error: Can’t open display: localhost:0.0

I guess my problem is not with root but with the X server ?

Looks like it. Someone on this forum might happen to know what’s up (although you might want to edit the title to reflect your actual problem), otherwise you might have more luck on stackoverflow or similar :confused: sorry!

As basic check, make sure Xming is actually running, not just installed; its icon should be in the Windows taskbar near the clock.
If you are using WSL 2, try using WSL 1 instead (check out “Set your distribution version to WSL 1 or WSL 2” on the WSL page). You could also try VcXsrv instead of Xming, but they should work the same.

For WSL2, it’s

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

WSL2 uses a virtualized network adapter that has it’s own IP address, whereas WSL1 shares the native network stack, so this compensates for the WSL2 networking difference

2 Likes

My Xming is running. I have installed the ubuntu shell version for windows 10.

What do you mean by “ubuntu shell version”?
The safest bet is to install Ubuntu 20.04 LTS from the MS Store (step 6 on the page I linked; search for Ubuntu and select 20.04 LTS); then run it from the Windows start menu.

Yes, I did that. I still have the same problem

Do I have to login as a root user in order for it to work ?

No, and there is no root account in Ubuntu by default anyway (you use “sudo”, but it’s not needed to run ROOT). Did you install the dependencies? Even if you don’t compile ROOT, I think some are needed (only skip the “optional” ones).
To better be safe than sorry, I would uninstall ubuntu (even WSL) and restart from scratch, and although it can work on WSL2 I’d stay with WSL1. Also make sure you are installing the precompiled ROOT version for Ubuntu 20.04 (and gcc 9.3).

I have installed al Required packages Permalink. Ok, I will uninstall and reinstall ubuntu again from scratch. But I don’t know if I’m using the WSL1 or WSL2.

I followed these steps when I downloaded root:

$ wget https://root.cern/download/root_v6.22.00.Linux-ubuntu19-x86_64-gcc9.2.tar.gz
$ tar -xzvf root_v6.22.00.Linux-ubuntu19-x86_64-gcc9.2.tar.gz
$ source root/bin/thisroot.sh # also available: thisroot.{csh,fish,bat}

Is this enough, or should I do something else ?

Correct, this means your problem is not related to the ROOT installation

Get root from the top of this page, on the Download link; on that page, follow the “latest stable ROOT release” link (currently 6.22/06), which will take you here:

(this changes with every release, so always start from Download).
And there, get the version for Ubuntu 20; you downloaded “…Linux-ubuntu19…” which may probably work too, but there is a version for 20 that you should use. Of course, this (unlike wget) will download it to a Windows folder, and you have to untar it inside Ubuntu… or you can copy the file link and edit your wget (and tar) line accordingly.
Before that you should install the dependencies; again, make sure you are on the Ubuntu section of that page.

So should I use wget root_v6.22.06.Linux-ubuntu20-x86_64-gcc9.3.tar.gz ?
I’m new to ubuntu and root, so I’m not sure if it’s correct.

I have just reinstalled Ubuntu and root, but the problem persists

As discussed above, if xclock doesn’t work either, the problem is not related to ROOT. Does @James-Carroll 's suggestion not work either?

Weird, I have installed Xming but nothing happens.