You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!--Delete sections as needed -->
## Description
refreshes whilst I was in that space
## Related issues or tickets
<!-- Related issues, pull requests, or Jira tickets -->
## Reviews
<!-- Notes for reviewers here -->
<!-- List applicable reviews (optionally @tag reviewers) -->
- [ ] Technical review
- [ ] Editorial review
- [ ] Product review
Copy file name to clipboardExpand all lines: content/manuals/desktop/features/wsl/_index.md
+18-32Lines changed: 18 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,11 +13,9 @@ aliases:
13
13
- /desktop/wsl/
14
14
---
15
15
16
-
Windows Subsystem for Linux (WSL) 2 is a full Linux kernel built by Microsoft, which lets Linux distributions run without managing virtual machines. With Docker Desktop running on WSL 2, users can leverage Linux workspaces and avoid maintaining both Linux and Windows build scripts. In addition, WSL 2 provides improvements to file system sharingand boot time.
16
+
Windows Subsystem for Linux (WSL) 2 is a full Linux kernel built by Microsoft that lets Linux distributions run without managing virtual machines. With Docker Desktop running on WSL 2, users can leverage Linux workspaces and avoid maintaining both Linux and Windows build scripts. In addition, WSL 2 provides improvements to file system sharing, faster cold-start times, and dynamic resource allocation.
17
17
18
-
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.
19
-
20
-
Additionally, with WSL 2, the time required to start a Docker daemon after a cold start is significantly faster.
18
+
Because WSL 2 uses dynamic memory allocation, Docker Desktop requests only the CPU and memory it actually needs — freeing resources for the rest of your system, while still letting memory-intensive tasks such as multi-stage image builds run at full speed.
21
19
22
20
## Prerequisites
23
21
@@ -29,40 +27,34 @@ Before you turn on the Docker Desktop WSL 2 feature, ensure you have:
29
27
30
28
> [!TIP]
31
29
>
32
-
> For a better experience on WSL, consider enabling the WSL
> setting available since WSL 1.3.10 (experimental).
35
-
>
36
-
> 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.
30
+
> Consider enabling the WSL [autoMemoryReclaim](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#experimental-settings) setting, available since WSL 1.3.10 (experimental).
31
+
>This setting allows Windows to reclaim unused memory from the WSL virtual machine, preventing the Linux kernel's page cache from holding onto large amounts of RAM after container image builds complete. The result is better memory availability for other applications on the host.
37
32
38
33
## Turn on Docker Desktop WSL 2
39
34
40
-
> [!IMPORTANT]
41
-
>
42
-
> To avoid any potential conflicts with using WSL 2 on Docker Desktop, you must uninstall any previous versions of Docker Engine and CLI installed directly through Linux distributions before installing Docker Desktop.
35
+
Before installing Docker Desktop, uninstall any version of Docker Engine or the Docker CLI
36
+
that was installed directly inside a WSL Linux distribution. Running both can cause conflicts.
43
37
44
38
1. Download and install the latest version of [Docker Desktop for Windows](https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe?utm_source=docker&utm_medium=webreferral&utm_campaign=docs-driven-download-windows).
45
39
2. Follow the usual installation instructions to install Docker Desktop. Depending on which version of Windows you are using, Docker Desktop may prompt you to turn on WSL 2 during installation. Read the information displayed on the screen and turn on the WSL 2 feature to continue.
46
40
3. Start Docker Desktop from the **Windows Start** menu.
47
41
4. Navigate to **Settings**.
48
-
5. From the **General** tab, select **Use WSL 2 based engine**..
42
+
5. From the **General** tab, select **Use WSL 2 based engine**.
49
43
50
44
If you have installed Docker Desktop on a system that supports WSL 2, this option is turned on by default.
51
45
6. Select **Apply**.
52
46
53
-
Now `docker` commands work from Windows using the new WSL 2 engine.
47
+
`docker` commands are now available from any Windows terminal using the WSL 2 engine.
54
48
55
49
> [!TIP]
56
50
>
57
51
> By default, Docker Desktop stores the data for the WSL 2 engine at `C:\Users\[USERNAME]\AppData\Local\Docker\wsl`.
58
-
> 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.
52
+
> If you want to change the location, go to`Settings -> Resources -> Advanced` page from the Docker Dashboard.
59
53
> Read more about this and other Windows settings at [Changing settings](/manuals/desktop/settings-and-maintenance/settings.md)
60
54
61
-
## Enabling Docker support in WSL 2 distributions
55
+
## Enable Docker in a WSL 2 distribution
62
56
63
-
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.
64
-
65
-
Docker Desktop does not require any particular Linux distributions to be installed. The `docker` 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:
57
+
WSL 2 lets multiple Linux distributions run side-by-side on a single shared kernel. Docker Desktop doesn't require a particular distribution to be installed, and `docker` commands work from Windows without one. However, enabling WSL integration for a distribution gives you direct access to `docker` commands from that distribution's terminal — which is useful for Linux-native development workflows.
66
58
67
59
1. Ensure the distribution runs in WSL 2 mode. WSL can run distributions in both v1 or v2 mode.
68
60
@@ -94,24 +86,18 @@ Docker Desktop does not require any particular Linux distributions to be install
94
86
95
87
3. Select **Apply**.
96
88
97
-
> [!NOTE]
98
-
>
99
-
> 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 engine `dockerd`, while`docker-desktop-data` stores containers and images. Neither can be used for general development.
100
-
>
101
-
> With fresh installations of Docker Desktop 4.30 and later, `docker-desktop-data` is no longer created. Instead, Docker Desktop creates and
102
-
> manages its own virtual hard disk for storage. The `docker-desktop` distribution is still created and used to run the Docker engine.
103
-
>
104
-
> 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.
105
-
106
89
## WSL 2 security in Docker Desktop
107
90
108
-
Docker Desktop’s WSL 2 integration operates within the existing security model of WSL and does not introduce additional security risks beyond standard WSL behavior.
91
+
Docker Desktop's WSL 2 integration works within WSL's existing security model and does not introduce security risks beyond standard WSL behavior.
92
+
93
+
Docker Desktop runs inside its own `docker-desktop` WSL distribution, isolated from other distributions in the same way any two WSL distributions are isolated from each other. Interaction between Docker Desktop and other distributions only occurs when you explicitly enable WSL integration for those distributions. This feature allows easy access to the Docker CLI from integrated distributions.
109
94
110
-
Docker Desktop runs within its own dedicated WSL distribution, `docker-desktop`, which follows the same isolation properties as any other WSL distribution. The only interaction between Docker Desktop and other installed WSL distributions occurs when the Docker Desktop **WSL integration** feature is enabled in settings. This feature allows easy access to the Docker CLI from integrated distributions.
95
+
WSL is designed to aid interoperability between Windows and Linux environments. Its file system is accessible from the Windows host `\\wsl$`, meaning Windows processes can read and modify files within WSL. This behavior is not specific to Docker Desktop, but rather a core aspect of WSL itself.
111
96
112
-
WSL is designed to facilitate interoperability between Windows and Linux environments. Its file system is accessible from the Windows host `\\wsl$`, meaning Windows processes can read and modify files within WSL. This behavior is not specific to Docker Desktop, but rather a core aspect of WSL itself.
97
+
For environments that require stricter isolation:
113
98
114
-
For organizations concerned about security risks related to WSL and want stricter isolation and security controls, run Docker Desktop in Hyper-V mode instead of WSL 2. Alternatively, run your container workloads with [Enhanced Container Isolation](/manuals/enterprise/security/hardened-desktop/enhanced-container-isolation/_index.md) enabled.
99
+
- Run Docker Desktop in Hyper-V mode instead of WSL 2 to avoid the shared-kernel model entirely.
100
+
- Enable [Enhanced Container Isolation](/manuals/enterprise/security/hardened-desktop/enhanced-container-isolation/_index.md) to add an additional layer of protection around container workloads regardless of backend.
0 commit comments