Comments (16)
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.
from vscode-chatgpt.
Thanks for your comments again @EzYDark. if somebody else could confirm your solution, I will add it to Readme. đđź
from vscode-chatgpt.
Can confirm the solution is working now! Closing the issue, thanks to everyone in the comments, and especially to the amazing extension author <3.
from vscode-chatgpt.
@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!
from vscode-chatgpt.
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:
-
INSTALL THE VCXSRV WINDOWS X-SERVER
pls get the installer right here,https://sourceforge.net/projects/vcxsrv/files/latest/download -
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):
- 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
- INSTALLING THE google-chrome
- 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
- CONFIGURATION OF ENVIRONMENT AND VSCODE EXTENSION
- 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
- The solution of WSL2 connects to VPNs on the Windows host.
Thewsl-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:
from vscode-chatgpt.
Sorry, I'm not familiar with this but my extension doesn't hardcode any tmp/ folders. From the error it looks like it could be a permission issue of chrome.exe on tmp folder? Could you try chmod
to allow chrome to access that folder with RW permissions?
from vscode-chatgpt.
@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
from vscode-chatgpt.
@gencay new version didn't fix the issue on itself. Although I had success opening browser and logging in using the link you provided on how to run puppeteer in WSL, after that VS Code still throws following exception:
Km Unable to login. Make sure to login and keep your browser open. This error may also be due to OpenAI servers down or that it's throttling the requests.
And the button says Protocol error (Runtime.callFunctionOn): Argument should belong to the same Javascript world as target object
.
I'm using Google Authentication to log in by the way.
from vscode-chatgpt.
@kirsanium
Hey. If you want, you can try my method I posted here #39. Hope it works for you.
I haven't tried WSL yet, but it could work too.
from vscode-chatgpt.
@kirsanium thanks for confirmation and thanks for your contribution @EzYDark! I updated the readme with references to these issues.
from vscode-chatgpt.
My WSL2 shell is zsh and with the @EzYDark solution, I get:
Unable to login. Make sure to login and keep your browser open. This error may also be due to OpenAI servers down or that it's throttling the requests. Error: Error Failed to launch the browser process! /etc/zsh/zshrc: line 31: key: BackSpace: must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: "${terminfo[kbs]}": must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: Home: must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: "${terminfo[khome]}": must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: End: must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: "${terminfo[kend]}": must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: Insert: must use subscript when assigning associative array /etc/zsh/zshrc: line 31: key: "${terminfo[kich1]}": must use subscript when assigning associative array /etc/zsh/zshrc: line 31: k...
from vscode-chatgpt.
Tried @EzYDark's solution and got the following error:
[4073:4073:0117/165518.793971:ERROR:ozone_platform_x11.cc(238)] Missing X server or $DISPLAY [4073:4073:0117/165518.794004:ERROR:env.cc(255)]
Obviously something to do with having X11 tools installed or the display environment variable set correctly but not sure how to proceed as I've tried installing them via these instructions and also tried editing my .zshrc config file to include DISPLAY environment variable.
from vscode-chatgpt.
Tried @EzYDark's solution and got the following error:
[4073:4073:0117/165518.793971:ERROR:ozone_platform_x11.cc(238)] Missing X server or $DISPLAY [4073:4073:0117/165518.794004:ERROR:env.cc(255)]
Obviously something to do with having X11 tools installed or the display environment variable set correctly but not sure how to proceed as I've tried installing them via these instructions and also tried editing my .zshrc config file to include DISPLAY environment variable.
I met the same issue and I found that compared to the 'GPT3 open AI key' method this 'browser Auto-login' just can invoke the perfect chatGPT APIs.
My environment is: VcXsrv Windows X Server + LXDE Linux desktop + google-chrome
and I think the only key point is to let this extension can read the DISPLAY environment variable when it opens the google-chrome in WSL2.
I've tried to add the DISPLAY environment in /etc/environment or .bashrc but neither of them can work.
while when I open the terminal and use the command line google-chrome
can setup normally with the DISPLAY environment variable imported.
@EzYDark any comments from your sides?
from vscode-chatgpt.
Thanks for sharing @shencp, If people can confirm this solution happy to take a PR to update the Readme with a reference to your solution.
from vscode-chatgpt.
Didn't work for me. Failed to install both packages (lxde/google-chrome)
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
lxde : Depends: lxde-core (>= 0.5.0-4ubuntu4) but it is not going to be installed
Depends: lxinput (>= 0.1.1) but it is not going to be installed
Depends: lxterminal but it is not going to be installed
Depends: obconf but it is not going to be installed
Recommends: lxdm but it is not going to be installed or
x-display-manager
Recommends: xserver-xorg
Recommends: policykit-1-gnome
Recommends: amixer but it is not installable
E: Unable to correct problems, you have held broken packages.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'google-chrome-stable' instead of './google-chrome-stable_current_amd64.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
google-chrome-stable : Depends: libgbm1 (>= 17.1.0~rc2) but 10.1.3-0ubuntu0.6 is to be installed
Depends: libu2f-udev but it is not installable
E: Unable to correct problems, you have held broken packages.
from vscode-chatgpt.
I released a new version to fix the Protocol error (Runtime.callFunctionOn): Argument should belong to the same JavaScript world as target object
error in v3.9.5. You can upgrade your extensions to use Browser Auto-login flow without that exact error now. Similar to #194
from vscode-chatgpt.
Related Issues (20)
- UI bug in actions window HOT 3
- Will repeat the answer to the previous question HOT 1
- Ability to delete/remove user/agent response from chat HOT 1
- Addition of GPT-4 model HOT 10
- Localization contributions - Chinese HOT 1
- Feature request: Easier switching between ChatGpt and 3.5 turbo (browser login vs API) HOT 2
- Azure OpenAI API Support HOT 2
- çćŹĺ źĺŽšéŽé˘ HOT 3
- Query about the assistant role HOT 1
- Unable to login, make sure to login and keep your browser open... On Windows 11 HOT 1
- I am not able to find "login" of the extension as described in readme HOT 3
- [Feature Request]: Smart code formatting based on context HOT 2
- Cannot log in on Fedora 37 HOT 1
- ChatGPT for VS Code deprecated & open-sourced HOT 57
- can you integrate edge api in the genie extension HOT 1
- Cannot compile by the project HOT 2
- Why are multiple response records displayed HOT 4
- This thing would be damn near perfect if... HOT 1
- help: How to get chatGPT(not OpenAI api) QA-list? (like previous vscode-chatgpt)
- ERR api-request-failed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ď¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-chatgpt.