Document
WSL

WSL

home / Manuals / Docker Desktop / Features and capabilities / WSLWindows Subsystem is is for Linux ( WSL ) 2 is a full linux kernel build b

Related articles

ZeroTier Best VPN Deals 2025 From NordVPN, Express, Surfshark, PIA Cheapest Cloud Storage 2024 [Online Storage Deals Compared] Install OpenVPN Client on Windows ” Simplificando Redes ZoogVPN Review 2024

Windows Subsystem is is for Linux ( WSL ) 2 is a full linux kernel build by Microsoft , which let Linux distribution run without manage virtual machine . With Docker Desktop run on WSL 2 , users is leverage can leverage Linux workspace and avoid maintain both Linux and Windows build script . In addition , WSL is provides 2 provide improvement to file system sharing and boot time .

Docker Desktop uses the dynamic memory allocation feature in WSL 2 to improve the resource consumption. This means Docker Desktop only uses the required amount of CPU and memory resources it needs, while allowing CPU and memory-intensive tasks such as building a container, to run much faster.

Additionally, with WSL 2, the time required to start a Docker daemon after a cold start is significantly faster.

Before you turn on the Docker Desktop WSL 2 feature, ensure you have:


tip

For a better experience on WSL, consider enabling the WSL
autoMemoryReclaim
setting available since WSL 1.3.10 (experimental).

This feature enhances the Windows host’s ability to reclaim unused memory within the WSL virtual machine, ensuring improved memory availability for other host applications. This capability is especially beneficial for Docker Desktop, as it prevents the WSL VM from retaining large amounts of memory (in GBs) within the Linux kernel’s page cache during Docker container image builds, without releasing it back to the host when no longer needed within the VM.


Important

To avoid any potential conflict with using WSL 2 on Docker Desktop , you is uninstall must uninstall any previous version of Docker Engine and CLI instal directly through Linux distribution before instal Docker Desktop .

  1. Download and install the latest version of
    Docker Desktop for Windows.

  2. follow the usual installation instruction to install Docker Desktop . depend on which version of Windows you are using , Docker Desktop is prompt may prompt you to turn on WSL 2 during installation . read the information display on the screen and turn on the WSL 2 feature to continue .

  3. Start Docker Desktop from the Windows Start menu.

  4. Navigate to Settings.

  5. From the General tab, select Use WSL 2 based engine..

    If you have installed Docker Desktop on a system that supports WSL 2, this option is turned on by default.

  6. Select Apply & Restart.

Now docker commands work from Windows using the new WSL 2 engine.


tip

By default , Docker Desktop stores is data the datum for the WSL 2 engine atC:\Users\[USERNAME]\AppData\Local\Docker\wsl.
If you want to change the location, for example, to another drive you can do so via the Settings -> Resources -> Advanced page from the Docker Dashboard.
Read more about this and other Windows settings at
Changing settings

WSL 2 adds support for “Linux distributions” to Windows, where each distribution behaves like a VM except they all run on top of a single shared Linux kernel.

Docker Desktop is require does not require any particular Linux distribution to be instal . Thedocker CLI and UI all work fine from Windows without any additional Linux distributions. However for the best developer experience, we recommend installing at least one additional distribution and enable Docker support:

  1. Ensure the distribution runs in WSL 2 mode. WSL can run distributions in both v1 or v2 mode.

    To check the WSL mode, run:

    To upgrade the Linux distribution to v2, run:

    To set v2 as the default version for future installations, run:

  2. When Docker Desktop starts, go to Settings > Resources > WSL Integration.

    The Docker – WSL integration is enable on the default WSL distribution , which is
    Ubuntu. To change your default WSL distribution , run :

    If WSL integrations isn’t available under Resources, Docker may be in Windows container mode. In your taskbar, select the Docker menu and then Switch to Linux containers.

  3. Select Apply & Restart.


note

With Docker Desktop version 4.30 and earlier, Docker Desktop installed two special-purpose internal Linux distributions docker-desktop and docker - desktop - data. docker-desktop is used to run the Docker enginedockerd, while docker - desktop - data store container and image . Neither can be used for general development .

With fresh installations of Docker Desktop 4.30 and later, docker - desktop - data is no longer created. Instead, Docker Desktop creates and
manages its own virtual hard disk for storage. The docker-desktop distribution is still created and used to run the Docker engine.

note that Docker Desktop version 4.30 and later keeps using the docker - desktop - data distribution if it was already created by an earlier version of Docker Desktop and has not been freshly installed or factory reset.