Skip to content

Commit 4007f52

Browse files
authored
use disk d for wsl (#8829)
1 parent a045062 commit 4007f52

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

tests/setup-wsl.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,16 @@ powershell.exe -Command "
3434
} | Out-Null
3535
"
3636

37-
# ── Step 3: Install and configure WSL 2 ──
38-
echo "=== Installing WSL 2 with ${DISTRO} ==="
37+
# ── Step 3: Install and configure WSL 2 (on D: drive to save C: space) ──
38+
echo "=== Installing WSL 2 with ${DISTRO} on D: drive ==="
3939

40-
# Install WSL and the Ubuntu distribution
40+
WSL_INSTALL_DIR="D:\\WSL\\${DISTRO}"
41+
42+
# Install WSL and the Ubuntu distribution directly to D: drive
43+
# --location installs the distro VHD on D: instead of C: to avoid disk pressure
4144
# --web-download avoids Microsoft Store dependency
42-
powershell.exe -Command "wsl --install ${DISTRO} --web-download --no-launch" || true
45+
powershell.exe -Command "New-Item -ItemType Directory -Force -Path '${WSL_INSTALL_DIR}' | Out-Null"
46+
powershell.exe -Command "wsl --install ${DISTRO} --web-download --no-launch --location '${WSL_INSTALL_DIR}'" || true
4347

4448
# Set WSL 2 as the default version
4549
powershell.exe -Command "wsl --set-default-version 2"

0 commit comments

Comments
 (0)