在windows上打开wsl ubuntu的时候,报错: The attempted operation is not supported for the type of object referenced.
解决方式:
需要在注册表添加一个key
- 创建一个名为
wsl2.reg
(或任何其他带有 .reg 后缀的文件名)的文件 - 在 中打开此文件
notepad.exe
,将下面的文本粘贴到其中。 - 保存存档。
- 双击这个文件,给它
Administrator
权限 - 打开wsl.exe
wsl2.reg 代码,我从这个问题复制
1 2 3 4 5 6 |
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\AppId_Catalog\0408F7A3] "AppFullPath"="C:\\\\windows\\\\system32\\\\wsl.exe" "PermittedLspCategories"=dword:80000000 |
或者你可以wsl2.reg
直接下载我的:
https://baijifeilong.github.io/wsl2.reg
参考:
https://jon.sprig.gs/blog/post/2140
https://github.com/microsoft/WSL/issues/4177
0 Comments