vscode-chatgpt: Doesn't work with VSCode under WSL2

Set my Chromium path to /mnt/c/Program Files/Google/Chrome/Application/chrome.exe, and after hitting login button I get: image

I believe in such case tmp path should be on mounted C drive, maybe make it configurable?

I do realize it might be an exotic way to use VS Code for you, but it’s the only way I use it and your extension seems to be the only way to use ChatGPT from inside VS Code at all 😛

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 16 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I also tried this extension today in WSL (Debian) and it works perfectly via built-in X11. I just installed Google Chrome in WSL using these commands:

sudo apt install wget wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo apt install ./google-chrome-stable_current_amd64.deb

(Source: https://itsfoss.com/install-chrome-debian-kali-linux/)

And then just set the ‘Chromium Path’ in VSCode (ChatGPT extension) to ‘google-chrome’ (without quotes!)

__

It’s even easier than I described in #39 for a Remote (SSH) extension.

Can confirm the solution is working now! Closing the issue, thanks to everyone in the comments, and especially to the amazing extension author ❤️.

Thanks for your comments again @EzYDark. if somebody else could confirm your solution, I will add it to Readme. 🙏🏼

After restarting my laptop, everything seems to work fine right now. I list the detailed steps right here:

this is my environmental solution:

win10(VcXsrv Windows X Server) + ubuntu20.04(LXDE Linux desktop + google-chrome)

On win10:

  1. INSTALL THE VCXSRV WINDOWS X-SERVER pls get the installer right here,https://sourceforge.net/projects/vcxsrv/files/latest/download

  2. RUNNING THE X-SERVER DESKTOP

  • Windows search “xlaunch” and click on “XLaunch” in the results. A display settings window should open.
  • Select “One large window” and click “Next”.
  • Select “Start no client” and click “Next”.

On Ubuntu(WSL2):

  1. INSTALLING AND RUNNING THE LINUX DESKTOP
  • sudo apt install lxde
  • export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk ‘{print $2}’):0
  • export LIBGL_ALWAYS_INDIRECT=1
  • startlxde
  1. INSTALLING THE google-chrome
  1. CONFIGURATION OF ENVIRONMENT AND VSCODE EXTENSION
  1. add the relevant environment variables in ~/.bashrc to make sure when this VScode extension open the google-chrome can use them.
  • export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk ‘{print $2}’):0
  1. change the extension configuration image

image

  1. The solution of WSL2 connects to VPNs on the Windows host. The wsl-vpnkit v0.3 script uses gvisor-tap-vsock to provide network connectivity to the WSL 2 VM while connected to VPNs on the Windows host. This requires no settings changes or admin privileges on the Windows host. pls find the detailed info behind the following link

https://github.com/sakai135/wsl-vpnkit

Don’t forget set the proxy in WSL extension settings: image

@kirsanium I released a new version with the mentioned flags set. I don’t know if it’ll help but it was mentioned in this thread

There is also this troubleshooting guide on how to run puppeteer on WSL https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-on-wsl-windows-subsystem-for-linux

For me, installing Chrome on Ubuntu Server 22.04.1 inside WSL2 on Windows 11 worked. Thanks for the tip, I didn’t know it was possible to run Chrome on Ubuntu Server WSL2 without a GUI!