Skip to content

Commit def6e9d

Browse files
committed
[linux] wsl 2 config additions
1 parent 2c32ddb commit def6e9d

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

docs/dev-notes/linux/wsl.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@
8989

9090
- `%USERPROFILE%/.wslconfig`: _**global**_ settings for WSL2
9191

92-
|`[wsl2]` section setting|default|notes|
93-
|------------------------|-------|-----|
92+
|`[wsl2]` section|default|notes|
93+
|----------------|-------|-----|
9494
|`kernel`|Microsoft built kernel provided inbox|absolute Windows path to a custom Linux kernel|
9595
|`memory`|50% Windows total memory capped at 8GB|WSL2 VM memory allocation|
9696
|`processors`|Windows logical processors count|WSL2 VM logical processors count|
@@ -105,9 +105,27 @@
105105
|`nestedVirtualization`\*|`true`|enable other nested VMs to run inside WSL2|
106106
|`vmIdleTimeout`\*|`60000`|WSL2 VM idle milliseconds before it is shut down|
107107

108+
|`[experimental]` section|default|opt-in previews of experimental features|
109+
|------------------------|-------|----------------------------------------|
110+
|`autoMemoryReclaim`|`disabled`|Automatically releases cached memory after detecting idle CPU usage. Set to `gradual` for slow release, and `dropcache` for instant release of cached memory|
111+
|`sparseVhd`|`false`|When set to true, any newly created VHD will be set to sparse automatically|
112+
|`networkingMode`\*\*|`NAT`|If the value is `mirrored` then this turns on mirrored networking mode. Default or unrecognized strings result in NAT networking|
113+
|`firewall`\*\*|`false`|Setting this to true allows the Windows Firewall rules, as well as rules specific to Hyper-V traffic, to filter WSL network traffic|
114+
|`dnsTunneling`\*\*|`false`|Changes how DNS requests are proxied from WSL to Windows|
115+
|`autoProxy`\*|`false`|Enforces WSL to use Windows’ HTTP proxy information|
116+
117+
|`[experimental]` section|default|configures aspects of the experimental settings|
118+
|------------------------|-------|-----------------------------------------------|
119+
|`useWindowsDnsCache` **|`false`|(if `experimental.dnsTunneling=true`) DNS requests tunneled from Linux will bypass cached names within Windows to always put the requests on the wire|
120+
|`bestEffortDnsParsing` **|`false`|(if `experimental.dnsTunneling=true`) Windows will extract the question from the DNS request and attempt to resolve it, ignoring the unknown records|
121+
|`initialAutoProxyTimeout` *|`1000`|(if `experimental.autoProxy=true`) configures WSL wait milliseconds timeout for retrieving HTTP proxy information when starting a WSL container|
122+
|`ignoredPorts` **|`null`|(if `experimental.networkingMode=mirrored`) specifies bindable ports for Linux apps even if ports under active use by Windows (e.g. `3000,9000,9090`); enables unblocking apps using a port for purely Linux side traffic. Ex: port `53` for _Linux Docker Desktop_|
123+
|`hostAddressLoopback` **|`false`|(if `experimental.networkingMode=mirrored`) enables additional local IP address assigned to Host; allows connectivity Container to Host, or Host to Container|
124+
108125
- `path` values must be escaped Windows paths e.g: `C:\\Temp\\myCustomKernel`
109126
- `size` values must be a size followed by a unit e.g. `8GB` or `512MB`
110127
- `*` only for Windows 11
128+
- `**` only for [Windows Insiders Program](https://www.microsoft.com/windowsinsider/)
111129

112130
### .wslgconfig
113131

0 commit comments

Comments
 (0)