Skip to content

Commit 6764e8d

Browse files
Merge branch 'main' into live
2 parents e0fdd21 + 90e96e7 commit 6764e8d

File tree

6 files changed

+95
-13
lines changed

6 files changed

+95
-13
lines changed

WSL/basic-commands.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Basic commands for WSL
33
description: Reference for the basic commands included with Windows Subsystem for Linux (WSL).
4-
ms.date: 07/31/2025
4+
ms.date: 12/01/2025
55
ms.topic: article
66
---
77

@@ -22,6 +22,7 @@ Options include:
2222
- `--distribution`: Specify the Linux distribution to install. You can find available distributions by running `wsl --list --online`.
2323
- `--no-launch`: Install the Linux distribution but do not launch it automatically.
2424
- `--web-download`: Install from an online source rather than using the Microsoft Store.
25+
- `--location`: Specify which folder you would like to install the WSL distribution to.
2526

2627
When WSL is not installed options include:
2728

@@ -75,7 +76,7 @@ wsl --set-default <Distribution Name>
7576

7677
To set the default Linux distribution that WSL commands will use to run, replace `<Distribution Name>` with the name of your preferred Linux distribution.
7778

78-
## Start WSL in user's home
79+
## Start WSL in user home directory
7980

8081
```powershell
8182
wsl ~
@@ -204,8 +205,6 @@ Imports the specified .vhdx file as a new distribution. The virtual hard disk mu
204205

205206
## Unregister or uninstall a Linux distribution
206207

207-
While Linux distributions can be installed through the Microsoft Store, they can't be uninstalled through the store.
208-
209208
To unregister and uninstall a WSL distribution:
210209

211210
```powershell

WSL/install-on-server.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Now that you've downloaded a Linux distribution, in order to extract its content
6464
1. List the contents of the appx using tar.exe:
6565

6666
```cmd
67-
> tar -tf .\debian.appx
67+
> tar -xf .\debian.appx
6868
DistroLauncher-Appx_1.12.2.0_ARM64.appx
6969
DistroLauncher-Appx_1.12.2.0_scale-100.appx
7070
DistroLauncher-Appx_1.12.2.0_scale-125.appx
@@ -80,7 +80,7 @@ Now that you've downloaded a Linux distribution, in order to extract its content
8080
```powershell
8181
$debianWSLPath = Join-Path -Path $env:LocalAppData -ChildPath DebianWSL
8282
New-Item -Path $debianWSLPath -ItemType Directory | Out-Null
83-
Expand-Archive -Path ".\DistroLauncher-Appx_1.12.2.0_x64.appx" -DestinationPath $debianWSLPath
83+
tar -xf .\DistroLauncher-Appx_1.12.2.0_x64.appx -C "$env:USERPROFILE\AppData\Local\DebianWSL"
8484
```
8585
8686
1. Add your Linux distribution path to the Windows environment PATH (`C:\Users\Administrator\Ubuntu` in this example), using PowerShell:

WSL/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ By default, the installed Linux distribution will be Ubuntu. This can be changed
5353
5454
If you run into an issue during the install process, check the [installation section of the troubleshooting guide](./troubleshooting.md#installation-issues).
5555
56-
To install a Linux distribution that is not listed as available, you can [import any Linux distribution](./use-custom-distro.md) using a TAR file. Or in some cases, [as with Arch Linux](https://wsldl-pg.github.io/ArchW-docs/How-to-Setup/), you can install using an `.appx` file. You can also create your own [custom Linux distribution](./build-custom-distro.md) to use with WSL.
56+
To install a Linux distribution that is not listed as available, you can [import any Linux distribution](./use-custom-distro.md) using a TAR file. Or in some cases you can install using an `.appx` file. You can also create your own [custom Linux distribution](./build-custom-distro.md) to use with WSL.
5757
5858
## Set up your Linux user info
5959

WSL/networking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ If you want to access a networking app running on Windows (for example an app ru
6868
1. Obtain the IP address of your host machine by running this command from your Linux distribution:
6969

7070
```bash
71-
ip route show | grep -i default | awk '{ print $3}'`
71+
ip route show | grep -i default | awk '{ print $3}'
7272
```
7373

7474
2. Connect to any Windows server using the copied IP address.

WSL/troubleshooting-guide.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: WSL Troubleshooting Guide
3+
description: Learn how to troubleshoot problems in WSL to determine where they might be coming from
4+
ms.date: 10/14/2023
5+
ms.topic: article
6+
---
7+
8+
# Windows Subsystem for Linux Troubleshooting Guide
9+
10+
This guide goes over how to troubleshoot issues in WSL and determine where they are coming from.
11+
12+
## A quick note on architecture
13+
14+
To help determine what's causing an issue, we have to find out where it is in the stack.
15+
16+
When a Linux binary is called in WSL, it (approximately) goes through these layers, each could be where the error is coming from:
17+
18+
```mermaid
19+
graph TD;
20+
id1["Linux binary in userspace"]-->id2["Linux distro"];
21+
id2["Linux distro"]-->id3["WSL's stack"];
22+
id4["WSL's stack"]-->id5["Physical hardware"];
23+
```
24+
25+
We'll be going through this stack in order, and guiding you on how to determine if the error source is from that section.
26+
27+
## Linux binary in userspace
28+
29+
First we need to check if this is an error caused by the Linux binary itself. The easiest way to do this is just to see if this error reproduces on a real Linux machine (Either bare metal which is preferred, or run full Ubuntu in Hyper-V for a good comparison). If it errors out in the same way on a real Linux machine, then we know it's either the Linux binary or the distro.
30+
31+
Alternatively, you can run the `strace` command to determine what's going on. This command shows you the Linux system calls that the Linux binary is making, and you can determine what it is trying to access and where it might be failing. This guide won't give a full guide on how to debug `strace` stacks (or else it would be way too long), so let's take a look at an example:
32+
33+
A user finds the WSL command `xeyes` hangs in WSL, but doesn't hang on a Linux machine. Running `strace xeyes` shows that the command is hanging at the `openat` system call. This means that the Linux kernel is stuck trying to run the `openat` call, and would indicate the problem isn't in the binary itself.
34+
35+
### What to do if the problem is in the Linux binary
36+
37+
The Linux binaries present in WSL are provided by their respective owners, and aren't directly owned by Microsoft. If you do see an issue in the Linux binary please report it to the owner of that binary directly.
38+
39+
## Linux distro
40+
41+
Some errors might also come from the Linux distribution itself. Linux distros in WSL are really just a collection of Linux binaries, so the same troubleshooting steps as above apply. However, the Linux distro is responsible for key experiences like the package manager, which can greatly affect how binaries interact with each other.
42+
43+
To troubleshoot this, you would use the same techniques as above, seeing if this reproduces on Linux, and using `strace` to determine what is causing the failure (Or any other error codes) and trying to determine if it comes from a specific Linux binary. If that binary itself is owned by the distro, then it's a Linux distro problem.
44+
45+
### What to do if the problem is in the Linux distro
46+
47+
Similar to the Linux binary story, WSL distros are provided by their respective maintainers. Please file the issue directly with the affected Linux distro.
48+
49+
## WSL's stack
50+
51+
Next, the error could be coming from within WSL's logic itself. If the issue doesn't reproduce on bare metal Linux, or something at the machine level is failing then these indicate that this is from within WSL. Below are the common failure paths and how to determine it and collect logs:
52+
53+
### WSL start up failures or errors from `wsl.exe`.
54+
55+
The most obvious error here, is an error coming from `wsl.exe` directly, such as [this GitHub issue for example](https://github.com/microsoft/WSL/issues/10483). In this case please [collect WSL logs](https://aka.ms/wsllogs) that reproduces the issue and file the issue at the [WSL GitHub repo](https://github.com/microsoft/wsl).
56+
57+
### WSL hangs
58+
59+
Another common error is where WSL hangs and doesn't respond to any commands. In this case please [report a WSL process crash by following this process](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#11-reporting-a-wsl-process-crash). You can force a crash and collect a dump by opening Task Manager -> Processes -> Right clicking `VmmemWSL` -> Create Memory Dump file. Please include this crash dump and file an issue on the [WSL GitHub repo](https://github.com/microsoft/wsl).
60+
61+
### Network errors
62+
63+
Again, please verify this isn't a Linux binary issue. As well, if possible verify that this isn't a generic virtualization or VPN issue by trying a Hyper-V VM on that machine to see if it has restricted networking capabilities. If this problem is only persisting in WSL, then please file an issue on the [WSL GitHub repo](https://github.com/microsoft/wsl).
64+
65+
### Misc. Issues
66+
67+
If you are getting another kind of WSL error that you think is related to WSL specifically, please [include logs](https://aka.ms/wsllogs) and file it at the [WSL GitHub repo](https://github.com/microsoft/wsl).
68+
69+
## Diving into WSL logs
70+
71+
You can open up WSL logs to see what the exact error is. To do this please install [Windows Performance Analyzer](https://apps.microsoft.com/detail/9N0W1B2BXGNZ) first.
72+
73+
Then, when you have WSL logs (collected from [these instructions](https://aka.ms/wsllogs)), take the .zip file that is created and unzip it. Open the resulting folder and look for a file called: `logs.etl` and double click this file to open it up in Windows Performance Analyzer.
74+
75+
Once the app opens, do these steps:
76+
77+
1. Click System Activity to expand the view
78+
2. Drag the "Generic Events" box at the top to the main window
79+
3. Find the "Microsoft.Windows.Lxss.Manager" series and click the arrow to select it
80+
81+
![WinPerfAnalyzer](winperfanalyzer1.png)
82+
83+
From there, you can view all the diagnostic events that are emitted from WSL. The one of most interest will be called "VerboseLog" and will give more details on the exact error location and information about it.
84+
85+
## Additional resources
86+
87+
Common issues and solutions are available at the [WSL troubleshooting docs page](https://learn.microsoft.com/windows/wsl/troubleshooting), so please check there for any issues you might see. As well go to the [WSL GitHub repo](https://github.com/microsoft/wsl), or any search engine and search for the issue or any error codes there to see if others are hitting the same issue.

WSL/wsl-config.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,13 @@ This file can contain the following options that affect the VM that powers any W
233233
| `safeMode` | boolean | `false` | Run WSL in "Safe Mode" which disables many features and is intended to be used to recover distributions that are in bad states. Only available for Windows 11 and WSL version 0.66.2+. |
234234
| `swap` | size | 25% of memory size on Windows rounded up to the nearest GB | How much swap space to add to the WSL 2 VM, 0 for no swap file. Swap storage is disk-based RAM used when memory demand exceeds limit on hardware device. |
235235
| `swapFile` | path | `%Temp%\swap.vhdx` | An absolute Windows path to the swap virtual hard disk. |
236-
| `pageReporting` | boolean | `true` | Setting enables Windows to reclaim unused memory allocated to WSL 2 virtual machine. |
237236
| `guiApplications` | boolean | `true` | Boolean to turn on or off support for GUI applications ([WSLg](https://github.com/microsoft/wslg)) in WSL.|
238237
| `debugConsole`¹ | boolean | `false` | Boolean to turn on an output console Window that shows the contents of `dmesg` upon start of a WSL 2 distro instance.|
239238
| `maxCrashDumpCount` | number | `10` | Set the maximum number of crash dump files that will be retained for debugging purposes. The default number retained by WSL is 10. When this limit is exceeded, older crash dumps will be automatically deleted to make room for new ones. Setting a max can help with reducing the amount of disk space used by these crash files. |
240239
| `nestedVirtualization`¹ | boolean | `true` | Boolean to turn on or off nested virtualization, enabling other nested VMs to run inside WSL 2.|
241240
| `vmIdleTimeout`¹ | number | `60000` | The number of milliseconds that a VM is idle, before it is shut down.|
242241
| `dnsProxy` | boolean | `true` | Only applicable to `networkingMode = NAT`. Boolean to inform WSL to configure the DNS Server in Linux to the NAT on the host. Setting to `false` will mirror DNS servers from Windows to Linux. |
243-
| `networkingMode`¹² | string | `NAT` | Available values are: `none`, `net`, `bridged` (deprecated), `mirrored`, and `virtioproxy`. If the value is `none`, the WSL network is disconnected. If the value is `net` or an unknown value, NAT network mode is used (starting from WSL 2.3.25, if NAT network mode fails, it falls back to using VirtioProxy network mode). If the value is `bridged`, the bridged network mode is used (this mode has been marked as deprecated since WSL 2.4.5). If the value is `mirrored`, the mirrored network mode is used. If the value is `virtioproxy`, the VirtioProxy network mode is used. |
242+
| `networkingMode`¹² | string | `NAT` | Available values are: `none`, `nat`, `bridged` (deprecated), `mirrored`, and `virtioproxy`. If the value is `none`, the WSL network is disconnected. If the value is `nat` or an unknown value, NAT network mode is used (starting from WSL 2.3.25, if NAT network mode fails, it falls back to using VirtioProxy network mode). If the value is `bridged`, the bridged network mode is used (this mode has been marked as deprecated since WSL 2.4.5). If the value is `mirrored`, the mirrored network mode is used. If the value is `virtioproxy`, the VirtioProxy network mode is used. |
244243
| `firewall`¹² | boolean | `true` | Setting this to true allows the Windows Firewall rules, as well as rules specific to Hyper-V traffic, to filter WSL network traffic. |
245244
| `dnsTunneling`¹² | boolean | `true` | Changes how DNS requests are proxied from WSL to Windows |
246245
| `autoProxy`¹ | boolean | `true` | Enforces WSL to use Windows’ HTTP proxy information |
@@ -303,9 +302,6 @@ swap=8GB
303302
# Sets swapfile path location, default is %UserProfile%\AppData\Local\Temp\swap.vhdx
304303
swapfile=C:\\temp\\wsl-swap.vhdx
305304

306-
# Disable page reporting so WSL retains all allocated memory claimed from Windows and releases none back when free
307-
pageReporting=false
308-
309305
# Turn on default connection to bind WSL 2 localhost to Windows localhost. Setting is ignored when networkingMode=mirrored
310306
localhostforwarding=true
311307

0 commit comments

Comments
 (0)