Skip to content

Commit bd995fd

Browse files
committed
Merge branch 'licanhua-patch-2'
2 parents 7419503 + d899755 commit bd995fd

1 file changed

Lines changed: 56 additions & 23 deletions

File tree

WSL/troubleshooting.md

Lines changed: 56 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,21 @@ ms.localizationpriority: high
99

1010
# Troubleshooting Windows Subsystem for Linux
1111

12-
For support with issues related to WSL, please see our GitHub repo: https://github.com/Microsoft/wsl/issues
12+
For support with issues related to WSL, please see our [WSL product repo on GitHub](https://github.com/Microsoft/wsl/issues).
1313

1414
## Search for any existing issues related to your problem
1515

16-
For technical issues, use the product repo: https://github.com/Microsoft/wsl/issues
16+
For technical issues, use the [product repo](https://github.com/Microsoft/wsl/issues).
1717

18-
For issues related to the contents of this documentation, use the docs repo: https://github.com/MicrosoftDocs/wsl/issues
18+
For issues related to the contents of this documentation, use the [docs repo](https://github.com/MicrosoftDocs/wsl/issues).
1919

2020
## Submit a bug report
2121

2222
For bugs related to WSL functions or features, file an issue in the product repo: https://github.com/Microsoft/wsl/issues
2323

2424
## Submit a feature request
2525

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
26+
To request a new feature related to WSL functionality or compatibility, [file an issue in the product repo](https://github.com/Microsoft/wsl/issues).
2827

2928
## Contribute to the docs
3029

@@ -36,42 +35,46 @@ Lastly, if your issue is related to the Windows Terminal, Windows Console, or th
3635

3736
## Common issues
3837

39-
### I'm on Windows 10 version 1903 and I still do not see options for WSL 2.
38+
### I'm on Windows 10 version 1903 and I still do not see options for WSL 2
4039

41-
This is likely because your machine has not yet taken the backport for WSL 2. The simplest way to resolve this is by going to Windows Settings and clicking 'Check for Updates' to install the latest updates on your system. You can view the full instructions on taking the backport [here](https://devblogs.microsoft.com/commandline/wsl-2-support-is-coming-to-windows-10-versions-1903-and-1909/#how-do-i-get-it).
40+
This is likely because your machine has not yet taken the backport for WSL 2. The simplest way to resolve this is by going to Windows Settings and clicking 'Check for Updates' to install the latest updates on your system. See [the full instructions on taking the backport](https://devblogs.microsoft.com/commandline/wsl-2-support-is-coming-to-windows-10-versions-1903-and-1909/#how-do-i-get-it).
4241

43-
If you hit 'Check for Updates' and still do not receive the update you can install KB KB4566116 manually by [following this link](https://www.catalog.update.microsoft.com/Search.aspx?q=KB4566116).
42+
If you hit 'Check for Updates' and still do not receive the update you can [install KB KB4566116 manually](https://www.catalog.update.microsoft.com/Search.aspx?q=KB4566116).
4443

4544
### Error: 0x1bc when `wsl --set-default-version 2`
45+
4646
This may happen when 'Display Language' or 'System Locale' setting is not English.
47-
```
47+
48+
```powershell
4849
wsl --set-default-version 2
4950
Error: 0x1bc
5051
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
5152
```
5253

5354
THe actual error for `0x1bc` is:
54-
```
55+
56+
```powershell
5557
WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel
5658
```
5759

5860
For more information, please refer to issue [5749](https://github.com/microsoft/WSL/issues/5749)
5961

60-
6162
### Cannot access WSL files from Windows
63+
6264
A 9p protocol file server provides the service on the Linux side to allow Windows to access the Linux file system. If you cannot access WSL using `\\wsl$` on Windows, it could be because 9P did not start correctly.
6365

64-
To check this, you can check the start up logs using: `dmesg |grep 9p`, and this will show you any errors. A successfull output looks like the following:
66+
To check this, you can check the start up logs using: `dmesg |grep 9p`, and this will show you any errors. A successfull output looks like the following:
6567

66-
```
68+
```bash
6769
[ 0.363323] 9p: Installing v9fs 9p2000 file system support
6870
[ 0.363336] FS-Cache: Netfs '9p' registered for caching
6971
[ 0.398989] 9pnet: Installing 9P2000 support
7072
```
7173

7274
Please see [this Github thread](https://github.com/microsoft/wsl/issues/5307) for further discussion on this issue.
7375

74-
### Can't start WSL 2 distro and only see 'WSL 2' in output
76+
### Can't start WSL 2 distribution and only see 'WSL 2' in output
77+
7578
If your display language is not English, then it is possible you are seeing a truncated version of an error text.
7679

7780
```powershell
@@ -81,19 +84,49 @@ WSL 2
8184

8285
To resolve this issue, please visit `https://aka.ms/wsl2kernel` and install the kernel manually by following the directions on that doc page.
8386

84-
### "Error: 0x80370102 The virtual machine could not be started because a required feature is not installed."
87+
### `command not found` when executing windows .exe in linux
88+
89+
Users can run Windows executables like notepad.exe directly from Linux. Sometimes, you may hit "command not found" like below:
90+
91+
```Bash
92+
$ notepad.exe
93+
-bash: notepad.exe: command not found
94+
```
95+
96+
If there are no win32 paths in your $PATH, interop isn't going to find the .exe.
97+
You can verify it by running `echo $PATH` in Linux. It's expected that you will see a win32 path (for example, /mnt/c/Windows) in the output.
98+
If you can't see any Windows paths then most likely your PATH is being overwritten by your Linux shell.
99+
100+
Here is a an example that /etc/profile on Debian contributed to the problem:
101+
102+
```Bash
103+
if [ "`id -u`" -eq 0 ]; then
104+
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
105+
else
106+
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
107+
fi
108+
```
109+
110+
The correct way on Debian is to remove above lines.
111+
You may also append $PATH during the assignment like below, but this lead to some [other problems](https://salsa.debian.org/debian/WSL/-/commit/7611edba482fd0b3f67143aa0fc1e2cc1d4100a6) with WSL and VSCode..
112+
113+
For more information, see issue [5296](https://github.com/microsoft/WSL/issues/5296) and issue [5779](https://github.com/microsoft/WSL/issues/5779).
114+
115+
### Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS
85116

86117
Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
87118

88119
1. Check the [Hyper-V system requirements](/windows-server/virtualization/hyper-v/system-requirements-for-hyper-v-on-windows#:~:text=on%20Windows%20Server.-,General%20requirements,the%20processor%20must%20have%20SLAT.)
89-
2. If your machine is a VM, please enable [nested virtualization](./wsl2-faq.md#can-i-run-wsl-2-in-a-virtual-machine) manually. Launch powershell with admin, and run:
90120

91-
```powershell
92-
Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true
93-
```
121+
2. If your machine is a VM, please enable [nested virtualization](./wsl2-faq.md#can-i-run-wsl-2-in-a-virtual-machine) manually. Launch powershell with admin, and run:
122+
123+
```powershell
124+
Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true
125+
```
94126
95-
3. Please follow guidelines from your PC's manufacturer on how to enable virtualization. In general, this can involve using the system BIOS to ensure that these features are enabled on your CPU. Instructions for this process can vary from machine to machine, please see [this article](https://www.bleepingcomputer.com/tutorials/how-to-enable-cpu-virtualization-in-your-computer-bios/) from Bleeping Computer for an example.
96-
4. Restart your machine after enabling the `Virtual Machine Platform` optional component.
127+
3. Please follow guidelines from your PC's manufacturer on how to enable virtualization. In general, this can involve using the system BIOS to ensure that these features are enabled on your CPU. Instructions for this process can vary from machine to machine, please see [this article](https://www.bleepingcomputer.com/tutorials/how-to-enable-cpu-virtualization-in-your-computer-bios/) from Bleeping Computer for an example.
128+
129+
4. Restart your machine after enabling the `Virtual Machine Platform` optional component.
97130
98131
### Bash loses network connectivity once connected to a VPN
99132
@@ -311,7 +344,7 @@ This error is related to being in a bad install state. Please complete the follo
311344

312345
If you're seeing this error:
313346

314-
```
347+
```bash
315348
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
316349
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
317350
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ -320,7 +353,7 @@ Permissions 0777 for '/home/artur/.ssh/private-key.pem' are too open.
320353

321354
To fix this, append the following to the the ```/etc/wsl.conf``` file:
322355

323-
```
356+
```bash
324357
[automount]
325358
enabled = true
326359
options = metadata,uid=1000,gid=1000,umask=0022

0 commit comments

Comments
 (0)