Windows Subsystem for Linux (WSL) has been available for Windows 10 since 2017 and is a complete operating system that you can enable on your Windows Server and also on Windows 10 devices.
– More on WSL, see https://techdirectarchive.com/2020/05/05/what-is-windows-subsystem-for-linux-wsl/
– Previously, “WSL” was originally known as the “Bash on Windows” feature and it allowed users to use Ubuntu bash commands in Windows PowerShell.
On how to install the Linux Subsystem (WSL) on Windows Server via Server Manager and PowerShell, see https://techdirectarchive.com/2020/03/18/how-to-install-windows-server-2019-in-virtualbox/
– On how to reset Windows 10, see https://techdirectarchive.com/2020/03/15/resetting-or-reinstalling-windows-10/
How does the Windows Subsystem for Linux (WSL) work?
WSL translates the Linux system calls returned by the process to the Windows kernel calls while a Linux Distro sits on top. It is thus eliminating the need for the Linux kernel in the process. So basically, it is Linux inside Windows. Furthermore, there is no emulation involved whatsoever.
In this Windows 10 WSL tutorial, we’ll show you how to install the Windows Subsystem for Linux in two methods.
- The Graphical User Interface (Windows Settings or Control Panel)
- Via PowerShell
After installing WSL, the Distro can be download or installed from Microsoft Store.
Part A: Via the Graphical User Interface (GUI). Follow step 1 and step 2 below in order to install WSL on your device. On how this can be installed via Windows Settings, see https://techdirectarchive.com/2020/04/26/wsl-error-wslregistraterdistribution-failed-with-error-0x8007019e/
Step 1 – Control Panel:
– Launch the control panel as shown below
Next, click on “Turn Windows feature On or Off” as shown below
This will on a window to Turn Windows Feature On or Off as shown below.
This process will search and apply required files as shown below
Next, you will be requested to restart now. Simply click on Restart now.
This restart is required in order to ensure that WSL can initiate a trusted execution environment.
Step 2 – Install the Linux Distro of your choice via Microsoft Store: Launch the Microsoft store and install your desired distro. The Linux distros that can be downloaded from the Microsoft Store and run via WSL are the complete Linux package, at least in terms of core functionality, with zero emulation required. So yes, by installing WSL and downloading a distro from the Microsoft store, you are running Linux in Windows.
Note: In this way, you will not have to download the distribution from Microsoft website. With the following steps, you are good to go.
– Search for your desired WSL Distro and
– Next, double click on Ubuntu 18.04 LTS as shown above
– Click on Get.
You will be required to sign in
– For me, I will not and will select “No, thanks” as shown below
It will prompt you to install, but if you do not click on Install, it will automatically begin the installation after a while. As you can see below.
When this steps completes, you will be prompted to launch the Ubuntu WSL as shown below
Note: If you do not have Windows Subsystem for Linux enabled. This will not work and you will be prompted with the error below. See this link for more information https://techdirectarchive.com/2020/04/26/wsl-error-wslregistraterdistribution-failed-with-error-0x8007019e/
Since WSL in installed, when you click on launch this will fire up a terminal. This will open a Linux terminal and complete the installation.
You’ll need to create a user ID and password since you are setting up a full Linux instance. You are now running Linux on Windows.
If you would like to test how the steps above can be done via PowerShell, follow the steps below.
Part B: Via PowerShell: Before installing any Linux distros for WSL, you must ensure that the “Windows Subsystem for Linux” optional feature is enabled.
Step 1: To ensure WSL for Linux is installed on Windows 10, run the following command below in PowerShell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Step 2: Install the Linux distro of your choice. To get this work, I was able to enter https://aka.ms/wsl-ubuntu-1604 on my Web browser and download Ubuntu for WSL as shown below.
For more information on how this is done, see https://techdirectarchive.com/2020/04/26/virtualbox-how-to-install-the-linux-subsystem-wsl-on-windows-server-via-server-manager-and-powershell/
For other distros, see the links below. You do not need administrative privileges to install the distribution because this takes place in the user's profile. The download links are:
– Ubuntu 18.04: https://aka.ms/wsl-ubuntu-1804
– Ubuntu 18.04 ARM: https://aka.ms/wsl-ubuntu-1804-arm
– Ubuntu 16.04: https://aka.ms/wsl-ubuntu-1604
– Debian GNU/Linux: https://aka.ms/wsl-debian-gnulinux
– Kali Linux: https://aka.ms/wsl-kali-linux
– OpenSUSE: https://aka.ms/wsl-opensuse-42
– SLES: https://aka.ms/wsl-sles-12
If you require addition information, kindly leave a comment below.