WSL2 在vscode无法连接copilot

报错情况:

本机可以使用copilot,但在WSL2上无法连接,报错信息如下:

检查网络情况:

bash 复制代码
ping api.github.com

发现无法连接:

复制代码
github.com:Temporary failure in name resolution

在网上搜集的解决方法:在设置中增加代理,但并不work

【Copilot】GitHub Copilot could not connect to server. Extension activation failed: "read ECONNRESET"-CSDN博客

故我关闭VPN,避免情况复杂,解决方法如下:

1.检查DNS

sudo vim /etc/resolv.conf

bash 复制代码
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 8.8.8.8
nameserver 8.8.4.4
  1. 重启网络,更新apt

sudo service network-manager restart

若未安装,先:sudo apt install network-manager

更新apt:

sudo apt-get update

sudo apt-get upgrade

3.再次ping

若未成功,可以重启尝试。

相关推荐
dLYG DUMS6 小时前
vscode配置django环境并创建django项目(全图文操作)
vscode·django·sqlite
大嘴皮猴儿8 小时前
从零开始学商品图翻译:小白也能快速掌握的多语言文字处理与上架技巧
大数据·ide·人工智能·macos·新媒体运营·xcode·自动翻译
JAVA学习通11 小时前
励志从零打造LeetCode平台之C端竞赛列表
java·vscode·leetcode·docker·状态模式
萑澈13 小时前
vscode怎么关闭点击音效
ide·vscode·编辑器
Freak嵌入式14 小时前
MicroPython对接大模型:uopenai + 火山方舟实现文字聊天和图片理解
ide·驱动开发·ai·llm·嵌入式·micropython·upypi
NQBJT18 小时前
[特殊字符] VS Code + Markdown 从入门到精通:写论文、技术文档的超实用指南
开发语言·vscode·c#·markdown
摇滚侠1 天前
帮我整理一份 IDEA 开发中常用快捷键
java·ide·intellij-idea
dyxal1 天前
VS Code 终端疑难杂症排查:为什么 PowerShell 无法启动?
vscode
【ql君】qlexcel1 天前
Visual Studio Code开发STM32设置头文件宏定义uint32_t报错
vscode·stm32·vs code·头文件宏定义·uint32_t报错·uint8_t报错·uint16_t报错
琉璃榴1 天前
Visual Studio Code连接远程服务器
服务器·vscode·github