=== Freesurfer on Ubuntu Linux in WSL ===
Please read the latest MS documentation about how to setup WSL (version2 as of this writing) on your Windows machine, [[https://docs.microsoft.com/en-us/windows/wsl/install-win10|MS WSL Dcoumentation]]. Once you are able to bring up a terminal window in WSL's installed version of Ubuntu linux you can proceed to setting up the Freesurfer environment with the commands listed below. As of this writing, WSL should install Ubuntu 22 Linux and so the setup of the Freesurfer Ubuntu 22 package is described below.
The commands below show how to download, install and setup the freesurfer distribution using its installer package. We do not support manually installing packages in the WSL Ubuntu Linux image apart from using the provided Freesurfer installer. Once Freesurfer is installed, you can proceed to setting up a 3rd party X-windows server on the host Windows machine. Please note that if you do not need to view any brain images, e.g., through Freeview, then there is no need to setup the X-Windows server.
The commands listed below can be cut and pasted into the Linux terminal window. Some commands set environment variables while others should display the expected output in order to proceed to the next step. However, you may not be able to debug where something went wrong if you are completely unfamiliar with the Linux "bash" shell syntax and grammar. If you are having difficulty understanding the commands listed below, then please consider reviewing one of the many Linux command line tutorials found online, e.g.,
<
>
[[https://maker.pro/linux/tutorial/basic-linux-commands-for-beginners|Linux Commands for Beginners]]
<
>
[[https://www.youtube.com/watch?v=cBokz0LTizk|Linux command line tutorial video]]
<
>
'''Launch the WSL application in Windows, wait for Ubuntu linux to boot, and then open a new terminal window in the Ubuntu Linux desktop GUI. You should see a prompt, e.g., dollar sign in, the terminal window where you can start typing in the commands below (cut and pasting should work).'''
<
>
... go to your "HOME" directory in Linux ...
<
><
>
developer@DESKTOP-LD48TB7:~$ '''cd'''
<
><
>
... download the freesurfer installer package ...
<
><
>
developer@DESKTOP-LD48TB7:~$ '''wget https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer_ubuntu22-7.4.1_amd64.deb'''
<
>
<
><
>
... check the installer file exists ...
<
><
>
developer@DESKTOP-LD48TB7:~$ '''ls freesurfer_ubuntu22-7.4.1_amd64.deb'''
<
>
freesurfer_ubuntu22-7.4.1_amd64.deb
<
><
>
... update the package information in Ubuntu linux ...
<
><
>
developer@DESKTOP-LD48TB7:~$ '''sudo apt-get update -y'''
<
>
[sudo] password for developer:
<
>