FslInstallation/Windows - FslWiki (2024)

  1. Introduction
  2. Mac Os X
  3. Linux
  4. Windows

    Contents

    1. Introduction
    2. Windows Subsystem for Linux
      1. System Requirements
      2. Accessing USB drives from Ubuntu
      3. WSL 1
    3. Virtual Machine
  5. Shell Setup

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).

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

  • Windows 10 or newer. You need to have Windows 10 version 2004 (Build 19041) or higher. You can find out your Windows version / build by opening the Settings app, and navigating to System > About.

  • The Windows Subsystem for Linux (WSL) can be installed by following these instructions. If you are using an older version of Windows and cannot upgrade, refer to this page for installation instructions.

  • Dual core CPU (recommended minmum)
  • 4GB RAM minimum (8GB+ recommended)
  • Minimum 10GB, up to 75GB, of free disk space

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.

  • wsl --install -d Ubuntu-20.04

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:

  • sudo apt updatesudo apt -y upgradesudo apt install bc dc python3 mesa-utils gedit pulseaudio libquadmath0 libgtk2.0-0 firefox libgomp1

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 NativeOpenGL and select Disableaccesscontrol in the ExtraSettings 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:

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

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

  •  echo "export LIBGL_ALWAYS_SOFTWARE=1" >> ~/.bashrc

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:\ProgramFiles\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 fslinstaller.py 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 fslinstaller.py script in the Ubuntu shell with this command. Replace <WindowsUserName> with your Windows account username:

  •  python "/mnt/c/Users/<WindowsUserName>/Downloads/fslinstaller.py"
    Say yes to all default install options. The installation can take some time, so please be patient, and do not abort the installation.

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 <LetterofUSBdriveinWindows> 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.

WSL 1

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 2wsl --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

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 fslinstaller.py script from here.

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

  •  cd ~/Downloads python fslinstaller.py

Some systems do not have a command called python, and will print errors like python:commandnotfound. If this happens try calling python3fslinstaller.py or python2fslinstaller.py.

FslInstallation/Windows - FslWiki (2024)

References

Top Articles
Latest Posts
Article information

Author: Barbera Armstrong

Last Updated:

Views: 6653

Rating: 4.9 / 5 (79 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Barbera Armstrong

Birthday: 1992-09-12

Address: Suite 993 99852 Daugherty Causeway, Ritchiehaven, VT 49630

Phone: +5026838435397

Job: National Engineer

Hobby: Listening to music, Board games, Photography, Ice skating, LARPing, Kite flying, Rugby

Introduction: My name is Barbera Armstrong, I am a lovely, delightful, cooperative, funny, enchanting, vivacious, tender person who loves writing and wants to share my knowledge and understanding with you.