Lately I have been working on a customer project where I had to use a company managed Window device. Normally I work on a Mac to do my development work. So I configured my brand new Windows device and also wanted to use the Windows Subsystem for Linux (WSL), in order to get better build time results and be able to use bash etc. More information on how to install WSL can be found here. After setting up everything and I was developing for the project, I noticed my Github Copilot Visual Studio Code extension was not working anymore when my Workspace was using the WSL.

After searching the internet in order to find out if I could find if others are having the same issue, I couldn’t really find a solution. I then went into the GitHub Copilot logs for the extension and I was seeing a fetch error with the message ‘UNABLE_TO_GET_ISSUER_CERT_LOCALLY’. This basically means the extension running at WSL cannot verify the certificate in the local (Windows) certificate store. After digging some more I found some people where behind a local proxy or where using Zscaler. And I was using Zscaler too, in order to connect to corporate network.

After some more digging I saw someone using below settings in the settings.json:

"remote.extensionKind": {
  "GitHub.copilot": ["ui"],
  "GitHub.copilot-chat": ["ui"]
}

If I understand correctly, this would use Windows instead of WSL for the Copilot extension. Still a workaround and I wasn’t quite sure if this had other implications or something.

Then I saw an issue on GitHub about a WSL2 bug with GitHub Copilot Chat. In the discussing someone stated to turn off Proxy Support:

This would bypass the local proxy of the Zscaler and connect to GitHub Copilot directly. That worked!

Conclusion

When using WSL 2 on Windows and using Visual Studio Code and want to use GitHub Copilot Chat, doesn’t always work when you are connected to VPN or are behind a corporate proxy. Bypassing the Proxy in the VSCode settings will make sure you are able to use GitHub Copilot Chat on WSL 2. Hope it helps people while using this setup.

Happy coding!