Linux Distros in Windows 10 with Windows Subsystem for Linux

Author: Shazin Sadakath


Linux is the defacto Operating System for the Cloud and some of the widely used Programming languages (Ruby), Data stores (Redis), Map-Reduce Processing systems (Hadoop), etc run exclusively in Linux distros and don't have first class support for Windows.

For this reason Windows 10 has developed a way to run Linux distros as Apps without the need for a Virtual Machine or Container using Windows Subsystem for Linux (WSL). Genuine Linux ELF64 binaries loaded into lightweight "PicoProcesses" where WSL exposes Linux-compatible System Call Interface (SCI) & calling convention and Utilizes existing NT Kernel API’s such as shared network, storage, IO, etc. with Windows host.

WSL processes continue running after console windows are closed which is great for running websites & services in background

Let's have a look at how to install WSL and Ubuntu Linux Distro, Apart from Ubuntu following Linux Distros are also supported to run in WSL.

Step 1 - Install WSL by opening a PowerShell in Administrator Mode and Running the following command.

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Step 2 - Reboot Windows

Step 3 - After successful rebooting open Windows App Store and Search for Ubuntu App and Click on Get button to install.

Step 4 - Open Installed Ubuntu App and Setup a User with a password

Step 6 - Run your favourite Linux Commands 

sudo ls /mnt/c to list all Files/Directories in the C: drive and pipe with grep to filter only Files/Directories matching name Users

After installing WSL you can run Linux Commands and/or Windows Commands inside Ubuntu Shell and Run WSL commands inside PowerShell also which allows more powerful interoperability between the two Operating Systems as demonstrated below where we use Ubuntu command sudo ls /mnt/c to list all Files/Directories in the C: drive and use Windows Powershell command select-string (similar to grep) to show only Files/Directories matching name Users.

Processes started using Ubuntu Shell will be visible to Windows Task Manager as it is. 

References



Tags: WSL Windows10 Linux Ubuntu
Views: 415
Register for more exciting articles

Comments

Please login or register to post a comment.


There are currently no comments.