Differences between revisions 2 and 44 (spanning 42 versions)
Revision 2 as of 2020-05-27 17:00:13
Size: 2071
Editor: buildqa
Comment:
Revision 44 as of 2021-05-26 02:22:39
Size: 4203
Editor: buildqa
Comment:
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
== Windows Subsystem for Linux (WSL) Install & Setup == == Windows Subsystem for Linux Install & Setup ==
Line 6: Line 6:
The Windows Subsystem for Linux (WSL) enables a Unix distribution to run in a "virtualized" environment under Windows OS. Some common linux distributions, e.g., CentOS and Ubuntu, are currently available from the Windows App store for download and use in WSL. The WSL terminal window looks much like what you would see in a virtual machine running on Windows, but includes access to your home directory on the Windows side via NTFS. So if your Windows username was "bill" then from the WSL terminal window you can see bill's download folder as /mnt/c/Users/bill/Downloads. The username you pick to run in the WSL linux environment has sudo/admin privileges and need not be the same as your username, e.g., "bill" on the Windows side. 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:
To setup WSL, the PowerShell must first be used to enable WSL. Then a linux distribution needs to be installed in the WSL environment. Subsequently additional software may need to be installed in the Linux distribution running under WSL will depending upon what you want to run there. In order to run X-windows based graphics programs in WSL, an X server needs to be installed on the Windows side (since unlike Linux, there is no default or native X server in Windows). Then the WSL linux environment may need to be additionally set/tested, e.g., to run X based graphics. 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:
The instructions below will show how to setup the WSL environment (under Windows 10) with a linux distribution in order to run Freeview (using a 3rd party X server running on Windows 10). 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:
WSL is still under development and changing with each release. WSL was not (at least initially) intended to reproduce a fully functional X based Linux GUI/desktop environment such as Gnome or KDE; it was primarily intended to give Windows developers a way to test their applications with Linux based services. That being said, WSL can be setup to display graphics with varying degrees of success for different Linux distirbutions. Steps for Setting Up WSL:
 i. Enable WSL on the windows machine +
 i. Install WSL on the windows machine +
 i. Download/install a linux distribution into WSL ++
 i. From a terminal window running inside the linux distribution, download and install freesurfer +++
 i. Download/install an X-server on the windows machine ++++
Line 14: Line 19:
=== Enable WSL from PowerShell === ''+ 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 CentOS 7, 8 and Ubuntu 18, 20. Other linux distributions have not been tested.''

''+++ We recommend using the freesurfer installer packages, i.e., the *.rpm file for (CentOS/RedHat) or the *.deb file for Ubuntu linux. Examples of using the installers on CentOS and Ubuntu are listed below. Installers for the freesurfer builds and releases can be found under,
 [[https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/dev/|Freesurfer 7.X.X nightly build installers]]

 [[https://surfer.nmr.mgh.harvard.edu/fswiki/rel7downloads|Freesurfer 7.X.X current release installers]]''

''++++ An example of installing the Xming X-server is listed below. These steps may vary depending upon the network settings on the Windows machine.''

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,

=== Setup and Install WSL version 2 ===

[[https://docs.microsoft.com/en-us/windows/wsl/install-win10|MS Dcoumentation for WSL version 2 setup and install]]

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.

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]]

=== 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]]

=== Install and Run an X-Server in Windows ===

[[https://surfer.nmr.mgh.harvard.edu/fswiki/FSL_wsl_xming|Install X-server (Xming)]]

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:

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

+ 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 CentOS 7, 8 and Ubuntu 18, 20. Other linux distributions have not been tested.

+++ We recommend using the freesurfer installer packages, i.e., the *.rpm file for (CentOS/RedHat) or the *.deb file for Ubuntu linux. Examples of using the installers on CentOS and Ubuntu are listed below. Installers for the freesurfer builds and releases can be found under,

++++ An example of installing the Xming X-server is listed below. These steps may vary depending upon the network settings on the Windows machine.

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,

Setup and Install WSL version 2

MS Dcoumentation for WSL version 2 setup and install

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.

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

WSL_CentOS_intsall

WSL_Ubuntu_intsall_TBD

Install and Run an X-Server in Windows

Install X-server (Xming)

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