I had the same problem, I did the following steps to solve it
All you need to do is enter to the JSON settings file from VSC
- Press F1
- Type User Settings
- Search for Proxy
- In proxy section, look for the title
Http: Proxy Authorization - Click on 'Edit in settings.json'
- Delete all brackets containing proxy data
- Save JSON file
After that, just restart VSC
You can also find the JSON in %appdata%/Code/User/settings.json
I had the same problem, I did the following steps to solve it
All you need to do is enter to the JSON settings file from VSC
- Press F1
- Type User Settings
- Search for Proxy
- In proxy section, look for the title
Http: Proxy Authorization - Click on 'Edit in settings.json'
- Delete all brackets containing proxy data
- Save JSON file
After that, just restart VSC
You can also find the JSON in %appdata%/Code/User/settings.json
so i find this
- press f1
- search user setting
- click enter
- search on user setting " proxy "
- click enter
- look for "use the proxy support for extensions."
- change override to on
maybe this can help you.
I am unable to install any extensions or code spaces on visual studio
error while fetching extensions XHR failed
VS Code XHR failed
XHR Failed on trying to install plugins via Visual Studio code
Videos
It happens that, this is a problem with the Egyptian ISPs' default DNS servers, which are most probably blocking some of Microsoft servers.
The solution (in case you live in Egypt):
- clear DNS cache using
ipconfig /flushdnscommand on Windows cmd (For Other OS). - change the default DNS servers in your router settings to Google's 8.8.8.8 & 8.8.4.4 (or Cloudflare's 1.1.1.1 or any other DNS server you trust).
- restart VSCode and try installing extensions.
Hopefully, everything will work fine by now.
Check this Github issue for more insight.
It probably is because of the certificate check.
Below solution works for me in CentOS 7 (Linux).
Step 1. Change the file /usr/share/applications/code.desktop
Open the file /usr/share/applications/code.desktop,
then modify the Exec value with adding --ignore-certificate-errors before %F:
Exec=/usr/share/code/code --unity-launch --ignore-certificate-errors %F
Save the file with typing sudo in the begining.

Step 2. Close all windows of vs code instances.
Step 3. Back to the terminal, use below command to open VS code:
code --ignore-certificate-errors
Step 4. Click extension button in the left side bar.
Click any extension like "Ruby" by Peng Lv, if the images in the Details page can be seen successfully, perhaps the issue is solved.
Step 5. Try to continue to install the extensions you need.
Just enjoy! May it be helpful for you.
It might be a problem downloading configuration file from az764295.vo.msecnd.net . For that you can download it externally and copy paste it to your linux server. Also, vs code automatically download this file while trying to connect with ssh, for that request your network administrator to open 443 port to open az764295.vo.msecnd.net on your linux server. To know whether the port is open or not ping az764295.vo.msecnd.net and telnet az764295.vo.msecnd.net 443. It is one time fixation.
try copying vs code configuration files to you server or you can download from https://az764295.vo.msecnd.net/stable/f80445acd5a3dadef24aa209168452a3d97cc326/vscode-server-linux-x64.tar.gz
I found the solution for my problems. it solved by using vpn. the problem was my wifi provider probably blocking the request on vs code, seems like there's something fishy about the DNS policy.
Your problem is the same as discussed in this thread:
- Visual Studio Code "Error while fetching extensions. XHR failed"
Unfortunately, there are several DIFFERENT possible root causes, and several different workarounds and solutions discussed in the thread.
You said you "tried several things". Please Update your post and specify exactly WHAT you tried, and the results.
You said it "works" on certain networks, but fails on your (home? school? other?) network (whether or not the network is "wifi" or not probably doesn't matter). Please clarify exactly "what's different" between the networks (to the best of your knowledge).
Please specify the platform you're running VSCode on (windows? MacOS? Linux? Other?)
Try this (one of the responses in the SO thread I cited above):
https://stackoverflow.com/a/71456820/421195
- press f1
- search
"user setting"- click enter
- search on user setting
"proxy"- click enter
- look for "use the proxy support for extensions."
- change
"override"to on
Q1: You're running the same version of VS Code, on Windows, using the same project, at home and at school, correct?
<= Q: Are you using the same PC (e.g. carrying a laptop from home to school), or are you using different PCs at home and at school?
Q2. By "Mobile data" (vs. "wifi"); you mean you "hotspot" for your cell phone service, correct?
Q3. The project ALWAYS works for Wifi (either at home or school), but NEVER works for your Hotspot, correct?
Q4. You're always trying to run the Remote Explorer extension in VS code when the error occurs (it never happens with other VSCode activities), correct?
<= Q: Any problems in other areas of VSCode (e.g. your compiler)?
Q5. The exact error message is The editor could not be opened due to an unexpected error: XHR failed, correct?
<= Q: Always using Remote Explorer, correct? What exactly are you doing in Remote Explorer?
BE SURE TO TRY ALL THE TROUBLESHOOTING TIPS HERE
(including verifying "ssh" from the VSCode command line, using your "bad" network):
https://code.visualstudio.com/docs/remote/ssh