FSL downloaded in Windows, but X Display not accessible

Hi – I am a new FSL user and followed the instructions from FSL’s site on how to download FSL for Windows using WSL and with help from this slightly outdated video (Installing FSL on Windows 10 using WSL - YouTube). I am unable to get the other software needed to run the graphics to work.

I downloaded VcXsrv and ran these lines per the instructions (FslInstallation/Windows - FslWiki):

 echo "export DISPLAY=\$(grep nameserver /etc/resolv.conf  | awk '{print \$2; exit}'):0" >> ~/.bashrc
 echo "export LIBGL_ALWAYS_INDIRECT=1" >> ~/.bashrc

and then type “glxgears” and then this error is returned:
Error: couldn't open display

I also tried fsleyes and then this error is returned:

No protocol specified
No protocol specified
Unable to access the X Display, is $DISPLAY set properly?

I also installed XMing, even though that was causing issues for users in 2020ish, and the same errors are returned. Been looking for help, but haven’t found anything that works! Thank you in advanced!

(read through these, but nothing I tried worked: Unable to access the X Display, is $DISPLAY set properly? · Issue #63 · kevinhughes27/TensorKart · GitHub ----- ubuntu - WSL 2: Run Graphical Linux Desktop Applications from Windows 10 Bash Shell "Error E233: cannot open display" - Stack Overflow)

Dear @gclem,

Configuring X-forwarding on Windows with WSL and running an Xserver is a bit tricky. Are you using WSL1 or WSL2? Are you using Windows 10 or Windows 11 (Windows 11 makes this quite nice and easy using Wayland, but you need to configure a few things: Run Linux GUI apps with WSL | Microsoft Docs)?

An alternative for running FSL in WSL would be our open-source project Neurodesk.org - it only requires docker and provides a complete Neuroimaging environment including FSL :slight_smile:

If you have docker installed you could try this in your windows powershell:
docker run --shm-size=1gb -it --privileged --name neurodesktop -v C:/neurodesktop-storage:/neurodesktop-storage -p 8080:8080 -h neurodesktop-20220813 vnmd/neurodesktop:20220813

and see if this works for you :slight_smile:

Kind regards

1 Like

Hi @stebo85 – thanks so much for your reply! I do have docker installed and have run/am running the lines you sent. I would love to get FSL up and running with through docker, but it seems to be hung up at this step:


Does this usually take a long time (> 1hr)?

Otherwise, I’m using WSL1 and am on Windows 10.

Dear @gclem ,

It’s not stuck :slight_smile: it looks like it’s all working. You just need to click on the link in the terminal to open up neurodesk: http://localhost:8080/#/?username=user&password=password


Well, I certainly did not read the last last line of that screenshot! I was able to get NeuroDesk with the URL. Thank you! I am going to play around with this and read more of the documentation to figure out how this virtual environment really works before bugging you with more questions.

1 Like

Feel free to reach out anytime :slight_smile: Every question from users shows that our documentation is not yet good enough yet. Based on you not seeing the link we now made the link even more visible in the next version:

1 Like