VSCode Remote WSL task: cargo not found


I'm running VSCode on Windows and in a Remove WSL session, I can't run the task cargo clippy because:

Executing task: cargo clippy 

/usr/bin/bash: line 1: cargo: command not found

 *  The terminal process "/usr/bin/bash '-c', 'cargo clippy'" failed to launch (exit code: 127). 

From the terminal, it works flawlessly.

I encounter that before and a restart of WSL did the trick, but today, I can't get it work at all so I'm looking for advice/help.

here is the task configuration:

            "type": "shell",
            "label": "cargo clippy",
            "command": "cargo clippy",
            "problemMatcher": [
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": false,
                "panel": "shared",
                "showReuseMessage": false,
                "clear": true
            "group": {
                "kind": "build",
                "isDefault": true


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.