From 5cf6342b760eaff8b57d192bdf3fc12428b32812 Mon Sep 17 00:00:00 2001 From: Ted88368 Date: Sun, 4 Jun 2023 09:21:03 +0800 Subject: [PATCH 1/4] update --- WSL2.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/WSL2.md b/WSL2.md index fc577ae..30c53b1 100644 --- a/WSL2.md +++ b/WSL2.md @@ -1,5 +1,4 @@ -## WSL2 设置固定IP - +## WSL2 设置 ### 镜像路径修改 说明:Docker Desktop也使用了WSL,而且有专门的名字, docker-desktop-data和docker-desktop @@ -12,6 +11,19 @@ wsl --import docker-desktop-data F:\\docker\wsl\docker-desktop-data F:\\wsl\doc wsl --import docker-desktop F:\\docker\wsl\docker-desktop F:\\wsl\docker-desktop.tar --version 2 ``` +#### 固定IP ++ [《WSL2固定IP解决方案》](https://www.loyating.com/articles/23) + + +#### 修改WSL2的路径 +```shell +wsl -l -v +wsl --export Ubuntu-22.04 F:\\wsl\Ubuntu-22.04.tar +wsl --unregister Ubuntu-22.04 +wsl --import Ubuntu-22.04 F:\\docker\wsl\Ubuntu-22.04 F:\\wsl\Ubuntu-22.04.tar --version 2 +``` + + ### 参考资料 + [《WSL2固定IP解决方案》](https://www.loyating.com/articles/23) + [《Windows10子系统WSL修改默认安装目录到其他盘》](https://blog.csdn.net/weixin_40837318/article/details/108233688) From a1fcc029be5c5b206f884203808cdecd320f6910 Mon Sep 17 00:00:00 2001 From: Ted88368 Date: Sun, 4 Jun 2023 09:30:58 +0800 Subject: [PATCH 2/4] update --- WSL2.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WSL2.md b/WSL2.md index 30c53b1..3003529 100644 --- a/WSL2.md +++ b/WSL2.md @@ -21,6 +21,8 @@ wsl -l -v wsl --export Ubuntu-22.04 F:\\wsl\Ubuntu-22.04.tar wsl --unregister Ubuntu-22.04 wsl --import Ubuntu-22.04 F:\\docker\wsl\Ubuntu-22.04 F:\\wsl\Ubuntu-22.04.tar --version 2 + +Ubuntu-22.04 config --default-user username ``` From bb69cb05a130fee1a0ee6f7a1d953f9c2cfdc738 Mon Sep 17 00:00:00 2001 From: Ted88368 Date: Sun, 4 Jun 2023 09:33:52 +0800 Subject: [PATCH 3/4] Ubuntu-22.04 => Ubuntu2204 --- WSL2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WSL2.md b/WSL2.md index 3003529..8535df5 100644 --- a/WSL2.md +++ b/WSL2.md @@ -22,7 +22,7 @@ wsl --export Ubuntu-22.04 F:\\wsl\Ubuntu-22.04.tar wsl --unregister Ubuntu-22.04 wsl --import Ubuntu-22.04 F:\\docker\wsl\Ubuntu-22.04 F:\\wsl\Ubuntu-22.04.tar --version 2 -Ubuntu-22.04 config --default-user username +Ubuntu2204 config --default-user username ``` From 833dd6a7e56f9f06e2d64ef619ffb06dbd1c9a91 Mon Sep 17 00:00:00 2001 From: Ted88368 Date: Sun, 24 Dec 2023 17:06:14 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=91=BD=E4=BB=A4=E6=8E=A7=E5=88=B6=E4=BB=A3=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WSL2.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/WSL2.md b/WSL2.md index 8535df5..6911bcf 100644 --- a/WSL2.md +++ b/WSL2.md @@ -15,6 +15,17 @@ wsl --import docker-desktop F:\\docker\wsl\docker-desktop F:\\wsl\docker-deskto + [《WSL2固定IP解决方案》](https://www.loyating.com/articles/23) +#### 命令行代理设置 +```shell +# 设置代理命令 +export SOCKS5="socks5://192.168.1.12:7890" +alias httpProxy="export http_proxy=${SOCKS5};export https_proxy=${http_proxy}" +alias httpProxyOff="unset http_proxy;unset https_proxy" + +alias gitProxy="git config --global http.proxy ${SOCKS5};git config --global https.proxy ${SOCKS5}" +alias gitProxyOff="git config --global --unset http.proxy;git config --global --unset https.proxy" +``` + #### 修改WSL2的路径 ```shell wsl -l -v