Skip to content

Instantly share code, notes, and snippets.

@sys9kdr
Created October 23, 2023 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sys9kdr/6666beefd90a8b0f0288fc195327d51c to your computer and use it in GitHub Desktop.
Save sys9kdr/6666beefd90a8b0f0288fc195327d51c to your computer and use it in GitHub Desktop.
* https://scrapbox.io/utgwkk-pub/WSL2%E3%81%A7systemd%E3%82%92%E6%9C%89%E5%8A%B9%E3%81%AB%E3%81%97%E3%81%9F%E3%82%89Windows%E3%81%AEexe%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%8Cexec_format_error%E3%81%A7%E5%AE%9F%E8%A1%8C%E3%81%A7%E3%81%8D%E3%81%AA%E3%81%8F%E3%81%AA%E3%82%8B
* https://github.com/microsoft/WSL/issues/8843
systemdがWSL上で有効になっているとbinfmtの問題で動かないらしい。
この人はbinfmtいじってる。 binfmtとは... https://papamitra.hatenadiary.org/entry/20071215/binfmt
> Hi,
>
> I'm using https://github.com/yuk7/ArchWSL and enabling systemd reliably broke the ability to execute Windows applications from WSL. I resolved the issue by generating a file in /usr/lib/binfmt.d/WSLInterop.conf with the following content:
>
> ```
> :WSLInterop:M::MZ::/init:PF
> ```
>
> Also I removed mono.conf from the same directory as they might create a conflicting mapping. After running sudo systemctl restart systemd-binfmt, my executables are working now.
>
> I've tried several binfmt entries but most of the entries I found online did not include the 'PF' flags and resulted in an error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment