4.10 Windows Subsystem for Linux (WSL)

20210218

The Windows Subsystem for Linux (WSL) is available as a feature on Windows 10. Out-of-the-box WSL supports Ubuntu running within Windows. This is the simplest option if you have Windows 10 (1709 or later) installed (see Settings -> System -> About). It also requires the installation of XMing or VcXsrv. Microsoft also released WSLv2 in May 2020 to incorporate the Linux kernel directly within Windows, so as to deliver significant performance gains and support more applications. However WSLv2 is not currently recommended due to its limited access to Windows file systems from Ubuntu.

To get started

  • Install XMing on Windows (download, run, and choose the defaults for the installation).
  • Go to “Turn Windows Features On or Off” (Control Panel -> Programs -> Programs and Features), tick on the box ‘Windows Subsystem for Linux’ to install WSL and reboot.
  • Go to Microsoft Store and search for the latest Ubuntu distribution to install.
  • Launch Ubuntu from the Start menu or else type the command “ubuntu” in the Powershell.
  • For GUI applications run the command $ export DISPLAY=:0 in the Ubuntu terminal window.

Ubuntu is readily available on Microsoft’s Windows 10 where the Windows Subsystem for Linux (WSL) supports Ubuntu out of the box. This is the simplest option for installing Ubuntu if you already have Windows 10 (1709 or later) installed (see Settings\(\rightarrow\)System\(\rightarrow\)About).

To support GUI applications under WSL you will also need to install XMing or VcXsrv.

Microsoft also released WSLv2 in May 2020 to incorporate the Linux kernel directly within Windows, so as to deliver significant performance gains and support more applications.

The steps to install WSL and then Ubuntu on a Windows 10 system are provided by Microsoft and summarised here.

  • Install XMing on Windows (download, run, and choose the defaults for the installation).

  • Go to Turn Windows Features On or Off (Control Panel\(\rightarrow\)Programs\(\rightarrow\)Programs and Features), tick on the box Windows Subsystem for Linux to install WSL and reboot. The option can also be enabled from the PowerShell:

> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  • Go to Microsoft Store and search for the latest Ubuntu distribution and install it. It is a free application. Once you have obtained the app click the Launch button in the Microsoft Store. This will install and configure the Ubuntu distribution, including asking you to create a new username.

  • Launch Ubuntu from the Start menu or else type the command ubuntu in the Powershell.

  • For GUI applications run the command $ export DISPLAY=:0 in the Ubuntu terminal window.



Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0