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

Hi @stebo85 – been making progress on this, but I wanted to mount an additional folder/connection between NeuroDesktop and my machine.

I modified and ran this line:
docker run --shm-size=1gb -it --privileged --name neurodesktop -v C:/neurodesktop-storage:/neurodesktop-storage -v Z:/PEA:/data -p 8080:8080 -h neurodesktop-20220813 vnmd/neurodesktop:20220813

I was expecting a folder called /data to show up on the Desktop, but it’s not there. The Z:\PEA folder I’ve tried to mount is a lab server that I have mapped to my local machine. I suspect this might be causing the issue?

Ideally, I would like to be able to see into this folder on NeuroDesktop because all of the data I want to process are here (Z:\PEA) and it would eliminate moving files from this location to my local hard drive and then to NeuroDesktop and back.

Dear @gclem,

What you did should have worked, so let’s debug this:

  1. Are you getting any errors when running this in docker?
  2. Are you executing this in powershell?
  3. Can you access Z:\PEA from powershell (e.g. “dir Z:\PEA”)
  4. When you open a terminal in Neurodesktop, what happens when you run “ls /data” - any errors?

Thank you

Hi Steffen – my answers are below

  1. No docker errors that are obvious to me (see screenshot below for output, if you can read it)’

  2. Yes I am using powershell

  3. Yes, I can see the PEA directory and subfolders from powershell (which I have never done before so that’s cool!)

  4. When I run “ls /data” in Neurodesktop, nothing happens… I was expecting a list of subfolders… I tried it with and without a space between the slash because it was hard to tell if there should be one. And still no output/list…


Dear @gclem,

That all looks good and it should have worked :frowning: - so I unfortunately don’t know why the files do not show up for you. Do you see files under /neurodesktop-storage when you copy them to C:/neurodesktop-storage ?

One other thing you could try: Instead of using “-v Z:/PEA:/data” you could try “-v Z:/:/data”

Otherwise, I unfortunately don’t know and it could be an issue with your docker installation, so maybe updating your docker installation is worth a shot.

Another thought: You could potentially also try to run neurodesk via WSL. For this you would need to use the Linux command:

sudo docker run \
  --shm-size=1gb -it --privileged --name neurodesktop \
  -v ~/neurodesktop-storage:/neurodesktop-storage \
  -e HOST_UID="$(id -u)" -e HOST_GID="$(id -g)"\
  -p 8080:8080 \
  -h neurodesktop-20220813 vnmd/neurodesktop:20220813

you would then need to add -v /mnt/Z:/data \

Thank you

Dear @gclem,

I had one more idea: Can you directly mount the network share within Neurodesktop? Then you would avoid a huge performance bottleneck as well, because it wouldn’t translate between filesystems twice.

Thank you

Thanks for the ideas! I haven’t tried them yet, but, when I copy files into C:/neurodesktop-storage I can see the files. And I have been working with 1 participant’s files using neurodeskop-storage and that works seamlessly.

When I tired to mount the Z:/PEA folder, I had to shut down Neurodesktop and re-download it in docker. Is that the only way to mount a drive? I am thinking specifically about your "-v Z:/:/data " suggestion. I don’t want to close out of my current Neurodesktop session because I am working in it.

I am happy to directly mount the network share in Neurodesktop, but I am not sure how to do that. (I will look into it and reply again if it works).

Dear @gclem,

Yes, adding a new mount-point to the docker container can unfortunately only be done by restarting the container.

To directly mount the network share you could try to use the file explorer function “Connect to Server …”:

All the best