-
Notifications
You must be signed in to change notification settings - Fork 822
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
binfmt_misc/binfmt-support not working as expected #7181
Comments
Since WSL doesn't run systemd / init scripts the qemu binfmt interpreter will have to be re-registered when you restart your VM. I believe there is probably a script you can run to accomplish this, but I'm not familiar. |
@benhillis Good catch. I'd missed the Systemd reference. Looking in Running: sudo update-binfmts --enable Seems to have fixed it! Thanks! This leads to the bigger question I guess. How to make it so I don't need to run |
@cinderblock in general you can use commands like I'll close this issue out for our bookkeeping since it looks like you're resolved and this can be accrued to the feature of adding systemd support to WSL! Thanks for filing! |
Related to #994 |
@Ferroin I made extensive changes to the document not because I thought it was too bad or anything, but to align with the structure that I am trying to build for certain topic types. Because of these extensive changes, I tried to preserve the technical correctness to the best of my abilities, but please read the whole thing once more to check if everything's still correct. Please look extra careful in these places: * Line 58: Docker run command * Finding build logs list items. * Line 86: I'm not entirely happy with "Permanent storage". Happy about suggestions. Regarding your remark about binfmt\_misc support on WSL: microsoft/WSL#7181 This issue has been closed, so assume that WSL has that feature at least inbuilt. If it works reliably is a different story. :) For Docker: I found this package after a quick Google search: https://hub.docker.com/r/tonistiigi/binfmt Does it help Docker Desktop users? I am happy to discuss any changes you don't agree with.
I realize this bug is closed but I wanted to document a related failure mode: after installing
I'm guessing something in the install process of these packages removes the WSLInterop entry. Rebooting fixes WSL but you're still left with the QEMU problem that Did anyone file a bug with the upstream QEMU packages? I'm not even sure it's appropriate; they rely on systemd to work and systemd just isn't present here. It seems like a general limitation of WSL. |
I'm suffering the same problem. There's no Configurations of
|
Edit: see #8843 (comment) (which appears to be the issue this problem is getting redirected to more consistently) I think this is due to https://github.com/systemd/systemd/blob/b9b0f338be2f63af96d295e4eaf9e8a8889190bb/src/binfmt/binfmt.c#L246-L251 -- effectively, I used |
I use Details
Steps to Enable Systemd in WSL2
Additional NoteThe |
Windows Build Number
Microsoft Windows [Version 10.0.19043.1110]
WSL Version
Kernel Version
Linux version 5.4.72-microsoft-standard-WSL2 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Wed Oct 28 23:40:43 UTC 2020
Distro Version
Ubuntu 20.04
Other Software
qemu
qemu-user-static
binfmt-support
Repro Steps
I don't know what I did to get my system into this state. It was working fine. I think I rebooted with a Windows Update, but not sure.
Expected Behavior
/proc/sys/fs/binfmt_misc/
to be filled withqemu-*
files. Like this:cameron@uberfall:~$ ls -l /proc/sys/fs/binfmt_misc/ total 0 -rw-r--r-- 1 root root 0 Jun 24 09:01 python2.7 -rw-r--r-- 1 root root 0 Jul 1 06:07 python3.8 -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-aarch64 -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-alpha -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-arm -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-armeb -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-cris -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-hppa -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-m68k -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-microblaze -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-mips -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-mips64 -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-mips64el -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-mipsel -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-mipsn32 -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-mipsn32el -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-ppc -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-ppc64 -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-ppc64abi32 -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-ppc64le -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-riscv32 -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-riscv64 -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-s390x -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-sh4 -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-sh4eb -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-sparc -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-sparc32plus -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-sparc64 -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-xtensa -rw-r--r-- 1 root root 0 Jun 24 09:01 qemu-xtensaeb --w------- 1 root root 0 Jul 1 06:07 register -rw-r--r-- 1 root root 0 Jul 1 06:07 status
Actual Behavior
$ ls -l /proc/sys/fs/binfmt_misc/ total 0
Diagnostic Logs
Fresh boot of wsl (after
wsl --shutdown
)cameron@Nook:~$ uptime -p up 0 minutes
Some
binfmt
is loaded, missing qemu.cameron@Nook:~$ ls -l /proc/sys/fs/binfmt_misc/ total 0 -rw-r--r-- 1 root root 0 Jul 14 15:09 WSLInterop --w------- 1 root root 0 Jul 14 15:09 register -rw-r--r-- 1 root root 0 Jul 14 15:09 status
It is mounted as expected
cameron@Nook:~$ mount | grep binfmt binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
Cleaning installed version (with
RUNLEVEL=1
fix for runlevel detection)No
binfmt
(as expected)cameron@Nook:~$ ls -l /proc/sys/fs/binfmt_misc/ total 0
Not mounted either (as expected)
cameron@Nook:~$ mount | grep binfmt
Reinstall (with
RUNLEVEL=1
fix for runlevel detection)Still empty 😕
cameron@Nook:~$ ls -l /proc/sys/fs/binfmt_misc/ total 0
Not mounted 😕
cameron@Nook:~$ mount | grep binfmt
umount
fails... now duringapt reinstall ...
.I have also tried reinstalling
qemu
andqemu-user-static
.Related
The text was updated successfully, but these errors were encountered: