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

Genie is wrongly configuring WSLInterop binfmt_misc #267

Closed
NyaMisty opened this issue May 4, 2022 · 2 comments
Closed

Genie is wrongly configuring WSLInterop binfmt_misc #267

NyaMisty opened this issue May 4, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@NyaMisty
Copy link

NyaMisty commented May 4, 2022

Windows version (build number):
10.0.22598.200

Linux distribution:
Ubuntu jammy

Kernel version:
5.10.102.1-microsoft-standard-WSL2

Genie version:
genie 2.3

Describe the bug
Running genie -i would cause Windows exe failed to find first parameter.

Running git.exe: empty output & exitcode 1
Running git.exe status: prints git help
Running git.exe status status: prints same with original git.exe status

To Reproduce
Steps to reproduce the behavior:

  1. genie -i
  2. git.exe status

Expected behavior
Apprarently

Additional context
This problem is actually caused by wrongly configured /usr/lib/binfmt.d/WSLInterop.conf:

:WSLInterop:M::MZ::/init:F

But the original cat /proc/sys/fs/binfmt_misc/WSLInterop is:

enabled
interpreter /tools/init
flags: PF
offset 0
magic 4d5a

The missing P is the problem. Changing F to PF in WSLInterop.conf would solve this issue, but I can't confirm whether other Windows version have the same situation.

@NyaMisty NyaMisty added the bug Something isn't working label May 4, 2022
cerebrate added a commit that referenced this issue May 7, 2022
@cerebrate
Copy link
Member

Fix added to 2.4 release. Thanks for catching this!

@gnw3
Copy link

gnw3 commented Dec 10, 2022

My WSL Debian did not have a /usr/lib/binfmt.d/WSLInterop.conf, I created on and tried it with and without the "P" flag. Debian required th eP. WSLg works with:

 % cat /usr/lib/binfmt.d/WSLInterop.conf
:WSLInterop:M::MZ::/init:PF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants