diff --git a/x11docker b/x11docker index 72dc7f80..4003a0fd 100755 --- a/x11docker +++ b/x11docker @@ -6249,17 +6249,16 @@ check_host() { # check host environment Winsubpath="$(convertpath unix "$(cygpath.exe -w "/" | rmcr)" )" Mobyvm="yes" ;; - WSL1) - Winsubmount="/mnt" + WSL1|WSL2) + command -v "/mnt/c/Windows/System32/cmd.exe" >/dev/null && Winsubmount="/mnt" + command -v "/c/Windows/System32/cmd.exe" >/dev/null && Winsubmount="" grep -q "Windows" <<< "${PATH:-}" || export PATH="${PATH:-}:$Winsubmount/c/Windows/System32:$Winsubmount/c/Windows/System32/WindowsPowerShell/v1.0" # can miss after sudo in WSL + command -v "$Winsubmount/c/Windows/System32/cmd.exe" >/dev/null || error "$Winsubsystem: Could not find cmd.exe + in /mnt/c/Windows/System32 or /c/Windows/System32. + Do you have a different path to your Windows system partition?" Winsubpath="$(convertpath unix "$(getwslpath)")" Mobyvm="yes" ;; - WSL2) - Winsubmount="" - grep -q "Windows" <<< "${PATH:-}" || export PATH="${PATH:-}:$Winsubmount/c/Windows/System32:$Winsubmount/c/Windows/System32/WindowsPowerShell/v1.0" # can miss after sudo in WSL - Winsubpath="$(convertpath unix "$(getwslpath)")" - ;; esac Winsubmount="${Winsubmount%/}" Winsubpath="${Winsubpath%/}" @@ -6268,7 +6267,7 @@ check_host() { # check host environment [ -z "$Mobyvm" ] && Mobyvm="no" case $Mobyvm in yes) - command -v docker.exe >/dev/null || export PATH="$PATH:$(convertpath subsystem "C:/Program Files/docker"):$(convertpath subsystem "C:/Program Files/Docker/Docker/resources/bin")" + command -v docker.exe >/dev/null || export PATH="${PATH:-}:$(convertpath subsystem "C:/Program Files/docker"):$(convertpath subsystem "C:/Program Files/Docker/Docker/resources/bin")" Dockerexe="docker.exe" ;; no)