在windows上打开wsl ubuntu的时候,报错: The attempted operation is not supported for the type of object referenced.

 

解决方式:

需要在注册表添加一个key

  1. 创建一个名为wsl2.reg(或任何其他带有 .reg 后缀的文件名)的文件
  2. 在 中打开此文件notepad.exe,将下面的文本粘贴到其中。
  3. 保存存档。
  4. 双击这个文件,给它Administrator权限
  5. 打开wsl.exe

wsl2.reg 代码,我从这个问题复制

或者你可以wsl2.reg直接下载我的:

https://baijifeilong.github.io/wsl2.reg

参考:

https://jon.sprig.gs/blog/post/2140

https://github.com/microsoft/WSL/issues/4177

Categories: OS

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *