Skip to content

Commit 24890be

Browse files
authored
Merge pull request #67 from krishnacx/user/kvitta/networking_logs2
Update troubleshooting section to collect networking logs.
2 parents 9337bab + ee3560a commit 24890be

File tree

1 file changed

+49
-22
lines changed

1 file changed

+49
-22
lines changed

defender-endpoint/mde-plugin-wsl.md

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.collection:
1515
ms.custom:
1616
- partner-contribution
1717
audience: ITPro
18-
ms.date: 08/01/2024
18+
ms.date: 08/05/2024
1919
search.appverid: MET150
2020
---
2121

@@ -33,33 +33,33 @@ Windows Subsystem for Linux (WSL) 2, which replaces the previous version of WSL
3333

3434
## Known issues and limitations
3535

36-
Be aware of the following before you start:
36+
Be aware of the following considerations before you start:
3737

38-
1. The plug-in doesn't support automatic updates on versions prior to `1.24.522.2`. On version `1.24.522.2` and later; updates are supported through Windows Update across all rings. Updates through Windows Server Update services (WSUS), System Center Configuration Manager (SCCM) and Microsoft Update catalog are supported only in the Production ring to ensure package stability.
38+
1. The plug-in doesn't support automatic updates on versions prior to `1.24.522.2`. On version `1.24.522.2` and later, updates are supported through Windows Update across all rings. Updates through Windows Server Update services (WSUS), System Center Configuration Manager (SCCM) and Microsoft Update catalog are supported only in the Production ring to ensure package stability.
3939

4040
2. It takes a few minutes for the plug-in to fully instantiate, and up to 30 minutes for a WSL2 instance to onboard itself. Short-lived WSL container instances might result in the WSL2 instance not showing up in the Microsoft Defender portal ([https://security.microsoft.com](https://security.microsoft.com)). Once any distribution has been running long enough (at least 30 minutes), it does show up.
4141

4242
3. Running a custom kernel and custom kernel command line is not supported. Although the plug-in does not block running in that configuration, it does not guarantee visibility within WSL when you're running a custom kernel and custom kernel command line. We recommend to block such configurations with help of [Microsoft Intune wsl settings](/windows/wsl/intune).
4343

44-
4. OS Distribution is displayed **None** in Device overview page of WSL device in Microsoft Defender portal.
44+
4. OS Distribution is displayed **None** in the **Device overview** page of a WSL device in the Microsoft Defender portal.
4545

4646
5. The plug-in is not supported on machines with ARM64 processor.
4747

48-
6. The plug-in provides visibility into events from WSL but other features like antimalware, threat and vulnerability management and response commands are not available for the WSL logical device.
48+
6. The plug-in provides visibility into events from WSL, but other features like antimalware, threat and vulnerability management, and response commands are not available for the WSL logical device.
4949

5050
## Software prerequisites
5151

5252
- WSL version 2.0.7.0 or later must be running with at least one active distro.
5353

54-
Run `wsl --update` to make sure you are on the latest version. If `wsl -–version` shows a version older than 2.0.7.0, run `wsl -–update –pre-release` to get the latest update.
54+
Run `wsl --update` to make sure you are on the latest version. If `wsl -–version` shows a version older than `2.0.7.0`, run `wsl -–update –pre-release` to get the latest update.
5555

5656
- The Windows client device must be onboarded to Defender for Endpoint.
5757

5858
- The Windows client device must be running Windows 10, version 2004 and later (build 19044 and later), or Windows 11 to support the WSL versions that can work with the plug-in.
5959

6060
## Software components and installer file names
6161

62-
Installer: `DefenderPlugin-x64-0.24.426.1.msi`. You can download it from the onboarding page in the [Microsoft Defender portal](https://security.microsoft.com).
62+
Installer: `DefenderPlugin-x64-0.24.426.1.msi`. You can download it from the onboarding page in the [Microsoft Defender portal](https://security.microsoft.com). (Go to **Settings** > **Endpoints** > **Onboarding**.)
6363

6464
Installation directories:
6565

@@ -69,9 +69,9 @@ Installation directories:
6969

7070
Components installed:
7171

72-
- `DefenderforEndpointPlug-in.dll`. This DLL is the library to load Defender for Endpoint to work within WSL. You can find it at **%ProgramFiles%\Microsoft Defender for Endpoint plug-in for WSL\plug-in**.
72+
- `DefenderforEndpointPlug-in.dll`. This DLL is the library to load Defender for Endpoint to work within WSL. You can find it at `%ProgramFiles%\Microsoft Defender for Endpoint plug-in for WSL\plug-in`.
7373

74-
- `healthcheck.exe`. This program checks the health status of Defender for Endpoint and enables you to see the installed versions of WSL, plug-in, and Defender for Endpoint. You can find it at **%ProgramFiles%\Microsoft Defender for Endpoint plug-in for WSL\tools**.
74+
- `healthcheck.exe`. This program checks the health status of Defender for Endpoint and enables you to see the installed versions of WSL, plug-in, and Defender for Endpoint. You can find it at `%ProgramFiles%\Microsoft Defender for Endpoint plug-in for WSL\tools`.
7575

7676
## Installation steps
7777

@@ -125,6 +125,9 @@ If you want to use the host [winhttp proxy](configure-proxy-internet.md#configur
125125

126126
If you want to use the host [network and network proxy setting](https://support.microsoft.com/windows/use-a-proxy-server-in-windows-03096c53-0554-4ffe-b6ab-8b1deee8dae1#ID0EFD=Windows_11&preserve-view=true) for MDE for WSL plug-in, nothing more is required. This configuration is adopted by the plug-in automatically.
127127

128+
> [!NOTE]
129+
> WSL defender supports only `http` proxy.
130+
128131
## Plug-in Proxy selection
129132

130133
If your host machine contains multiple proxy settings, the plug-in selects the proxy configurations with the following hierarchy:
@@ -135,10 +138,10 @@ If your host machine contains multiple proxy settings, the plug-in selects the p
135138

136139
3. Network & Internet proxy settings.
137140

138-
Example: If your host machine has both *Winhttp proxy* and *Network & Internet proxy*, the plug-in selects `Winhttp proxy` as the proxy configuration.
141+
For example, if your host machine has both `Winhttp proxy` and `Network & Internet proxy`, the plug-in selects `Winhttp proxy` as the proxy configuration.
139142

140143
> [!NOTE]
141-
> The `DefenderProxyServer` registry key is no longer supported. Follow the above mentioned steps to configure proxy in plug-in.
144+
> The `DefenderProxyServer` registry key is no longer supported. Follow the steps described earlier in this article to configure proxy in plug-in.
142145
143146
## Connectivity test for Defender running in WSL
144147

@@ -159,7 +162,7 @@ The following procedure describes how to confirm that Defender in Endpoint in WS
159162

160163
2. Run the command `wsl`.
161164

162-
4. Wait for 5 minutes and then run `healthcheck.exe` (located at `%ProgramFiles%\Microsoft Defender for Endpoint plug-in for WSL\tools` for the results of the connectivity test).
165+
4. Wait for five minutes, and then run `healthcheck.exe` (located at `%ProgramFiles%\Microsoft Defender for Endpoint plug-in for WSL\tools` for the results of the connectivity test).
163166

164167
If successful, you can see that the connectivity test was successful. If failed, you can see that the connectivity test was `invalid` indicating that the client connectivity from WSL to Defender for Endpoint service URLs is failing.
165168

@@ -199,7 +202,7 @@ To test the plug-in after installation, follow these steps:
199202
An alert should appear in the portal after a few minutes for a detection on the WSL2 instance.
200203

201204
> [!NOTE]
202-
> It takes about 5 minutes for the events to appear on the Microsoft Defender portal.
205+
> It takes about five minutes for the events to appear on the Microsoft Defender portal.
203206
204207
Treat the machine as if it were a regular Linux host in your environment to perform testing against. In particular, we would like to get your feedback on the ability to surface potentially malicious behavior using the new plug-in.
205208

@@ -243,21 +246,21 @@ DeviceProcessEvents
243246

244247
## Troubleshooting
245248

246-
1. The command `healthcheck.exe` shows the output, "Launch WSL distro with 'bash' command and retry in 5 minutes."
249+
1. The command `healthcheck.exe` shows the output, "Launch WSL distro with 'bash' command and retry in five minutes."
247250

248251
:::image type="content" source="media/mdeplugin-wsl/wsl-health-check.png" alt-text="Screenshot showing PowerShell output." lightbox="media/mdeplugin-wsl/wsl-health-check.png":::
249252

250253
2. If the previously mentioned error occurs, take the following steps:
251254

252255
1. Open a terminal instance and run the command `wsl`.
253256

254-
2. Wait for at least 5 minutes before rerunning the health check.
257+
2. Wait for at least five minutes before rerunning the health check.
255258

256-
3. The `healthcheck.exe` command might show the output, "Waiting for Telemetry. Please retry in 5 minutes."
259+
3. The `healthcheck.exe` command might show the output, "Waiting for Telemetry. Please retry in five minutes."
257260

258261
:::image type="content" source="media/mdeplugin-wsl/wsl-health-check-telemetry.png" alt-text="Screenshot showing health telemetry status." lightbox="media/mdeplugin-wsl/wsl-health-check-telemetry.png":::
259262

260-
If that error occurs, wait for 5 minutes and rerun `healthcheck.exe`.
263+
If that error occurs, wait for five minutes and rerun `healthcheck.exe`.
261264

262265
4. If you don't see any devices in the Microsoft Defender portal, or you don't see any events in the timeline, check the following things:
263266

@@ -293,9 +296,33 @@ DeviceProcessEvents
293296
dnsProxy=false
294297
```
295298

296-
- If the connectivity issues persist, collect the networking logs using the method mentioned at [link](https://aka.ms/wsllogs), and include those logs with your support bundle.
299+
- If the connectivity issues persist, run the following steps to collect the networking logs
300+
301+
1. Open an elevated(admin) PowerShell prompt
302+
303+
2. Download and Run: `.\collect-networking-logs.ps1`
304+
305+
```powershell
306+
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-networking-logs.ps1" -OutFile collect-networking-logs.ps1
307+
Set-ExecutionPolicy Bypass -Scope Process -Force
308+
.\collect-networking-logs.ps1
309+
```
310+
311+
3. Open a new command prompt and run: `wsl`
312+
313+
4. Open an elevated(admin) command prompt and run: `wsl --debug-shell`
314+
315+
5. In debug shell, run: `mdatp connectivity test`
316+
317+
6. Allow the connectivity test to be completed
318+
319+
7. Stop the .ps1 ran in step #2
320+
321+
8. Share the generated .zip file along with support bundle that can be collected as mentioned in [steps](#support-bundle-collection).
322+
323+
### Support bundle collection
297324

298-
5. If you run into any other challenges or issues, open Terminal, and run the following commands to generate a support bundle:
325+
1. If you run into any other challenges or issues, open Terminal, and run the following commands to generate a support bundle:
299326

300327
```powershell
301328
cd "%ProgramFiles%\Microsoft Defender for Endpoint plug-in for WSL\tools"
@@ -309,7 +336,7 @@ DeviceProcessEvents
309336

310337
:::image type="content" source="media/mdeplugin-wsl/wsl-health-check-overview.png" alt-text="Screenshot showing status in PowerShell output." lightbox="media/mdeplugin-wsl/wsl-health-check-overview.png":::
311338

312-
6. Microsoft Defender Endpoint for WSL supports Linux distributions running on WSL 2. If they're associated with WSL 1, you might encounter issues. Therefore, it's advised to disable WSL 1. To do so with the Intune policy, perform the following steps:
339+
2. Microsoft Defender Endpoint for WSL supports Linux distributions running on WSL 2. If they're associated with WSL 1, you might encounter issues. Therefore, it's advised to disable WSL 1. To do so with the Intune policy, perform the following steps:
313340

314341
1. Go to your [Microsoft Intune admin center](https://intune.microsoft.com).
315342

@@ -333,14 +360,14 @@ DeviceProcessEvents
333360
wsl --set-default-version 2
334361
```
335362

336-
7. The plug-in uses the Windows EDR ring by default. If you wish to switch to an earlier ring, set `OverrideReleaseRing` to one of the following under registry and restart WSL:
363+
3. The plug-in uses the Windows EDR ring by default. If you wish to switch to an earlier ring, set `OverrideReleaseRing` to one of the following under registry and restart WSL:
337364

338365
- **Name**: `OverrideReleaseRing`
339366
- **Type**: `REG_SZ`
340367
- **Value**: `Dogfood or External or InsiderFast or Production`
341368
- **Path**: `Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Defender for Endpoint plug-in for WSL`
342369

343-
8. If you see an error on launching WSL, such as "A fatal error was returned by plugin 'DefenderforEndpointPlug-in' Error code: Wsl/Service/CreateInstance/CreateVm/Plugin/ERROR_FILE_NOT_FOUND", it means the Defender for Endpoint plug-in for WSL installation is faulty. To repair it, follow these steps:
370+
4. If you see an error on launching WSL, such as "A fatal error was returned by plugin 'DefenderforEndpointPlug-in' Error code: Wsl/Service/CreateInstance/CreateVm/Plugin/ERROR_FILE_NOT_FOUND", it means the Defender for Endpoint plug-in for WSL installation is faulty. To repair it, follow these steps:
344371

345372
1. In Control Panel, go to **Programs** > **Programs and Features**.
346373

0 commit comments

Comments
 (0)