Bpazy / blog

我的博客,欢迎关注和讨论
https://github.com/Bpazy/blog/issues
MIT License
39 stars 2 forks source link

WSL2 和 Proxifier 冲突的解决方案 #156

Open Bpazy opened 4 years ago

Bpazy commented 4 years ago

解决方案

  1. 下载 http://www.proxifier.com/tmp/Test20200228/NoLsp.exe;
  2. 使用管理员权限运行:NoLsp.exe c:\windows\system32\wsl.exe

方案来源

https://github.com/microsoft/WSL/issues/4177#issuecomment-597736482

Thanks for the info.
We have reproduced this issue. Apparently, wsl.exe displays this error if Winsock LSP DLL gets loaded into its process.
The easiest solution is to use WSCSetApplicationCategory WinAPI call for wsl.exe to prevent this. Under the hood the call creates an entry for wsl.exe at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\AppId_Catalog This tells Windows not to load LSP DLLs into wsl.exe process.
We have a tool that can make this call: www.proxifier.com/tmp/Test20200228/NoLsp.exe
Please just run as admin with the full path to wsl.exe as the parameter: NoLsp.exe c:\windows\system32\wsl.exe
This has fixed the problem in my case.
Please let me know how it works for you.

longlivewe commented 4 years ago

太惨了,NoLsp.exe闪退

Bpazy commented 4 years ago

太惨了,NoLsp.exe闪退

@longlivewe 这倒是没遇到,可否详细描述下问题,让其他有相同问题的人参考下呢?

escape0707 commented 4 years ago

我之前一直用clash,一直没有遇到过这个问题。但是如果用基于winsock的加速器之类的,就马上不行了。无法启动wsl的时候必须 netsh winsock reset,幸运的是,不需要重启就可以启动WSL2,也不会影响clash的翻墙。

AiProgram commented 3 years ago

太惨了,NoLsp.exe闪退

不知道你的闪退是什么样的,我的情况是用了nolsp.exe也只能启动WSL 2的系统,然后命令行显示一个Success就没了下文,再输入wsl还是一样的报错,但是wsl 后台确实还在。最后只有netsh winsock reset有效,wsl再也不报错了,fq软件重启也还运行正常

volcanoAlbert commented 3 years ago

运行NoLsp.exe提示 WSCSetApplicationCategory() for C:\Windows\System32\wsl.exe failed with error 5`

ZhangLongchao commented 3 years ago

运行NoLsp.exe提示 WSCSetApplicationCategory() for C:\Windows\System32\wsl.exe failed with error 5`

管理员下运行。

onlySlient commented 2 years ago

run as admin with the full path to wsl.exe as the parameter

BrandonBocheng commented 2 years ago

Got it, Success!

thsno02 commented 2 years ago

太惨了,NoLsp.exe闪退

闪退不要紧的,只要在当前文件目录执行 .\NoLsp.exe c:\windows\system32\wsl.exe 即可完成操作。

Konano commented 1 year ago

更新一下最新的操作: https://github.com/microsoft/WSL/issues/4177#issuecomment-1336406826

注意:WSL 版本更新后得重新跑一遍 NoLsp.exe