Complete ROOT Installation Instructions for WSL (Ubuntu 18.04 on Windows 10)

From @olifre :

  1. Install WSL ( https://aka.ms/install ) and then Ubuntu 18.04 from the Windows Store. The first step is not needed anymore for most recent Windows 10 versions, I think.
  2. Start the freshly installed Ubuntu Bash shell and install the dependencies and some build tools:
    sudo apt update && sudo apt dist-upgrade
    sudo apt install build-essential libtbb-dev libtiff5 x11-apps git
  3. Now there’s no graphics, since WSL does not ship any X server. You can fix that e.g. by installing Xming and then running inside the Bash shel:
    export DISPLAY=localhost:0.0
    Xming needs to be running when using this setup!
  4. Now, the regular Ubuntu 18.04 instructions apply, i.e. download the tarball from the ROOT webpage (with wget), extract it, run source root/bin/thisroot.sh and you can run ROOT with graphics!
2 Likes

And for WSL2, see also Install WSL on Windows 10 | Microsoft Docs
and Running WSL GUI Apps on Windows 10

More on WSL2 (graphics troubleshooting): ROOT on Windows 11 WSL2 / WSLg - #7 by dastudillo

and some updates to the instructions above for WSLg: Improvements to WSL instructions with WSLg

1 Like