Differences between revisions 30 and 31
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 (WSL version 2 and 1) 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. 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 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. 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.
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 to run on the Windows side and/or in the Linux distribution running under WSL depending upon what you want to run under Linux. 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.
Line 10: Line 10:
In order to run X-windows based graphics programs in WSL, an X server needs to be installed on the Windows side (since the Windows OS is driving the graphics hardware and there is no native X server in Windows). Accordingly, the WSL linux environment needs to be set/tested to run X based graphics in WSL with the X server running under Windows (instead of under Linux). To manually setup WSL, the PowerShell must first be used to enable WSL and 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. This is different than a typical linux machine setup where the linux machine directly runs both freesurfer and a native X Windows server.
Line 12: Line 12:
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 under Windows 10). WSL is still under development and changes with each release. 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,
Line 14: Line 14:
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. https://docs.microsoft.com/en-us/windows/wsl/install-win10
Line 16: Line 16:
=== Enable WSL from PowerShell === 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. Installing WSL version 2 should not prevent using linux images you've worked with under WSL version 1. There appears to be no requirement to switch to WSL version 2 if you are already working with WSL version 1. The WSL version 2 instructions in the link above should work if WSL version 1 is already on your system.

The previous instructions for setting up and installing WSL version 1 are listed below (skip if using WSL version 2).

The instructions for installing the Xming X-server may vary depending upon the version of WSL in use and your machines network settings.


=== Enable WSL Version 1 from PowerShell ===
Line 28: Line 35:
=== Install a Windows X Server and Fonts === === Install Xming X-Server and Fonts ===
Line 30: Line 37:
Use of the Xming X server will be shown in the examples below. Please note there are other X-servers available for Windows.

Download a copy of the 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.
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.

Windows Subsystem for Linux (WSL version 2 and 1) 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 based Linux GUI/desktop environment such as Gnome or KDE.

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.

To manually setup WSL, the PowerShell must first be used to enable WSL and 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. This is different than a typical linux machine setup where the linux machine directly runs both freesurfer and a native X Windows server.

WSL is still under development and changes with each release. 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,

https://docs.microsoft.com/en-us/windows/wsl/install-win10

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. Installing WSL version 2 should not prevent using linux images you've worked with under WSL version 1. There appears to be no requirement to switch to WSL version 2 if you are already working with WSL version 1. The WSL version 2 instructions in the link above should work if WSL version 1 is already on your system.

The previous instructions for setting up and installing WSL version 1 are listed below (skip if using WSL version 2).

The instructions for installing the Xming X-server may vary depending upon the version of WSL in use and your machines network settings.

Enable WSL Version 1 from PowerShell

Bring up a PowerShell window,

Run the "enable optional feature" command. You should be able to cut and paste the command from the MS documentation, WSL_install

Install Xming X-Server and Fonts

Download a copy of the Xming X-server and the corresponding X-fonts from the (Xming) web site, 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.

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.

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

Next install the corresponding X-fonts,

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.

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.

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.

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

FS7_wsl (last edited 2021-06-02 16:09:27 by buildqa)