wsl2 + vscode 開發環境配置


 

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\

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM