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
Copy file name to clipboardExpand all lines: WSL/wsl-config.md
+40-6Lines changed: 40 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,7 +211,7 @@ For example:
211
211
212
212
To reinstall, find the distribution in the Microsoft store and select "Launch".
213
213
214
-
## Configure launch settings with wslconf
214
+
## Configure per distro launch settings with wslconf
215
215
216
216
> **Available in Windows Build 17093 and later**
217
217
@@ -237,13 +237,13 @@ generateHosts = true
237
237
generateResolvConf = true
238
238
```
239
239
240
-
## Configuration Options
240
+
###Configuration Options
241
241
242
242
In keeping with .ini conventions, keys are declared under a section.
243
243
244
244
WSL supports two sections: `automount` and `network`.
245
245
246
-
### automount
246
+
####automount
247
247
248
248
Section: `[automount]`
249
249
@@ -258,7 +258,7 @@ By default, WSL sets the uid and gid to the value of the default user (in Ubuntu
258
258
259
259
**Note:** These options are applied as the mount options for all automatically mounted drives. To change the options for a specific drive only, use /etc/fstab instead.
260
260
261
-
### Mount options
261
+
####Mount options
262
262
263
263
Setting different mount options for Windows drives (DrvFs) can control how file permissions are calculated for Windows files. The following options are available:
264
264
@@ -272,7 +272,7 @@ Setting different mount options for Windows drives (DrvFs) can control how file
272
272
273
273
**Note:** The permission masks are put through a logical OR operation before being applied to files or directories.
274
274
275
-
### network
275
+
####network
276
276
277
277
Section label: `[network]`
278
278
@@ -281,7 +281,7 @@ Section label: `[network]`
281
281
| generateHosts | boolean |`true`|`true` sets WSL to generate `/etc/hosts`. The `hosts` file contains a static map of hostnames corresponding IP address. |
282
282
| generateResolvConf | boolean |`true`|`true` set WSL to generate `/etc/resolv.conf`. The `resolv.conf` contains a DNS list that are capable of resolving a given hostname to its IP address. |
283
283
284
-
### interop
284
+
####interop
285
285
286
286
Section label: `[interop]`
287
287
@@ -291,3 +291,37 @@ These options are available in Insider Build 17713 and later.
291
291
|:----|:----|:----|:----|
292
292
| enabled | boolean |`true`| Setting this key will determine whether WSL will support launching Windows processes. |
293
293
| appendWindowsPath | boolean |`true`| Setting this key will determine whether WSL will add Windows path elements to the $PATH environment variable. |
294
+
295
+
#### user
296
+
297
+
Section label: `[user]`
298
+
299
+
These options are available in Build 18980 and later.
300
+
301
+
| key | value | default | notes|
302
+
|:----|:----|:----|:----|
303
+
| default | string | The initial username created on first run | Setting this key specifies which user to run as when first starting a WSL session. |
304
+
305
+
## Configure global options with .wslconfig
306
+
307
+
> **Available in Windows Build 19041 and later**
308
+
309
+
You can configure global WSL options by placing a `.wslconfig` file into the root directory of your users folder: `C:\Users\<yourUserName>\.wslconfig`. This file can contain the following options:
310
+
311
+
### WSL 2 Settings
312
+
313
+
These settings affect the VM that powers any WSL 2 distribution.
314
+
315
+
| key | value | default | notes|
316
+
|:----|:----|:----|:----|
317
+
| kernel | string | The Microsoft built kernel provided inbox | An absolute Windows path to a custom Linux kernel. |
318
+
| memory | size | 80% of your total memory on Windows | How much memory to assign to the WSL 2 VM. |
319
+
| processors | number | The same number of processors on Windows | How many processors to assign ot the WSL 2 VM. |
320
+
| localhostForwarding | boolean |`true`| Boolean specifying if ports bound to wildcard or localhost in the WSL 2 VM should be connectable from the host via localhost:port. |
0 commit comments