Jump to content

Windows Subsystem for Linux

From Wikimedia Belgium

You can easily run Linux on Windows using the Windows Subsystem for Linux (WSL), a Microsoft Windows guest system for Linux.

A rich list of Linux tools are available, but a lot of people are still running Microsoft Windows, so it can be advantageous to have Linux readily available on Windows.[1]

Since 2019 Microsoft delivered WSL 2, that offers a nice Linux experience on Windows 11, without the need to install an emulator like VirtualBox; it has a built-in emulator.

Advantages

[edit]
  • You don't need to partition your hard disk
  • Very easy to install and upgrade
  • Extremely fast (95% relative to native Linux performance)
  • No other software necessary:
    • No emulator or virtual machine required
    • Available as a simple option on Windows 11
  • Built-in X Window server: you can run X Window applications without an X Window emulator like Exceed
  • Uses all 12 cores (?) instead of only 6 cores in VirtualBox
  • Seamless integration with Windows
    • Access to all Windows file systems (most of them are compatible with Linux)

Options

[edit]

The default distribution is Ubuntu, but you can choose your own (including Android).

Prerequisites

[edit]
  • Windows 11
    • administrator PowerShell for the initial installation
    • user mode sessions can be run with the normal PowerShell
  • Hardware:

Installation

[edit]

Extremely easy: start an (administrator) PowerShell, then:

wsl -l
wsl --install

Now you can test if X Window is working:

xclock &

To upgrade:

wsl --update

Technology

[edit]

It is using parts (9P protocol) of the Plan 9 OS (from Bell Labs). This way it can access e.g. a One Drive for external storage.

Linux upgrade

[edit]

Use the standard Linux apt update and apt upgrade commands.

Known problems

[edit]

Linux filesystem requirements

[edit]

Some specific Linux functionality require a native Linux filesystem, and fails with the 9P protocol. Examples: the Pywikibot user password file (must be protected by the native 600 access mask).

Asynchronous upgrade stops the console

[edit]
WSL rondt een upgrade af...

Alternative solutions

[edit]
[edit]

References

[edit]
  1. Admin Magazine 72 p 40, Windows Subsysem for Linux and Android in Windows 11