automatic generation of this file, add the following entry to /etc/wsl.conf:# [network]# generateResolvConf = falsenameserver 172.19.80.1 可以看到 DNS 服务器是 172.19.80.1,通过环境变量 ALL_PROXY 配置代理: export ALL_PROXY="http://172.19.80.1:7890" 7890 是 Windows 上运行的代理客户端的端口,...
cat /etc/resolv.conf 再通过环境变量 ALL_PROXY 配置代理: export ALL_PROXY="http://172.31.224.1:2425" 2425 是 Windows 上运行的代理客户端的端口,我用的是clash,要打开allow lan才行,allow lan的原理简单总结一下就是:在A设备的Clash上开一个代理的IP和端口,然后把这个IP和端口放到另一个设备B上,作为...
要找到 Windows 的 IP 地址,可以利用 cat /etc/resolv.conf 命令在 Ubuntu 子系统中查看 DNS 服务器 IP。以 172.19.80.1 为例,通过设置环境变量 ALL_PROXY=:7890,即可完成 WSL2 中的代理配置。别忘了在 Windows 代理客户端上启用对本地局域网的请求权限。为了简化这一过程,可以编写一个 ba...
# This file was automatically generated by WSL. To stopautomatic generation of this file, add the following entry to /etc/wsl.conf:#[network]# generateResolvConf = falsenameserver 172.19.80.1 可以看到 DNS 服务器是172.19.80.1,通过环境变量ALL_PROXY配置代理: exportALL_PROXY="http://172.19.80.1:...
exportALL_PROXY="http://127.0.0.1:8000" 但是WSL2 基于 Hyper-V 运行,导致 Linux 子系统和 Windows 在网络上是两台各自独立的机器,从 Linux 子系统访问 Windows 首先需要找到 Windows 的 IP。 02 — 配置WSL2 访问 Windows 上的代理 有两个关键步骤: ...
export HTTPS_PROXY=$ALL_PROXY export https_proxy=$ALL_PROXY 1. 2. 3. 4. 5. 6. git也可以设置为使用代理 : git config --global proxy.https socks5://$windows_host:10808 1. 如果想要这些环境变量和设置每次启动终端都生效, 可以在~/.bashrc文件最下方添加上述内容 : ...
export https_proxy=$ALL_PROXY # 设置git的代理 if [ "`git config --global --get https.proxy`" != "socks5://$windows_host:1080" ]; then git config --global https.proxy socks5://$windows_host:1080 fi # wcd # cd C:\\ 自动切换到 /mnt/c ...
(demo) winse@DESKTOP-BR4MG38:~$ export ALL_PROXY=socks5://172.22.240.1:23333 HTTPS_PROXY=socks5://172.22.240.1:23333 HTTP_PROXY=socks5://172.22.240.1:23333 (demo) winse@DESKTOP-BR4MG38:~$ pip install git+https://github.com/huggingface/accelerate ...
export ALL_PROXY="http://127.0.0.1:8000" 1. 但是WSL2 基于 Hyper-V 运行,导致 Linux 子系统和 Windows 在网络上是两台各自独立的机器,从 Linux 子系统访问 Windows 首先需要找到 Windows 的 IP。 配置WSL2 访问 Windows 上的代理 有两个关键步骤: 1. WSL2 中配置的代理要指向 Windows 的 IP; 2. ...
export ALL_PROXY="http://172.25.48.1:7890" 7890 是Windows 上运行的代理客户端的端口,记得要在 Windows 代理客户端上配置允许本地局域网请求。 一键配置脚本 将上面的过程写入一个 bash 脚本,可以轻松的实现一键配置代理: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 #!/bin/bash host_ip=$(cat ...