Differences between revisions 33 and 56 (spanning 23 versions)
Revision 33 as of 2021-05-25 17:04:20
Size: 5786
Editor: buildqa
Comment:
Revision 56 as of 2023-09-05 00:43:19
Size: 4128
Editor: buildqa
Comment:
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
== Windows Subsystem for Linux (WSL version 2 and 1) Install & Setup == == Windows Subsystem for Linux Install & Setup ==
Line 6: Line 6:
The Windows Subsystem for Linux (WSL) enables a Linux distribution to run in a "virtualized" environment under Windows OS without utilizing a VM host application such as VirtualBox. Common Linux distributions such as Ubuntu, CentOS and Fedora are available from the Windows App store for download and use in WSL; some like Ubuntu Linux are free.  WSL is primarily intended to give Windows developers a way to test their applications with Linux based services but not reproduce a complete X based Linux GUI/desktop environment such as Gnome or KDE. The Windows Subsystem for Linux (WSL) enables a Linux distribution to run in a "virtualized" environment under Windows OS without utilizing a VM host application such as VirtualBox. Common Linux distributions such as Ubuntu, CentOS and Fedora are available from the Windows App store for download and use in WSL; some like Ubuntu Linux are free.
Line 8: Line 8:
The WSL terminal window resembles what you would see in a terminal on a linux VM hosted on Windows. WSL includes access to your home directory on the Windows side via NTFS. So if your Windows username was "bill" then from the WSL linux terminal window you can see bill's download folder as /mnt/c/Users/bill/Downloads. This mount point is a convenient way to share files between your Windows home directory and WSL. The username you pick to run in the WSL Linux environment has sudo/admin privileges and need not be the same as your username on the Windows side. WSL is primarily intended to give Windows developers a way to test their applications with Linux based services but not reproduce a complete X-Windows based Linux GUI/desktop environment such as Gnome or KDE (which you see on your linux workstation). For Linux running inside WSL on windows, the desktop and terminal window will look like what you see for the default desktop and terminal settings for that particular linux distribution.
Line 10: Line 10:
To manually setup WSL, the PowerShell must first be used to enable WSL. Then your Windows machine can be updated to install and run WSL. Next, a linux distribution needs to be installed in the WSL environment. Then freesurfer can be installed in the linux distribution; we recommend using one of the freesurfer installer packages, e.g., the *.rpm file for (CentOS/RedHat) or the *.deb file for Ubuntu linux. Finally, an X Windows server needs to be installed in Windows since the Windows OS is driving the graphics hardware which in turn hosts WSL. WSL includes access to your home directory on the Windows side via NTFS. So if your Windows username was "bill" then from the WSL linux terminal window you can see bill's download folder as the linux path /mnt/c/Users/bill/Downloads in your default shell, e.g., bash, tcsh. This mount point is a convenient way to share files between your Windows home directory and Linux running in WSL. The username you pick when you setup the WSL environment has sudo/admin privileges in the linux environment and need not be the same as your username on the Windows side.
Line 12: Line 12:
As of this writing, WSL version 2 is available. If no version of WSL is currently installed on your Windows machine, then follow these instructions to install WSL version 2, Steps for Setting Up WSL to run freesurfer:
 i. Enable WSL on the windows machine +
 i. Install WSL on the windows machine +
 i. Download/install a linux distribution into WSL ++
 i. Download/install an X-server on the windows machine +++
 i. From a terminal window running inside the linux distribution, download and install freesurfer ++++
Line 14: Line 19:
https://docs.microsoft.com/en-us/windows/wsl/install-win10 ''+ These steps may be combined into a single command for WSL version 2; see the link to the MS documentation. Your windows machine will be updated and re-booted.''
Line 16: Line 21:
If you previously installed WSL version 1 on your machine, then you can also install WSL version 2 and pick one version to use as the default. There appears to be no requirement to switch to WSL version 2 if you are already working with WSL version 1. Installing WSL version 2 should not prevent using linux images you've worked with under WSL version 1. The instructions in the link above should work if WSL version 1 is already on your system. ''++ For a linux distribution we recommend Ubuntu 22.''
Line 18: Line 23:
The previous instructions for the manual setup and install of WSL version 1 are listed below (skip if using WSL version 2). ''+++ An example of installing the Xming X-server is listed below. These steps may vary depending upon the network settings on the Windows machine. Please check that you have given Xming permission to connect through the Firewall using Windows Defender.''
Line 20: Line 25:
The instructions for installing the Xming X-server may vary depending upon your machines network settings. ''++++ We recommend using the freesurfer installer packages, i.e., the *.deb file for Ubuntu linux.''
Line 22: Line 27:
=== Setup and Install WSL version 2 ===
Line 23: Line 29:
=== Enable WSL Version 1 from PowerShell === As of this writing, WSL version 2 is available. If no version of WSL is currently installed on your Windows machine, then follow the MS documentation to install WSL version 2,
Line 25: Line 31:
Bring up a PowerShell window, [[https://surfer.nmr.mgh.harvard.edu/fswiki/FS7_wsl_ubuntu|Freesurfer WSL2]]
Line 27: Line 33:
{{attachment:WSL_setup_2.png}} Previous instructions for the manual setup and install of WSL version 1 (skip if using WSL version 2),
[[https://surfer.nmr.mgh.harvard.edu/fswiki/FSL_wsl_version_1|Enable WSL version 1 from PowerShell]]
Line 29: Line 36:
Run the "enable optional feature" command. You should be able to cut and paste the command from the MS documentation,
[[https://docs.microsoft.com/en-us/windows/wsl/install-on-server|WSL_install]]
=== Install and Run an X-Server in Windows ===
Line 32: Line 38:
{{attachment:WSL_setup_3.png}} [[https://surfer.nmr.mgh.harvard.edu/fswiki/FSL_wsl_xming|Install X-server (Xming)]]
Line 34: Line 40:
=== Install and Run a Linux OS in WSL - Install and Run Freesurfer in Linux ===
Line 35: Line 42:
=== Install Xming X-Server and Fonts === Example OS's running under WSL and installing freesurfer on them:
Line 37: Line 44:
Download a copy of the Xming X-server and the corresponding X-fonts from the (Xming) web site, [[http://www.straightrunning.com/XmingNotes|Xming]]. The paid 7.x version is preferable to the free 6.X version, however the 7.x version is not free. The examples below will show using the 6.x version, i.e., the 6.x version of the X-server and the 7.x version of the fonts have been downloaded into the Downloads folder in the screen shot below. Please note there are other X-servers available for Windows besides Xming. [[https://surfer.nmr.mgh.harvard.edu/fswiki/FS7_wsl_ubuntu|WSL_Ubuntu_freesurfer]]
Line 39: Line 46:
{{attachment:xming_and_fonts.png}} [[https://surfer.nmr.mgh.harvard.edu/fswiki/FS7_wsl_centos|WSL_CentOS_freesurfer]]
Line 41: Line 48:
You can choose a freesurfer distribution to install from the following links:
Line 42: Line 50:
First install the Xming server. You can accept the defaults presented by the installer menus including allowing it to install "Xming" and 'Xlaunch" shortcuts on the desktop. Freesurfer releases have gone through testing for recon-all and freeview. We recommend installing the latest release unless you have some work in progress that requires installing an older release.
 [[https://surfer.nmr.mgh.harvard.edu/fswiki/rel7downloads|Freesurfer 7.X.X current release installers]]
Line 44: Line 53:

{{attachment:xming_install_1.png}}

{{attachment:xming_install_2.png}}

{{attachment:xming_install_3.png}}

{{attachment:xming_install_4.png}}

{{attachment:xming_install_5.png}}

{{attachment:xming_install_6.png}}


You should have both an '''Xming''' and an '''Xlaunch''' icon on your desktop after the successful install of Xming.


{{attachment:X_desk_icons.png}}


Next install the corresponding X-fonts,


{{attachment:install_xfont_1.png}}

{{attachment:install_xfont_2.png}}

{{attachment:install_xfont_3.png}}

{{attachment:install_xfont_4.png}}

{{attachment:install_xfont_5.png}}


Now double click the '''Xlaunch''' icon and go through the steps below to create and save an X configuration file in the same folder where Xming is installed.


{{attachment:xlaunch_2.png}}

{{attachment:xlaunch_3.png}}

{{attachment:xlaunch_4.png}}

{{attachment:xlaunch_6.png}}


=== Test Launching Xming ===


Test to see if the Xming server will run by double clicking on its desktop launch icon. You will probably get a message from Windows Defender reporting it has been blocked from running by default. Give Xming permission to run on both local and public networks.

{{attachment:xming_run_test_1.png}}

Once Xming is running, it should be visible by clicking on the small up arrow like symbol in the lower left hand corner of the Windows 10 desktop. This will reveal "hidden" items that are running and Xming (with the X icon) should be one of them. You can right click on it to exit Xming.

{{attachment:xming_run_test_2.png}}


=== Install and Run a Linux OS in WSL ===

With both WSL enabled and an X server setup under Windows, you are now ready to install and run a Linux distribution in WSL.

[[https://surfer.nmr.mgh.harvard.edu/fswiki/FS7_wsl_centos|WSL_CentOS_intsall]]

[[https://surfer.nmr.mgh.harvard.edu/fswiki/FS7_wsl_ubuntu|WSL_Ubuntu_intsall_TBD]]
Development stream builds contain ongoing development work and code changes that are the basis for future freesurfer releases. The development stream packages have not gone through the same testing and Q/A for stability as an actual freesurfer release.
 [[https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/dev/|Freesurfer 7.X.X development stream nightly build installers]]

Windows Subsystem for Linux Install & Setup

The Windows Subsystem for Linux (WSL) enables a Linux distribution to run in a "virtualized" environment under Windows OS without utilizing a VM host application such as VirtualBox. Common Linux distributions such as Ubuntu, CentOS and Fedora are available from the Windows App store for download and use in WSL; some like Ubuntu Linux are free.

WSL is primarily intended to give Windows developers a way to test their applications with Linux based services but not reproduce a complete X-Windows based Linux GUI/desktop environment such as Gnome or KDE (which you see on your linux workstation). For Linux running inside WSL on windows, the desktop and terminal window will look like what you see for the default desktop and terminal settings for that particular linux distribution.

WSL includes access to your home directory on the Windows side via NTFS. So if your Windows username was "bill" then from the WSL linux terminal window you can see bill's download folder as the linux path /mnt/c/Users/bill/Downloads in your default shell, e.g., bash, tcsh. This mount point is a convenient way to share files between your Windows home directory and Linux running in WSL. The username you pick when you setup the WSL environment has sudo/admin privileges in the linux environment and need not be the same as your username on the Windows side.

Steps for Setting Up WSL to run freesurfer:

  1. Enable WSL on the windows machine +
  2. Install WSL on the windows machine +
  3. Download/install a linux distribution into WSL ++
  4. Download/install an X-server on the windows machine +++
  5. From a terminal window running inside the linux distribution, download and install freesurfer ++++

+ These steps may be combined into a single command for WSL version 2; see the link to the MS documentation. Your windows machine will be updated and re-booted.

++ For a linux distribution we recommend Ubuntu 22.

+++ An example of installing the Xming X-server is listed below. These steps may vary depending upon the network settings on the Windows machine. Please check that you have given Xming permission to connect through the Firewall using Windows Defender.

++++ We recommend using the freesurfer installer packages, i.e., the *.deb file for Ubuntu linux.

Setup and Install WSL version 2

As of this writing, WSL version 2 is available. If no version of WSL is currently installed on your Windows machine, then follow the MS documentation to install WSL version 2,

Freesurfer WSL2

Previous instructions for the manual setup and install of WSL version 1 (skip if using WSL version 2), Enable WSL version 1 from PowerShell

Install and Run an X-Server in Windows

Install X-server (Xming)

Install and Run a Linux OS in WSL - Install and Run Freesurfer in Linux

Example OS's running under WSL and installing freesurfer on them:

WSL_Ubuntu_freesurfer

WSL_CentOS_freesurfer

You can choose a freesurfer distribution to install from the following links:

Freesurfer releases have gone through testing for recon-all and freeview. We recommend installing the latest release unless you have some work in progress that requires installing an older release.

Development stream builds contain ongoing development work and code changes that are the basis for future freesurfer releases. The development stream packages have not gone through the same testing and Q/A for stability as an actual freesurfer release.

FS7_wsl (last edited 2023-09-05 00:43:19 by buildqa)