Skip to content

binfmt_misc/binfmt-support not working as expected #7181

@cinderblock

Description

@cinderblock

Windows Build Number

Microsoft Windows [Version 10.0.19043.1110]

WSL Version

  • WSL 2
  • WSL 1

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.

sudo apt-get reinstall binfmt-support

Expected Behavior

/proc/sys/fs/binfmt_misc/ to be filled with qemu-* 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)

cameron@Nook:~$ sudo RUNLEVEL=1 apt -y remove --purge binfmt-support
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  binfmt-support*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 246 kB disk space will be freed.
(Reading database ... 32683 files and directories currently installed.)
Removing binfmt-support (2.2.0-2) ...
 * Disabling additional executable binary formats binfmt-support                                                                                                                                                                [ OK ] 
Processing triggers for man-db (2.9.1-1) ...
(Reading database ... 32672 files and directories currently installed.)
Purging configuration files for binfmt-support (2.2.0-2) ...
Processing triggers for systemd (245.4-4ubuntu3.7) ...

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)

cameron@Nook:~$ sudo RUNLEVEL=1 apt install binfmt-support
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  binfmt-support
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/58.2 kB of archives.
After this operation, 246 kB of additional disk space will be used.
Selecting previously unselected package binfmt-support.
(Reading database ... 32670 files and directories currently installed.)
Preparing to unpack .../binfmt-support_2.2.0-2_amd64.deb ...
Unpacking binfmt-support (2.2.0-2) ...
Setting up binfmt-support (2.2.0-2) ...
Created symlink /etc/systemd/system/multi-user.target.wants/binfmt-support.service → /lib/systemd/system/binfmt-support.service.
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.7) ...

Still empty 😕

cameron@Nook:~$ ls -l /proc/sys/fs/binfmt_misc/
total 0

Not mounted 😕

cameron@Nook:~$ mount | grep binfmt

umount fails... now during apt reinstall ....

cameron@Nook:~$ sudo RUNLEVEL=1 apt reinstall binfmt-support
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/58.2 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 32683 files and directories currently installed.)
Preparing to unpack .../binfmt-support_2.2.0-2_amd64.deb ...
 * Disabling additional executable binary formats binfmt-support                                                                                                                                                                       umount: /proc/sys/fs/binfmt_misc: not mounted.
update-binfmts: warning: Couldn't unmount the binfmt_misc filesystem from /proc/sys/fs/binfmt_misc.
                                                                                                                                                                                                                                [ OK ]
Unpacking binfmt-support (2.2.0-2) over (2.2.0-2) ...
Setting up binfmt-support (2.2.0-2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.7) ...

I have also tried reinstalling qemu and qemu-user-static.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions