Skip to content

Failed to install Wsl-IpHandler #35

Closed
@dragoangel

Description

@dragoangel

Installation fails on Win11 via Terminal with:

Install-WslIpHandler -WslInstanceName "Ubuntu-22.04" -WslHostName ubuntu -GatewayIpAddress 192.168.31.1 -PrefixLength 25 -WslInstanceIpAddress 192.168.31.2 -DontModifyPsProfile -UseScheduledTaskOnUserLogOn
PowerShell installing Wsl-IpHandler to Ubuntu-22.04...
[sudo] password for admin:
bash: "C:UsersadminDocumentsPowerShellModulesWsl-IpHandlerScriptsBashinstall-wsl-iphandler.sh": No such file or directory
bash: line 1: ping -c1 windows 1>/dev/null && echo 1: No such file or directory
Test-WslInstallation on Ubuntu-22.04 Failed!
PowerShell finished installation of Wsl-IpHandler to Ubuntu-22.04 with Errors:
Pinging windows from WSL Instance: Ubuntu-22.04 failed:

Pinging ubuntu (WSL instance Ubuntu-22.04) from Windows failed.

Looks like escaping is broken somewhere as script trying to run script not via unix path

If I enter same command that fails in Debug, but in CMD:

wsl.exe -d Ubuntu-22.04 sudo -E env '"PATH=$PATH"' DEBUG=1 bash  $(wslpath "C:\Users\admin\Documents\PowerShell\Modules\Wsl-IpHandler\Scripts\Bash\install-wsl-iphandler.sh") "C:\Users\admin\Documents\PowerShell\Modules\Wsl-IpHandler\Scripts\Bash\wsl-iphandler.sh" /usr/local/bin "C:\Users\admin\Documents\PowerShell\Modules\Wsl-IpHandler\Scripts\Powershell\WSL-WinHostsEdit.ps1" /etc/wsl-iphandler.conf windows ubuntu 192.168.31.2

It looks like do not fail.

At the end of debug output:

bash: line 1: ping -c1 windows 1>/dev/null && echo 1: No such file or directory
DEBUG: Test-WslInstallation [1663]: $wslTest:
DEBUG: Test-WslInstallation [1673]: Starting WSL instance Ubuntu-22.04 for testing ping from Windows.
DEBUG: Test-WslInstallation [1681]: $windowsTest result: True
Test-WslInstallation on Ubuntu-22.04 Failed!
PowerShell finished installation of Wsl-IpHandler to Ubuntu-22.04 with Errors:
DEBUG: Install-WslIpHandler [294]: ScriptStackTrace: at Test-WslInstallation, C:\Users\admin\Documents\PowerShell\Modules\Wsl-IpHandler\Wsl-IpHandler.psm1: line 1695
at Install-WslIpHandler, C:\Users\admin\Documents\PowerShell\Modules\Wsl-IpHandler\Wsl-IpHandler.psm1: line 290
at <ScriptBlock>, <No file>: line 1
Pinging windows from WSL Instance: Ubuntu-22.04 failed:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions