Skip to content

Commit 3dbb430

Browse files
authored
Merge pull request #550 from MicrosoftDocs/docs-staging-mw
Rewrite of troubleshoot pg draft 1
2 parents 29bfbb0 + f5791d9 commit 3dbb430

2 files changed

Lines changed: 90 additions & 44 deletions

File tree

WSL/troubleshooting.md

Lines changed: 84 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,40 @@
22
title: Troubleshooting the Windows Subsystem for Linux
33
description: Provides detailed information about common errors and issues people run into while running Linux on the Windows Subsystem for Linux.
44
keywords: BashOnWindows, bash, wsl, windows, windowssubsystem, ubuntu
5-
ms.date: 11/15/2017
5+
ms.date: 01/20/2020
66
ms.topic: article
7-
ms.assetid: 6753f1b2-200e-49cc-93a5-4323e1117246
8-
ms.custom: seodec18
97
ms.localizationpriority: high
108
---
119

1210
# Troubleshooting Windows Subsystem for Linux
1311

12+
For support with issues related to WSL, please see our GitHub repo:
13+
14+
## Search for any existing issues related to your problem
15+
16+
For technical issues, use the product repo: https://github.com/Microsoft/wsl/issues
17+
18+
For issues related to the contents of this documentation, use the docs repo: https://github.com/MicrosoftDocs/wsl/issues
19+
20+
## Submit a bug report
21+
22+
For bugs related to WSL functions or features, file an issue in the product repo: https://github.com/Microsoft/wsl/issues
23+
24+
## Submit a feature request
25+
26+
To request a new feature related to WSL functionality or compatibility, file an issue in the product repo:
27+
https://github.com/Microsoft/wsl/issues
28+
29+
## Contribute to the docs
30+
31+
To contribute to the WSL documentation, submit a pull request in the docs repo: https://github.com/MicrosoftDocs/wsl/issues
32+
33+
## Terminal or Command Line
34+
35+
Lastly, if your issue is related to the Windows Terminal, Windows Console, or the command-line UI, use the Windows terminal repo: https://github.com/microsoft/terminal
36+
37+
## Common issues
38+
1439
### Bash loses network connectivity once connected to a VPN
1540

1641
If after connecting to a VPN on Windows, bash loses network connectivity, try this workaround from within bash. This workaround will allow you to manually override the DNS resolution through `/etc/resolv.conf`.
@@ -27,6 +52,7 @@ If after connecting to a VPN on Windows, bash loses network connectivity, try th
2752
c. Close the file. <br/>
2853

2954
Once you have disconnected the VPN, you will have to revert the changes to `/etc/resolv.conf`. To do this, do:
55+
3056
1. `cd /etc`
3157
2. `sudo mv resolv.conf resolv.conf.new`
3258
3. `sudo ln -s ../run/resolvconf/resolv.conf resolv.conf`
@@ -37,20 +63,21 @@ Follow [these instructions](https://github.com/Microsoft/WSL/blob/master/CONTRIB
3763

3864
### Updating Bash on Ubuntu on Windows
3965

40-
There are two components of Bash on Ubuntu on Windows that can require updating.
66+
There are two components of Bash on Ubuntu on Windows that can require updating.
4167

4268
1. The Windows Subsystem for Linux
4369

44-
Upgrading this portion of Bash on Ubuntu on Windows will enable any new fixes outlines in the [release notes](https://msdn.microsoft.com/en-us/commandline/wsl/release_notes). Ensure that you are subscribed to the Windows Insider Program and that your build is up to date. For finer grain control including resetting your Ubuntu instance check out the [command reference page](https://msdn.microsoft.com/en-us/commandline/wsl/reference).
70+
Upgrading this portion of Bash on Ubuntu on Windows will enable any new fixes outlines in the [release notes](./release-notes.md). Ensure that you are subscribed to the Windows Insider Program and that your build is up to date. For finer grain control including resetting your Ubuntu instance check out the [command reference page](./reference.md).
4571

46-
2. The Ubuntu user binaries
72+
2. The Ubuntu user binaries
4773

4874
Upgrading this portion of Bash on Ubuntu on Windows will install any updates to the Ubuntu user binaries including applications that you have installed via apt-get. To update run the following commands in Bash:
4975

5076
1. `apt-get update`
5177
2. `apt-get upgrade`
5278

5379
### Apt-get upgrade errors
80+
5481
Some packages use features that we haven't implemented yet. `udev`, for example, isn't supported yet and causes several `apt-get upgrade` errors.
5582

5683
To fix issues related to `udev`, follow the following steps:
@@ -62,18 +89,21 @@ To fix issues related to `udev`, follow the following steps:
6289
exit 101
6390
```
6491

65-
2. Add execute permissions to `/usr/sbin/policy-rc.d`
92+
2. Add execute permissions to `/usr/sbin/policy-rc.d`:
93+
6694
``` BASH
6795
chmod +x /usr/sbin/policy-rc.d
6896
```
6997

70-
3. Run the following commands
98+
3. Run the following commands:
99+
71100
``` BASH
72101
dpkg-divert --local --rename --add /sbin/initctl
73102
ln -s /bin/true /sbin/initctl
74103
```
75104

76105
### "Error: 0x80040306" on installation
106+
77107
This has to do with the fact that we do not support legacy console.
78108
To turn off legacy console:
79109

@@ -82,50 +112,63 @@ To turn off legacy console:
82112
1. Click OK
83113

84114
### "Error: 0x80040154" after Windows update
85-
The Windows Subsystem for Linux feature may be disabled during a Windows update. If this happens the Windows feature must be re-enabled. Instructions for enabling the Windows Subsystem for Linux can be found in the [Installation Guide](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide#enable-the-windows-subsystem-for-linux-feature-gui).
115+
116+
The Windows Subsystem for Linux feature may be disabled during a Windows update. If this happens the Windows feature must be re-enabled. Instructions for enabling the Windows Subsystem for Linux can be found in the [Installation Guide](./install-win10.md).
86117

87118
### Changing the display language
119+
88120
WSL install will try to automatically change the Ubuntu locale to match the locale of your Windows install. If you do not want this behavior you can run this command to change the Ubuntu locale after install completes. You will have to relaunch bash.exe for this change to take effect.
89121

90122
The below example changes to locale to en-US:
123+
91124
``` BASH
92125
sudo update-locale LANG=en_US.UTF8
93126
```
94127

95128
### Installation issues after Windows system restore
96-
1. Delete the `%windir%\System32\Tasks\Microsoft\Windows\Windows Subsystem for Linux` folder. <br/>
129+
130+
1. Delete the `%windir%\System32\Tasks\Microsoft\Windows\Windows Subsystem for Linux` folder. <br/>
97131
**Note: Do not do this if your optional feature is fully installed and working.**
98-
2. Enable the WSL optional feature (if not already)
99-
3. Reboot
100-
4. lxrun /uninstall /full
101-
5. Install bash
132+
2. Enable the WSL optional feature (if not already)
133+
3. Reboot
134+
4. lxrun /uninstall /full
135+
5. Install bash
102136

103137
### No internet access in WSL
138+
104139
Some users have reported issues with specific firewall applications blocking internet access in WSL. The firewalls reported are:
105140

106141
1. Kaspersky
107-
1. AVG
108-
1. Avast
142+
2. AVG
143+
3. Avast
109144

110145
In some cases turning off the firewall allows for access. In some cases simply having the firewall installed looks to block access.
111146

112147
### Permission Denied error when using ping
113-
#### [Anniversary Update](https://msdn.microsoft.com/en-us/commandline/wsl/release_notes#build-14388-to-windows-10-anniversary-update)
114148

115-
Administrator privileges in Windows are required to run ping in WSL. To run ping, run Bash on Ubuntu on Windows as an administrator, or run bash.exe from a CMD/PowerShell prompt with administrator privileges.
149+
For [Windows Anniversary Update, version 1607](./release-notes.md#build-14388-to-windows-10-anniversary-update),
150+
**administrator privileges** in Windows are required to run ping in WSL. To run ping, run Bash on Ubuntu on Windows as an administrator, or run bash.exe from a CMD/PowerShell prompt with administrator privileges.
116151

117-
#### [Build 14926+](https://msdn.microsoft.com/en-us/commandline/wsl/release_notes#build-14926)
118-
Administrator privileges no longer required.
152+
For later versions of Windows, [Build 14926+](./release-notes.md#build-14926), administrator privileges are no longer required.
119153

120154
### Bash is hung
121-
If while working with bash, you find that bash is hung (or deadlocked) and not responding to inputs, help us diagnose the issue by collecting and reporting a memory dump. Note that these steps will crash your system. Do not do this if you are not comfortable with that or save your work prior to doing this. <br/>
122-
To collect a memory dump:
155+
156+
If while working with bash, you find that bash is hung (or deadlocked) and not responding to inputs, help us diagnose the issue by collecting and reporting a memory dump. Note that these steps will crash your system. Do not do this if you are not comfortable with that or save your work prior to doing this.
157+
158+
To collect a memory dump
159+
123160
1. Change the memory dump type to "complete memory dump". While changing the dump type, take a note of your current type.
161+
124162
2. Use the [steps](https://techcommunity.microsoft.com/t5/Core-Infrastructure-and-Security/How-to-Force-a-Diagnostic-Memory-Dump-When-a-Computer-Hangs/ba-p/257809) to configure crash using keyboard control.
163+
125164
3. Repro the hang or deadlock.
165+
126166
4. Crash the system using the key sequence from (2).
167+
127168
5. The system will crash and collect the memory dump.
169+
128170
6. Once the system reboots, report the memory.dmp to [email protected]. The default location of the dump file is %SystemRoot%\memory.dmp or C:\Windows\memory.dmp if C: is the system drive. In the email, note that the dump is for the WSL or Bash on Windows team.
171+
129172
7. Restore the memory dump type to the original setting.
130173

131174
### Check your build number
@@ -134,35 +177,45 @@ To find your PC's architecture and Windows build number, open
134177
**Settings** > **System** > **About**
135178

136179
Look for the **OS Build** and **System Type** fields.
137-
![Screenshot of Build and System Type fields](media/system.png)
138-
180+
![Screenshot of Build and System Type fields](media/system.png)
139181

140182
To find your Windows Server build number, run the following in PowerShell:
183+
141184
``` PowerShell
142185
systeminfo | Select-String "^OS Name","^OS Version"
143186
```
144187

145188
### Confirm WSL is enabled
189+
146190
You can confirm that the Windows Subsystem for Linux is enabled by running the following in PowerShell:
191+
147192
``` PowerShell
148193
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
149194
```
150195

151196
### OpenSSH-Server connection issues
197+
152198
Trying to connect your SSH server is failed with the following error: "Connection closed by 127.0.0.1 port 22".
199+
153200
1. Make sure your OpenSSH Server is running:
201+
154202
``` BASH
155203
sudo service ssh status
156204
```
205+
157206
and you've followed this tutorial:
158207
https://help.ubuntu.com/lts/serverguide/openssh-server.html.en
208+
159209
2. Stop the sshd service and start sshd in debug mode:
210+
160211
``` BASH
161212
sudo service ssh stop
162213
sudo /usr/sbin/sshd -d
163214
```
215+
164216
3. Check the startup logs and make sure HostKeys are available and you don't see log messages such as:
165-
```
217+
218+
```BASH
166219
debug1: sshd version OpenSSH_7.2, OpenSSL 1.0.2g 1 Mar 2016
167220
debug1: key_load_private: incorrect passphrase supplied to decrypt private key
168221
debug1: key_load_public: No such file or directory
@@ -179,6 +232,7 @@ Trying to connect your SSH server is failed with the following error: "Connectio
179232
```
180233

181234
If you do see such messages and the keys are missing under `/etc/ssh/`, you will have to regenerate the keys or just purge&install openssh-server:
235+
182236
```BASH
183237
sudo apt-get purge openssh-server
184238
sudo apt-get install openssh-server
@@ -188,6 +242,8 @@ sudo apt-get install openssh-server
188242

189243
This error is related to being in a bad install state. Please complete the following steps to try and fix this issue:
190244

191-
* If you are running the enable WSL feature command from PowerShell, try using the GUI instead by opening the start menu, searching for 'Turn Windows features on or off' and then in the list select 'Windows Subsystem for Linux' which will install the optional component.
192-
* Update your version of Windows by going to Settings, Updates, and clicking 'Check for Updates'
193-
* If both of those fail and you need to access WSL please consider upgrading in place by reinstalling Windows 10 using installation media and selecting 'Keep Everything' to ensure your apps and files are preserved. You can find instructions on how to do so at the [Reinstall Windows 10 page](https://support.microsoft.com/en-us/help/4000735/windows-10-reinstall).
245+
- If you are running the enable WSL feature command from PowerShell, try using the GUI instead by opening the start menu, searching for 'Turn Windows features on or off' and then in the list select 'Windows Subsystem for Linux' which will install the optional component.
246+
247+
- Update your version of Windows by going to Settings, Updates, and clicking 'Check for Updates'
248+
249+
- If both of those fail and you need to access WSL please consider upgrading in place by reinstalling Windows 10 using installation media and selecting 'Keep Everything' to ensure your apps and files are preserved. You can find instructions on how to do so at the [Reinstall Windows 10 page](https://support.microsoft.com/help/4000735/windows-10-reinstall).

WSL/user-support.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,15 @@ You will be asked to enter your current password, then asked to enter your new p
2929

3030
### Forgot your password
3131

32-
If you forgot the password for your Linux distribution, try this:
32+
If you forgot the password for your Linux distribution:
3333

34-
For Ubuntu:
35-
1. Open PowerShell and use it to change the default user name of your Ubuntu distribution to root with: `ubuntu config --default-user root`
34+
1. Open PowerShell and enter the root of your default WSL distribution using the command: `wsl -u root`
3635

37-
2. Open your distribution (Ubuntu) and you should see that the prompt now lists `root@computername` rather than the user name you entered. Enter the command: `passwd <username>` (replacing the username you created for your account and forgot the password for).
36+
-- If you need to update the forgotten password on a distribution that is not your default, use the command: `wsl -d Debian -u root`, replacing `Debian` with the name of your targeted distribution.
3837

39-
3. You will be prompted to enter a new UNIX password and then confirm that password. Once you're told that the password has updated successfully, close the Linux distribution (Ubuntu).
38+
2. Once your WSL distribution has been opened at the root level inside PowerShell, you can use this command to update your password: `passwd`
4039

41-
4. Open PowerShell and use it to change the default user name of your Ubuntu distribution back to your username with: `ubuntu config --default-user <your username>`
42-
43-
5. Now re-open your Ubuntu distribution and you should see your username displayed as the prompt, rather than `root`. Now you can confirm that your password was correctly updated.
44-
45-
For other Linux distributions, follow the same instructions, but in Powershell, change the command to align with the correct distribution name:
46-
47-
- openSUSE Leap 42: `openSUSE-42 config --default-user root`
48-
- SUSE Linux: `SLES-12 config --default-user root`
49-
- Debian: `debian config --default-user root`
50-
- Kali Linux: `kali config --default-user root`
40+
3. You will be prompted to enter a new UNIX password and then confirm that password. Once you're told that the password has updated successfully, close WSL inside of PowerShell using the command: `exit`
5141

5242
> [!NOTE]
53-
> If you are running an early version of Windows operating system, like 1703 (Creators Update) or 1709 (Fall Creators Update), see the [archived version of this user account update doc](../user-support-archived.md).
43+
> If you are running an early version of Windows operating system, like 1703 (Creators Update) or 1709 (Fall Creators Update), see the [archived version of this user account update doc](./user-support-archived.md).

0 commit comments

Comments
 (0)