windows下开启wsl2参考官方文档:
系统版本要求: (For x64 systems) Version 1903 or higher, with Build 18362 or higher.
https://docs.microsoft.com/en-us/windows/wsl/install-win10#manual-installation-steps
WSL 2 with Visual Studio Code
参考官方文档
https://code.visualstudio.com/blogs/2019/09/03/wsl2
注意当安装了其他wsl虚拟机例如docker时, 直接在terminal中按教程输入 code . 容易发生server创建失败的错误(因为尝试在docker服务容器中创建vscode-remote-server)
此时可使用 "Remote-WSL: New Window Using Distro..." (vscode中F1执行命令), 选择正确的wsl容器即可.
Like Remote-WSL: New Window, this command opens a new VS Code window connected to WSL. But first, it opens a quick pick so that you can select a specific WSL distro:
windows资源管理中查看wsl虚拟机文件
# \\wsl$\{distro_name}\
# 例如
\\wsl$\ubuntu\