Closed mataha closed 2 months ago
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
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!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Found '/emailed-logs', adding tag 'emailed-logs'
/emailed-logs
@mataha: Can you capture an strace of the command that's showing this error ? If you're trying to run a Windows command with interop disabled, this error is expected.
@mataha: Can you capture an strace of the command that's showing this error ? If you're trying to run a Windows command with interop disabled, this error is expected.
It's not a Windows command (though it runs on Windows just fine) - in fact, I can run it without any hiccups if I disable WSLInterop manually:
$ sudo sh -c 'echo -1 >"/proc/sys/fs/binfmt_misc/WSLInterop"'
$ ./make --version
GNU Make 4.4.1
Built for x86_64-linux-cosmo
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
But that defeats the point of interop.enabled = false
in the first place; not to mention I have to do that every time I start WSL.
strace -ff ./make --version
Setting interop.enabled = false
won't disable WSLInterop
. It seems broken! Contents of/proc/sys/fs/binfmt_misc/
after restart:
zcobol@toto:~$ ls -l /proc/sys/fs/binfmt_misc/
total 0
-rw-r--r-- 1 root root 0 Aug 13 13:58 WSLInterop
-rw-r--r-- 1 root root 0 Aug 13 13:59 WSLInterop-late
--w------- 1 root root 0 Aug 13 13:59 register
-rw-r--r-- 1 root root 0 Aug 13 13:58 status
WSLInterop
and WSLInterop-late
are present:
zcobol@toto:~$ cat /proc/sys/fs/binfmt_misc/WSLInterop
enabled
interpreter /init
flags: PF
offset 0
magic 4d5a
The file make
used for testing has the same magic number as Windows binaries:
zcobol@toto:~$ xxd -l 2 make
00000000: 4d5a MZ
and if running it when WSLInterop
is enabled, this is the output:
zcobol@toto:~$ ./make --version
error: APE is running on WIN32 inside WSL. You need to run: sudo sh -c 'echo -1 > /proc/sys/fs/binfmt_misc/WSLInterop'
File info:
zcobol@toto:~$ file make
make: DOS/MBR boot sector; partition 1 : ID=0x7f, active, start-CHS (0x0,0,1), end-CHS (0x3ff,255,63), startsector 0, 4294967295 sectors
The test can be done with a Windows binary, i.e. notepad, using an APE binary is not necessary:
zcobol@toto:~$ notepad.exe
<3>WSL (413) ERROR: UtilAcceptVsock:251: accept4 failed 110
Ok I see. This is unfortunately the same issue as #8203. There seems to be support for binfmt namespacing in recent kernels so we might be able to finally implement this.
/dupe #8203
Windows Version
Microsoft Windows [Version 10.0.19045.4651]
WSL Version
2.2.4.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.153.1-2
Distro Version
Ubuntu 22.04
Other Software
Applicable to any binary utilizing the Actually Portable Executable format.
Repro Steps
Expected Behavior
Actual Behavior
Diagnostic Logs
/emailed-logs