10

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.

bad_coder
  • 11,289
  • 20
  • 44
  • 72
pt3
  • 326
  • 1
  • 2
  • 8

2 Answers2

12

Please install the extension in 'WSL: Ubuntu' to enable."

That's is the hint on how to fix it.

  1. Open the extension panel (Ctrl + Shift + X)
  2. You should be able to see the section "WSL: UBUNTU: INSTALLED"
  3. Click on the download (cloud with down arrow) icon on the right
  4. Pick the extensions that are already installed in "LOCAL - INSTALLED" to be installed here
  5. Done.

The default extensions are installed in the LOCAL workspace. When working with VScode remote server (WSL: UBUNTU: INSTALLED) you have to install the extensions in that workspace as well.

Vijay Dev
  • 1,024
  • 7
  • 14
8

Okay, I solved it. I uninstalled Visual Studio Code, and removed the directory .vscode-server from my home directory in wsl. Then I reinstalled VS code and reran the code . command in wsl. I haven't tested whether removing .vscode-server then rerunning code will work without a clean reinstall of VS code, but suspect it might.

pt3
  • 326
  • 1
  • 2
  • 8
  • 1
    Same issue but different extensions. In my case just deleting `.vscode-server` inside WSL worked. Thanks! – Peter Jan 17 '22 at 13:32
  • Same too. After two hours of research / attempts, finally found your suggestion and great! Problem solved. Thanks @pt3 – cavo789 Aug 09 '22 at 11:26
  • @pt3 could you please accept the other answer? It looks to me that's the better approach. – lukstafi Nov 25 '22 at 16:50