Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows interop doesn't work for .exe files that live inside of a Docker container #11967

Open
1 of 2 tasks
nrclark opened this issue Aug 28, 2024 · 2 comments
Open
1 of 2 tasks

Comments

@nrclark
Copy link

nrclark commented Aug 28, 2024

Windows Version

Microsoft Windows [Version 10.0.22631.3737]

WSL Version

2.3.17.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.153.1-2

Distro Version

Ubuntu 22.04

Other Software

Docker (Ubuntu 22), version 24.0.7

Repro Steps

  1. Launch WSL (ubuntu-22.04).
  2. Run /mnt/c/Windows/System32/cmd.exe and it works fine.
  3. Run a custom some-program.exe that lives in Ubuntu's filesystem (maybe in /home/username) and it works fine.
  4. Start a Docker container with /run/WSL, /init, /mnt/wsl, /mnt/wslg, and /mnt/c bind-mounted into the container, and the WSL2_GUI_APPS_ENABLED WSL_INTEROP, and PULSE_SERVER enviroment variables passed through to the container.
  5. Run /mnt/c/Windows/System32/cmd.exe inside of the container and it works fine.
  6. Run a custom some-other-program.exe that lives only in the Docker container and it fails with ./some-other-program.exe: Invalid argument.
  7. Look up the path to some-other-program.exe in the host's /var/lib/docker/overlay2 and run it from there, and it works fine.

Expected Behavior

some-other-program.exe should be launchable from inside of Docker.

Actual Behavior

some-other-program.exe fails to launch from inside of Docker, possibly because of Docker container bind-mount path translation.

Diagnostic Logs

WslLogs-2024-08-28_23-33-06.zip

Copy link

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Diagnostic information
Detected appx version: 2.3.17.0

@OneBlue
Copy link
Collaborator

OneBlue commented Sep 5, 2024

@nrclark: Thank you for reporting this.

This is an interesting edge case. Since docker runs in a chroot, the path that the windows service receives is relative to that root, and therefore trying to create that process from Windows fails since that path doesn't exist in the distribution filesystem:

Microsoft.Windows.Subsystem.Lxss	LxssException	08-28-2024 14:33:23.346	"	"	"Code: 	
File: 	C:\__w\1\s\src\windows\common\SubProcess.cpp
FunctionName: 	
HRESULT: 	0x8007010B
Line number: 	207
Message: 	""ApplicationName: \\wsl.localhost\Ubuntu-22.04\usr\local\stow\python-3.12.4-embed-amd64\share\python-3.12.4-embed-amd64\python.exe, CommandLine: python.exe, WorkingDirectory: \\wsl.localhost\Ubuntu-22.04\usr\local\stow\python-3.12.4-embed-amd64\share\python-3.12.4-embed-amd64""
Type: 	0
wslVersion: 	2.3.17.0"				22712	9900	2		00000000-0000-0000-0000-000000000000		

Adding support for this would essentially be a new feature, adding feature tag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants