Last updated:

Windows 10 provide a neat integration with the Linux kernel which allows you to run any binary from your favorite Linux distribution directly from Windows. This feature is called Windows Subsystem for Linux (WSL) and it opened a whole new world of opportunities.

  1. Start an elevated PowerShell session using the shortcuts Win+X A
  2. Enable WSL:
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux. You must restart after enabling this feature.

👉 The first version of WSL come with some drawback and performance issues so you may want to use WSL2 instead. To do so, you will need to become a Windows insider as it requires a Windows 10 build 18917 or higher. You can check the well-documented steps on Microsoft Docs.

From there, you can either use the Windows Store (recommended) to install a Linux distribution available like Kali Linux or Ubuntu 20.04 LTS. If you choose this path, then once you installed the Ubuntu distro, you can directly launch Bash from a command prompt Win+r then bash.

👉 If you are new to Ubuntu 20.04 LTS, see the post What’s New In Focal Fossa Ubuntu 20.04 LTS?.

Install from a WSL RootFS Image

To get a more recent distribution or a development one, you may need to install directly from a rootfs image. The example below download a Ubuntu 19.10. Make sure to replace <YourUserDir> with your actual Windows user directory.

  1. After rebooting, start a PowerShell session using the shortcuts Win+X i
  2. Download the Ubuntu 19.10 wsl rootfs tar file:
    Invoke-WebRequest -OutFile C:\Users\<YourUserDir>\Downloads\eoan-server-cloudimg-amd64-wsl.rootfs.tar.gz
  3. We will keep the manually installed distro in a WSL folder:
    mkdir C:\Users\<YourUserDir>\WSL
  4. Import the image to WSL:
    wsl --import Ubuntu-19.10 C:\Users\<YourUserDir>\WSL\Ubuntu-19.10 C:\Users\<YourUserDir>\Downloads\eoan-server-cloudimg-amd64-wsl.rootfs.tar.gz
  5. Check the installed distribution with:
    wsl --list.
  6. Start our newly installed distribution using: wsl -d Ubuntu-19.10
  7. You are now logged into your Linux shell. Check your bash version: bash --version
root@DESKTOP-XXXXXXX:~# bash --version
GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


👉 To know more about the new bash version 5 $EPOCHSECONDS variable, check the post What’s New in GNU Bash 5?