Windows 10 has encroached on Linux with the WSL card – Windows Subsystem for Linux (Windows subsystem for Linux). With the release of WSL2, an updated version of WSL, users can now use the Linux kernel (Linux kernel) to execute Linux tasks from Windows. With the introduction of the latest version of Windows 20H1, WSL2 is already set for official release. So, in this article, I will guide you to install Windws Subsystem for Linux on Windows 10.
Join the channel Telegram of the AnonyViet 👉 Link 👈 |
First of all, if you want to learn about Windows Subsystem for Linux on Windows 10, the following article will introduce you to what is WSL and WSL2? Let’s still grasp the basics before continuing.
WSL2 or Window Subsystem for Linux 2 provides users console environment Linux in Windows 10. So you will be able to run Linux binaries from Windows 10 without using a virtual machine. Furthermore, WSL can be used for services and tools in the Linux kernel. on the command-line interface. But the most important is still bash shell.
In this tutorial, I will show you how to install Windows Subsystem for Linux in 2 ways.
- Using a graphical user interface (GUI)
- Using PowerShell and Command line on Windows 10
Also, I will show you how to install different Linux distros from the MIcrosoft Store. But, if you want to install those distros then it is imperative that you install WSL first.
Install Windows Subsystem for Linux using the GUI
Request:
- Stable internet connection.
- Windows 10 Aniniversary Edition 1607 for WSL.
- Windows 10 insider version 18917 for WSL2.
- Hyper-V support.
Setting WSL by software Settings and Control Panel is the most preferred method, as it is very easy to use. Here are the steps to install WSL in Windows 10:
- Press Windows + CHEAP and type Controls.
- Continue to click on the item Programs.
- Under the place Programs and Features. Press Turn Windows Features on or off.
Alternatively, you can also open the app Settings on Windows 10 and then go to Apps > Programs and Features > Turn Windows features on or off.
- Now, the Windows Features window has appeared. Here, you can turn Windows features on and off using checkboxs.
- In the list of checkboxs, scroll down and find the option Windows Subsystem for Linux.
- Tick in that checkbox.
- Press OK to install WSL on Windows 10.
- Finally, press Restart Now.
Install Windows Subsystem for Linux with Windows 10 Powershell
If you’ve ever used Linux, you’re no stranger to using commands anymore. For these people, typing commands is more fun than using GUI (admittedly, using commands is fun).
Different from installing WSL2 using GUI, we can also use Powershell to enable WSL in Windows 10. To install WSL using Powershell, follow these steps:
- Press Start menu and type Powershell.
- Right mouse go to the first result and select run the application as an administrator.
- Type the following command and press Enter:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- After running the command, PowerShell will ask you to restart the machine to apply the changes.
- So you guys press “Y” to complete and confirm reboot the machine.
After rebooting, your Windows 10 has Windows Subsystem installed.
Install Linux Distros on Windows 10
After installing Windows Subsystem for Linux, we can proceed to install Linux distros in the Microsoft Store.
- Press Start and then select Microsoft Store.
- Search for your favorite distro to install on Windows 10.
- If you want to see all Linux distros on Microsoft Store, you can search keyword Linux and press Enter.
- Finally, press Install or Get.
After the installation is complete, the distro will be located in Start Menu. When you run the distro for the first time, a short setup process takes place. Basically, it will ask for the username and password you want to set for Linux.
WSL2 settings: Change from WSL to WSL2
After you have successfully installed the Linux distro with WSL, you must change from WSL to WSL2. Until you make the change successfully, the distro will still run in the WSL environment.
- Open PowerShell with Admin rights.
- Check if Linux is installed with the command:
wsl -l
- Next, run the command:
wsl --set-version <distro> 2
Replace “
” with the name of the Linux distro you installed - You can use the command below to set WSL2 as the default architecture for all Linux distros.
wsl --set-default-version 2
Uninstall Linux distro on Windows 10
You can uninstall Linux distros with the following:
- Open the app Settings.
- Select item Apps, then press Apps & Features.
- Select distro and press Uninstall.
And so that Linux distro has been completely removed from your computer.
Uninstall or Disable Windows Subsystem for Linux
Uninstalling or disabling WSL on Windows 10 is also very simple. To uninstall WSL on Windows 10, follow the steps below.
- Open the software Settings.
- Select the Apps Settings item.
- Go Apps > Programs and Features > Turn Windows Features on of off.
- Scroll down to options Windows Subsystem for Linux.
- Uncheck that box.
- Click OK and restart the machine.
Uninstall or Disable WSL on Windows 10 Using PowerShell
- Open PowerShell with admin rights and enter the command below:
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- Press Y to restart the machine.
You have successfully disabled Windows Subsystem for Linux on your device.