From b8c0607d9c31bd33bbd3c77be350cf7491f1fec1 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Wed, 25 Mar 2026 14:48:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20wsl.conf=20=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=A6=86=E7=9B=96=EF=BC=8C=E6=94=B9=E4=B8=BA=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E7=94=A8=E6=88=B7=E6=89=8B=E5=8A=A8=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/wsl-init.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/scripts/wsl-init.sh b/scripts/wsl-init.sh index f0ca3ad..3add4b2 100755 --- a/scripts/wsl-init.sh +++ b/scripts/wsl-init.sh @@ -36,19 +36,13 @@ else passwd "$USERNAME" < /dev/tty fi -echo "==> 配置 WSL 默认用户..." -if [ -f /etc/wsl.conf ]; then - cp /etc/wsl.conf "/etc/wsl.conf.bak.$(date +%s)" -fi -cat > /etc/wsl.conf << EOF -[user] -default = $USERNAME -EOF - echo "" echo "✓ WSL 初始化完成!" echo "" echo "下一步:" -echo " 1. 在 PowerShell 中执行: wsl --terminate archlinux" -echo " 2. 重新打开 Arch WSL(将以 $USERNAME 身份登录)" -echo " 3. 运行: curl -fsSL https://git.furtherverse.com/imbytecat/archlinux-config/raw/branch/main/scripts/install.sh | bash" +echo " 1. 在 PowerShell 中设置默认用户:" +echo " wsl --manage archlinux --set-default-user $USERNAME" +echo " 2. 重启 WSL:" +echo " wsl --terminate archlinux" +echo " 3. 重新打开 Arch WSL 后运行:" +echo " curl -fsSL https://git.furtherverse.com/imbytecat/archlinux-config/raw/branch/main/scripts/install.sh | bash"