Install WSL2 on Windows 10 and use Ubuntu

This post shows how to install Windows Subsystem for Linux (WSL2) on Windows 10 and use Ubuntu environment on it.

Install WSL2

Run the following command on Administrator’s PowerShell.

wsl --install

The supported operating systems are:
– Windows 10 version 2004 and higher
– Windows 11

This command will install WSL2, download the latest Linux kernel and install Ubuntu that is a default distribution.

Using WSL2

How to use

Click Ubuntu icon from start menu to run Ubuntu terminal.
You can run Linux commands on it.

How to access Windows drive

Fixed volumes on Windows (e.g. C:\) are mounted automatically on Ubuntu on WSL.
For example, C:\ is mounted on /mnt/c

How to run Linux commands from Windows

Run the following command on Windows command prompt to run Linux command on WSL

wsl <Linux command>

For example: if you run ls -la /

wsl ls -la /