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

systemd-binfmt.service.d/wsl.conf breaking compatibility with qemu` from version >=8.0.0 onwards #11

Open
ColorfulRhino opened this issue Mar 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ColorfulRhino
Copy link

ColorfulRhino commented Mar 29, 2024

Hello!
This config below breaks compatibility with qemu-user-static starting from version 8.0.0.

# systemd breaks WSL interoperability by rewriting the binfmt interpreters configuration.
[Unit]
ConditionVirtualization=!wsl

qemu has removed binfmt-support registration from version 8.0.0 onwards, see changelog:

  * New qemu release 8.0.0.
  * remove binfmt-support registration, use systemd binfmd.d/ only
    No more binfmt-support support. Unregister any entries on upgrades.
  * binfmt: ship (but not enable) entries for all arches, do not omit native
    Ship all really-foreign binfmt entries in /usr/lib/binfmt.d/ as usual,
    to be enable automatically at package install. Also ship the
    same-cpu-family entries in /usr/share/doc/qemu-user-static/qemu-foo.conf -
    this way it will not be enabled automatically but it will be possible to
    (carefully) symlink the needed additional entries to /etc/binfmt.d/.
    (Closes: #924667, #1016810, #1027781)

Previously, the binfmt files were stored in /usr/share/binfmts/ (e.g. qemu-aarch64) after installing qemu-user-static <8.0.0 and automatially loaded. The wsl config mentioned above did not prevent this.
From version 8.0.0 onwards, the qemu files for binfmt are stored in /usr/lib/binfmt.d/ (e.g. qemu-aarch64.conf) in a .conf format. Usually, these are auto-loaded/enabled by systemd-binfmt.service on boot time. However, since systemd-binfmt.service.d/wsl.conf prevents this auto-load on boot, qemu-user-static is not functional anymore on WSL-Ubuntu (Ubuntu 23.10 and 24.04 have qemu versions >=8.0.0)

The config files /usr/lib/systemd/system/systemd-binfmt.service.d/wsl.conf as well as /etc/systemd/system/systemd-binfmt.service.d/00-wsl.conf prevent systemd-binfmt.service from starting.

How to reproduce

  1. On WSL Ubuntu 23.10 or 24.04, install qemu-user-static and binfmt-support
  2. Try sudo update-binfmts --enable qemu-aarch64
  3. See error: update-binfmts: warning: qemu-aarch64 not in database of installed binary formats

Expected behaviour (like it was in Ubuntu 22.04):

  1. On WSL Ubuntu 22.04, install qemu-user-static and binfmt-support
  2. Try sudo update-binfmts --enable qemu-aarch64
  3. See qemu-aarch64 enabled with sudo update-binfmts --display
@rklasen
Copy link

rklasen commented Nov 18, 2024

I can confirm this bug, under WSL with Ubuntu 24.04, I get the error update-binfmts: warning: qemu-aarch64 not in database of installed binary formats.

@jibel jibel added the bug Something isn't working label Nov 18, 2024
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