File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
4549powershell.exe -Command " wsl --set-default-version 2"
You can’t perform that action at this time.
0 commit comments