What is WSL?
Windows Subsystem for Linux WSL is an architecture that uses virtualization technology to allow you to run lightweight virtual machines directly on Windows 10. This feature allows you to run a real Linux environment without a virtual machine.
WSl 2 is an upgraded architecture that still uses the same user experience as WSL 1 but with a real Linux kernel and is faster.
How is WSL different from running Linux on a VM?
WSL uses fewer resources than a full virtual machine in regards to CPU, memory, and storage. WSL also enables you to use Linux command-line tools and programs alongside Windows command-line, desktop, and store apps, as well as access Windows files from Linux. If you want, you can use both Windows programs and Linux command-line tools on the same set of files.
In this guide, I will show you how to;
- Install WSL on Windows 10
- Downloading Ubuntu 20.04 from Microsoft Store
- Launching Ubuntu 20.04 from its terminal on Windows
- Downloading GWSL from Microsoft store
- Installing GUI Applications on Ubuntu to run on Windows, e,g, VLC and Google Chrome
Installing WSL on Windows 10 System
What do you need?
Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11.
Installing WSL via settings
- Go to the “search bar” and search for “Turn Windows features on or off“. Click on it once you get the results.
- A pop up window opens and then look for the option Virtual Machine Platform and Windows Subsystem for Linux then mark the checkbox next to both of them to enable and click Okay.
- The Windows Features searches the required files and applies the new features..
- Once that is done, Click on Restart Now to Reboot the system.
Installing Ubuntu 20.04 LTS
After Restart, Go to the Microsoft Store and search Ubuntu 20.04 LTS and click on it.
Click Get to download and install the Linux Distro.
Then click Open to launch the program.
Once Opened, it will take some few minutes to complete Installation.
Afterwards, You will be prompted to create a Username and Password to your liking then press Enter. The password is not visible while typing hence be keen while inputting the password.
It says Installation Successful! And you are done with the procedure.
Upgrading WSL 1 to WSL 2
By Default the WSL installed is Version 1.
It is recommended to use WSL version 2 as it is faster, quicker and uses virtualization technology. It boots up very quickly and compiles very fast as compared to WSL 1.
You can do this by using Powershell as an administrator.
- Right click on Start Button then select Windows Powershell (admin) to open it as an admin.
- Use the code
wsl -l -vto view the version you are using.
- Then use the code
wsl –set-version ubuntu-20.04 2to upgrade to version 2. (The conversion may take a while to finish)
- Then once you use
wsl -l -vcode again it will show version 2 is running.
Running Linux GUI Applications on WSL
Installing GWSL from Microsoft store
GWSL is an Xserver for Windows 10 that automates the process of running X on top of WSL and over SSH.
- It enables you to run graphical Linux apps on Windows 10 with ease.
- It allows you to run graphical applications on remote Linux machines.
- It has a simple user interface for launching Linux applications, managing them graphically, and creating customized Windows shortcuts for them.
To Install GWSL, Open Microsoft Store and search for GWSL.
Click on Get to download and install the app.
Once done click on open, then allow GWSL to pass the Windows Firewall in order to communicate with WSL 2.
The Localhost is up and running
Installing GUI Apps
Installing VLC on WSL2
Open the Linux Distros you have, in our case the Ubuntu 20.04 LTS.
sudo apt install vlc to install vlc then press Enter, Confirm the password to allow the installation.
Confirm the required packages needed to run the application by typing y for Yes. This might take some time to finish depending on the package that is being installed.
Once the VLC has been installed you will find it in the GWSL server on the bottom right of your screen under linux apps.
Then click on it to open the VLC media player.
Installing Chrome browser on WSL
To install Google chrome, use the code below to download the .deb package for Chrome.
See screenshot below:
Then use the below code to install the package on the system.
sudo dpkg -i google-chrome-stable_current_amd64.deb
Then confirm to proceed with the installation.
Once installation is done open google chrome from GWSL menu at the bottom right under notification icons.
Then click on Google Chrome to open it.
Then Google Chrome Opens.
WSL 2 is a good feature for a Linux Beginner. It includes a seamless integration between Windows and Linux, fast boot times, a small resource footprint, and requires no VM configuration or management. The VM runs in the background. It is lightweight and allows you to access Linux networking apps.