microsoft / microsoft/WSL

Windows command interop in WSL does not work, reports not found for all commands

Open
#6,243 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

Environment

Windows build number: Microsoft Windows [Version 10.0.18363.1198]
Your Distribution version: [On Debian or Ubuntu run `lsb_release -r` in WSL]
Whether the issue is on WSL 2 and/or WSL 1: Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020

Steps to reproduce

Installed Docker Desktop and the patch to update WSL to 2 by following these instructions WSL Install Instructions but then installing Docker Desktop instead of a standalone distro.

Then:

    C:\Users\User>wsl -l -v
      NAME                   STATE           VERSION
    * docker-desktop         Running         2
      docker-desktop-data    Running         2

Note I have no additional distribs installed other than what Docker installs itself.

Run wsl to start the default distrib which wsl -l -v indicated was docker-desktop. Then from inside that distrib execute a simple Windows command using interop as described in the documentation Run Windows Tools From Linux

C:\Users\User>wsl
DESKTOP-SDE0C3N:/tmp/docker-desktop-root/mnt/host/c/Users/Martin# cmd.exe /C dir
-sh: cmd.exe: not found

<--
Collect WSL logs by following these instructions: https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md#8-detailed-logs
-->
That's a 15 minute process! Don't you have a half reasonable method of getting some logs?

Expected behavior

I'm expecting cmd.exe to run.

Actual behavior

It fails with Not Found.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure in the Docker Desktop docker-desktop WSL 2 distribution using cmd.exe /C dir, then review the linked Run Windows Tools From Linux documentation and CONTRIBUTING.md section 8 for logging. Done means Windows command interop works from the distribution and the failure is covered by an identified fix or documented cause.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, linux
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.