New machine setup

Use VS Code with WSL

Open your Linux projects in Windows VS Code, with the terminal and tools running inside Ubuntu.

WSL is a Windows feature. On macOS and Linux your terminal already works the way WSL gives Windows.

WSL is a Windows feature. On macOS and Linux your terminal already works the way WSL gives Windows.

  1. Install VS Code on Windows
    PowerShell
    winget install Microsoft.VisualStudioCode
  2. Add the WSL extension
    PowerShell
    code --install-extension ms-vscode-remote.remote-wsl

    Open a new PowerShell window first if code isn't found.

  3. Open a project from inside Ubuntu
    PowerShell
    wsl
    cd ~/projects/my-app
    code .

    The first time, VS Code sets itself up inside Ubuntu, which takes a minute.

Check it worked

  1. Check the extension is installed
    PowerShell
    code --list-extensions

    You should see ms-vscode-remote.remote-wsl. In VS Code, the bottom-left corner says WSL: Ubuntu.