WSL — Windows Subsystem for Linux

Sudheer Kumar
2 min readAug 1, 2020
Photo by Sai Kiran Anagani on Unsplash

WSL is a very easy way to run Linux on top of Windows. the following are the pre-requisites:

a. You must be running Windows 10 version 1607 (the Anniversary update) or above.

b. WSL will only run on 64-bit versions of Windows 10. 32-bit versions are not supported.

Install WSL

Run Powershell as an Admin and remember you need to re-start your system after this.

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

Now after re-start, run Ubuntu from Windows Store.

After install, run the app : Ubtuntu 20.04 TLS

Create Credentials

First time you run the app, it will make you create a user-id and set an admin password. Please store them securely.

Windows Folder Mapping

Once you logged in, type the following command to find the current user directory.

>pwd

/home/<username>

This folder maps to the following folder on windows.

C:\Users<user_id>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs\home\cvsudheer

Copy files from Windows to WSL

Now copy a file and folder to the above home directory in WSL. Note that you need to close the Ubuntu app window so that it will be listed when you type: >ls

See the contents of the file:

>cat test.txt

You will see message : Permission denied

To set permissions on the file:

>chmod 600 text.txt

To see the permissions on the file

>ls -al test.txt

Give permission to the copied directory

>chmod +rwx <folder-name>

Now the file and folders are accessible from WSL.

--

--

Sudheer Kumar

Experienced Cloud Architect, Infrastrcuture Automation, Technical Mentor