visual-studio-codewindows-subsystem-for-linuxvscode-remote

Git extension disabled in VS code with WSL


The built-in Git extension has somehow become deactivated in VS code and can't be re-enabled. If I open the extension page it gives the following error:

"This extension is disabled in this workspace because it is defined to run in the Remote Extension Host. Please install the extension in 'WSL: Ubuntu' to enable."

screenshot

If I open the GitHub extension page I get the same message, but GitHub Authentication still seems to be activated okay. As far as I can tell I am already in the Remote Extension Host. Additionally the source control tab is saying that no source control providers are registered.

The Git extension has been working for me for months since I updated to WSL2, I've not installed any other extensions recently, but it seems to have started after rebooting my machine. I've tried rebooting and restarting VS code, deactivating GitHub authentication and GitLens then restarting VS code and that hasn't done anything.


Solution

  • I've approached the same problem, and the accepted answer didn't work for me. Also, I was not after installing all locally installed extensions on the server side.

    What worked for me is:

    1. Quit VS Code
    2. Delete .vscode-server from the home folder of the remote server you have an issue with
    3. Start VS Code and login to remote (problem solved, git should work again)
    4. Reinstall the same extensions as previously where installed on this remote