What is WSL?
WSL (Windows Subsystem for Linux) is a way of running Linux programs on Windows. It brings the powerful Linux tools and programs to Windows.
Why should I install WSL?
Let’s say you want to get a load of photos printed, but they are stored in a whole load of folders from every date you imported them from your camera to your computer.
To do this in Windows, you’d have to open the first folder, selecting all the photos, copying them, then opening the destination folder and pasting them there, then repeating the operation for every folder you have photos in. This would take ages, depending on how many folders you have.
In WSL, you would simply type:
cp */*.jpg newfolder
The first line tells WSL to change into the Pictures library for the user, where [username] can be replaced by the user’s name. The second line tells WSL to copy all jpeg files stored in all of the folders into the folder called “newfolder”. Make sure the folder exists before running this command.
Additionally, if you wish to learn Linux or write programs in it, WSL is a good stepping stone. You can even install a web server and host websites from your computer.
How do I install WSL?
In order to install WSL you need to enable the optional feature by searching for PowerShell, right clicking and choosing “Run as Administrator” then clicking Yes. Then copy and paste the following command, followed by pressing return (or enter):
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Next stop is to open Microsoft Store and search for Linux
Now we can click on one, for this example, we will click on Ubuntu and press Get.
Now we can Launch the new app, this installs the app to your computer. You may be asked to set a username and password to use the system, this can be different to the details you use to log into your computer.
Once this is done, you will see a Linux prompt.
sudo apt-get update
sudo apt-get upgrade
Answer Y to any questions and your system will be up to date and ready for you to use.
In order to install X-Windows, you need to install an external program called an X server. Download VcXsrv and install it.
Start Ubuntu and type:
sudo apt-get install xfce4
sudo apt-get install xfce4-goodies
Add at the bottom of the file, the following:
Save and exit Ubuntu.
Next time you start Ubuntu you can type:
If everything went well, you will see the X-Windows GUI start up.
How do I uninstall a distribution from WSL?
Distributions are installed as apps, so they can easily be removed using Settings -> Apps, searching for the distribution (in this example, Ubuntu) and pressing Uninstall.