-
Notifications
You must be signed in to change notification settings - Fork 823
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
Custom binfmt.d settings no longer work due to /usr/lib/systemd/system/systemd-binfmt.service.d/wsl.conf setting #12013
Comments
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The script will output the path of the log file once done. If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease 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:
|
@ As requested. |
The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running. Diagnostic information
|
There is nothing to trace. This is just a systemd setting. Can you please review without a trace? |
The reason is specified in the unit file: |
I must be missing something, because interop is working perfectly with that condition commented out, and until a recent update (either wsl or Ubuntu, I'm not sure which), this was working fine without touching that file. Is there something more to it than running windows executables from wsl without issue? |
Or let me ask this another way:
|
@ajkessel: This logic was indeed added to work around You can disable this behavior by adding:
to This one of the situation where there unfortunately isn't a "perfect" solution that will cover all usecases, but for users with an advanced setup like yours, adding this config entry should resolve the issue. |
Windows Version
10.0.19045.4780
WSL Version
2.3.17.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.153.1-microsoft-standard-WSL2
Distro Version
Ubuntu 24.04.1 LTS
Other Software
Custom binfmt.d settings as shown at https://github.com/ajkessel/wsltools
Repro Steps
I have a bunch of custom binfmt.d settings documented here. With my scripts, the user can launch a Windows executable from WSL and provide a Linux-form path and the correct native path will be automatically passed to the Windows executable without any transformation by the user. My scripts also allow the user to run PowerShell Scripts and Office documents right from WSL by their filenames.
Everything was working fine until recently. I upgraded WSL to 2.3.17.0 and Ubuntu to 24.04.1. I'm not sure which upgrade broke things, but I started noticing these errors in syslog:
This was never the case before.
I was able to fix it by commenting out the
ConditionVirtualization
line in/usr/lib/systemd/system/systemd-binfmt.service.d/wsl.conf
but this seems like a hack.Is there any reason that line needs to be there? After commenting it out, everything works fine for me again. There's #8204 which seems to touch on a related issue but I confess I don't fully understand what's going on there.
At the very least, it would be nice to have some documentation clearing up what's going on here. But this was working fine for me before recent upgrades, and commenting out the line in
wsl.conf
fixed it again for me. Hopefully there is a more systemic fix.Expected Behavior
Ability to define custom binfmt.d misc lines
Actual Behavior
Binfmt fails due to ConditionVirtualization setting
Diagnostic Logs
N/A
The text was updated successfully, but these errors were encountered: