We recommend using Linux or macOS for using FSL. However FSL can be used on Windows via the Windows Subsystem for Linux (WSL, Windows 10 and newer, recommended option) or by running the Linux version of FSL inside a virtual machine (VM).

Windows Subsystem for Linux

This is the recommended option for using FSL on a Windows computer.

We have created an installation video which gives an overview of the installation procedure for the Windows Subsystem for Linux using Windows 10.

System Requirements

Follow these steps to install Ubuntu into the Windows Subsystem for Linux:

1. Enable WSL by opening PowerShell as administrator. Paste this command in and press enter. Follow any prompts given.

2. Restart your computer

3. Start the "Ubuntu" app to open an Ubuntu shell.

4. Set up a username and password for Ubuntu (only necessary the first time you launch it)

Now follow these steps to install FSL into your Ubuntu machine:

1. Copy+paste these commands into the Ubuntu shell to install a few FSL dependencies:

2. On Windows 10, you need to install a separate application in order to use the FSL user interfaces. We currently recommend installing VcXsrv - this will install an application called XLaunch. When running XLaunch, it is critical to deselect Native OpenGL and select Disable access control in the Extra Settings panel. You need to start the XLaunch app in order for graphical applications in Ubuntu to work.

3. In order for VcXsrv to work, you will need to add these lines to your .bashrc file. Copy+paste the following lines into the Ubuntu shell:

For Windows 11 you will also need to add run an additional command:

4. Try running glxgears. A window with three spinning gears should open. If this doesn't work, it is possible that Windows Defender Firewall has blocked the VcXsrv process. Go to Control panel > System and security > Windows defender firewall > Advanced settings > Inbound rules and make sure that the VcXsrv rules are not set to block - if they are you will need to edit the VcXsrv rule and change it from block to allow.

If the rule is missing then the process to add a new rule is: Windows Defender —> Advanced Settings —> Inbound Rules ( left panel ) —> New Rule ( right panel ) —> Program —> This Program Path (C:\Program Files\VcXsrv\xlaunch.exe) —> Next x3 —> Finish ( pick a name like “xlaunch” or “VcXsrv" )

5. Use any web browser installed on your Windows computer to get the script from here. Download it to your Downloads folder. When selecting the OS to install on the download page, it is important to choose Ubuntu (the Linux version installed by WSL) and not Windows, or you will be directed to the VM instead of the installer script.

6. Run the script in the Ubuntu shell with this command. Replace <WindowsUserName> with your Windows account username:

FSL must be installed into the WSL file system - do not try and install FSL into a location in your Windows file system. The safest option is to accept the default location, which is /usr/local/fsl/.

7. Close and re-open the Ubuntu shell.

8. Try running the fslmaths, fsl, and fsleyes commands.

Accessing USB drives from Ubuntu

If you want to mount other folders or drives (e.g USB drives), create a directory in your Ubuntu file system where the drive will be mounted - replace <usb> with a name of your choosing:

sudo mkdir /mnt/<usb>

Now mount the USB drive with this command, replacing <Letter of USB drive in Windows> with the letter that the USB drive appears as in Windows:

sudo mount -t drvfs <Letter of USB drive in Windows> /mnt/<usb>

For example, if your USB drive appears as drive E, you would run this:

sudo mount -t drvfs E: /mnt/<usb>

This mount command will need to be rerun each time you start a new WSL session.


We strongly recommend using WSL 2 over WSL 1. If you have WSL 1, you can update to WSL 2 by opening PowerShell as administrator, and running these commands:

wsl --set-default-version 2
wsl --set-version Ubuntu-20.04 2

If for some reason you are unable to upgrade to WSL 2, you may need to install Xming instead of VcXsrv. You can download Xming from here. You will need to have Xming running in windows, before any linux GUIs will work. If you decide to use Xming, you will need to run this command to add an extra line to your .bashrc file:

echo "export DISPLAY=localhost:0.0" >> ~/.bashrc

Virtual Machine

If you are unable to use the Windows Subsystem for Linux (WSL) as outlined above, another option for using FSL on a Windows computer is to use a virtual machine (VM). You can use the freely available VirtualBox, or VMWare Workstation if you have a licence.

There are many online tutorials which describe how to install and set up a virtual machine, e.g.:

FSL can be installed into most modern Linux distributions - we recommend an Ubuntu LTS release, such as 20.04 or 22.04.

Once you have installed a Linux VM, you can install FSL in the same way as for other platforms.

1. Use a web browser inside the VM to download the script from here.

2. Open a terminal inside the VM, and run:

Some systems do not have a command called python, and will print errors like python: command not found. If this happens try calling python3 or python2


FslInstallation/Windows (last edited 11:02:08 30-08-2023 by MatthewWebster)