WSL2 allows you to run a Linux distro on top of windows without the need of something like VMware or Virtual Box
The Windows Subsystem for Linux or WSL is a great way to try out and learn Linux directly on Windows without the need for a hypervisor like VMware or Virtual Box.
The WSL version 1 or simply WSL executed Linux commands by translating them to Windows equivalent commands. But WSL2 brought many changes including a real Linux kernel under the hood. Let's get started on how to install WSL2 on our Windows 10 system.
Pre-requisites
- Make sure your Windows 10 is updated to version 2004 or higher. You can check your version by going to the start menu (Press WIN key) and type winver and press enter.
The OS build number for version 2004 is 19042.264. So as long as you have a higher build number than that you are good to go. If you don't have the latest version you will have to update your Windows.
- Next go to start menu and type Turn windows features on or off and press enter. In the window that opens up, make sure that Virtual Machine Platform and Windows Subsystem for Linux options are checked. It should look like this
Installation
Open Command prompt or PowerShell
To List all the Linux distributions available for installation, type the command wsl -l -o or wsl --list --online and press enter. By default the latest version of Ubuntu will be installed.
To install just type in the command wsl --install -d [distro name] or simply wsl --install to proceed with the default Ubuntu installation. For example
You will need to restart your system to complete the installation.
After completion you will be asked for a root user name and password. So make sure you give something you can remember as it will be used to grant sudo permissions.
You can install more distros using the same process as above. Use wsl --list command to list all the installed distros.The distros can be launched from the start menu or from the Command prompt/ PowerShell using the command wsl -d [distro]
Happy Learning !
Powered by Froala Editor
Powered by Froala Editor
0 Comments
Leave a Comment