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

检查网络情况:
ping api.github.com
发现无法连接:
github.com:Temporary failure in name resolution
在网上搜集的解决方法:在设置中增加代理,但并不work
故我关闭VPN,避免情况复杂,解决方法如下:
1.检查DNS
sudo vim /etc/resolv.conf
# 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
2. 重启网络,更新apt
sudo service network-manager restart
若未安装,先:sudo apt install network-manager
更新apt:
sudo apt-get update
sudo apt-get upgrade
3.再次ping


若未成功,可以重启尝试。
文章来源于互联网:WSL2 在vscode无法连接copilot
相关推荐: AI图像生成利器:Stable Diffusion 3.5本地运行与远程出图操作流程
前言 本篇文章将介绍如何在Windows系统电脑本地部署Stable Diffusion 3.5,并利用cpolar内网穿透工具实现公网环境下的远程访问,制作高质量的AI图片。无需复杂的公网IP配置或重复部署,让你的创作过程更加便捷高效。 **Stable D…
5bei.cn大模型教程网










