Skip to content

The hub's scripts in WSL go through the distribution's shell first: devstack in ~/.local/bin is not found #597

Closed

Description

@7schmiede

What happens

wsl::sh (crates/devstack-hub/src/nodehost.rs) runs every script in the distribution as

wsl.exe -d <distro> -u root -- sh -c "PATH=\"$HOME/.local/bin:/usr/local/bin:/usr/lib/wsl/lib:$PATH\"; export PATH; <script>"

With --, wsl.exe hands the command line to the distribution's default shell first. That shell expands $HOME, $PATH and every $(…) of the script before sh -c runs it. So the probe's command substitutions (devstack --version, docker info, nvidia-smi -L) run in the outer shell with the default PATH, not with the ~/.local/bin the script puts in front.

Seen on a Windows 11 machine with Ubuntu-24.04 and 0.51.0: install.sh (the command the setup dialog shows) put devstack into /root/.local/bin, and the dialog kept saying "devstack is not installed in the distribution" after "Check again". The docker and GPU checks were green, since their tools are on the default PATH.

Reproduced the expansion here with Docker Desktop's distribution:

wsl.exe -d docker-desktop -u root -- sh -c 'echo HOME=$HOME; echo PATH=$PATH'
sh: syntax error: unexpected "("        # the outer shell expanded $PATH, Windows' "Program Files (x86)" broke the inner sh
wsl.exe -d docker-desktop -u root --exec sh -c 'echo HOME=$HOME; echo PATH=$PATH'
HOME=/root
PATH=/usr/local/sbin:...

The quoting of quote() and of the agent's arguments assumes the script reaches sh unchanged, which it does not.

Workaround: in the distribution as root, ln -sf /root/.local/bin/devstack /usr/local/bin/devstack.

Expected

wsl::sh runs wsl.exe -d <distro> -u root --exec sh -c <script>: the script reaches sh as one argument, unexpanded. A test pins the arguments wsl::sh builds.

Present since the switch ran scripts in WSL (#580, 0.50.0); seen first with the setup dialog of 0.51.0 (#590).

Activity

  1. added
    bug
    on Nov 19, 2026
  2. self-assigned this
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions