Questions tagged [binfmt]

binfmt_misc is a Linux kernel component that allows it to run foreign executables directly (Windows, Java, …)

binfmt_misc is a component of the Linux kernel that allows user-space programs to be registered as handlers for extra file formats. For example, wine can be registered for Windows executables, java for Java bytecode executable, etc.

If available, the binfmt facility is exposed through /proc/sys/fs/binfmt_misc (the normal mount point for the special binfmt_misc filesystem).

Most distributions for non-embedded Linux system activate binfmt_misc, usually as a kernel module. Handlers can be registered by writing to /proc/sys/fs/binfmt_misc/register, or with distribution-provided tools such as update-binfmts and the /var/lib/binfmts directory on Debian and derivatives (including Ubuntu).

External links

15 questions
5
votes
1 answer

What kinds of executable formats do the files under /proc/sys/fs/binfmt_misc/ allow?

I following Michael's reply to see what executable formats my Ubuntu can recognize to execute $ ls -l /proc/sys/fs/binfmt_misc/ total 0 -rw-r--r-- 1 root root 0 Apr 19 16:11 cli -rw-r--r-- 1 root root 0 Apr 19 16:11 jar -rw-r--r-- 1 root root 0 Apr…
Tim
  • 98,580
  • 191
  • 570
  • 977
4
votes
1 answer

systemd failure on binfmt services

Systemd has several failed services, and I don't know how to work it out: # systemctl --failed UNIT LOAD ACTIVE SUB JOB DESCRIPTION proc-sys-fs-binfmt_misc.automount loaded failed failed Arbitrary Executable…
daisy
  • 53,527
  • 78
  • 236
  • 383
3
votes
1 answer

No /proc/sys/fs/binfmt_misc/CLR on my system?

I run docky which is programmed with mono so I think the binfmt is running correctly, but proc-sys-fs-binfmt_misc.automount complains about it, since I don't have /proc/sys/fs/binfmt_misc/CLR I already have CONFIG_BINFMT_MISC=y in my kernel config.
daisy
  • 53,527
  • 78
  • 236
  • 383
3
votes
0 answers

Cross-arch Docker container will stop emulation

I'm trying to build a portable cross-arch Docker container using QEMU. However, depending on the host system and the programs installed on the host the container behaves differently. Running the container on Windows, the emulation works fine. It…
Areopag
  • 31
  • 3
2
votes
1 answer

Is there a more proper place than /etc/rc.local for writing to configure binfmt?

I want to be able to run clr (>NET/mono) exes on my redhat machines, so I add the following to /etc/rc.local: echo ':CLR:M::MZ::/opt/mono-head/bin/mono:' > /proc/sys/fs/binfmt_misc/register This works fine, but is there a more appropriate config…
Justin Dearing
  • 1,391
  • 3
  • 13
  • 26
1
vote
1 answer

Why don't binfmt_misc with flags "OC", when it works without any flags?

I have been testing binfmt_misc feature of Linux on Debian 10, and have found that setting the flags to "OC", to use the credentials of the binary instead of interpreter, causes execution to fail silently. In the POC below, /tmp/test.sh is the…
Shuzheng
  • 4,023
  • 1
  • 31
  • 71
1
vote
0 answers

What could cause slow binfmt-support.service during boot?

I have a Fujitsu LifeBook with Lubuntu 18.04.2 which is booting very slow. Here's the output from systemd-analyze blame | head -n20 28.869s systemd-journal-flush.service 24.957s dev-sda1.device 14.620s apparmor.service 14.558s…
sondra.kinsey
  • 216
  • 2
  • 15
1
vote
1 answer

Qemu with binfmt in chroot

I have downloaded some firmware and I want to run some commands in it. I have extracted the firmware, installed qemu and configured binfmts. The problem is that binfmt does not work in the chroot. Mipsel files are automatically executed by…
Sjoerd
  • 431
  • 5
  • 10
1
vote
0 answers

Installing qemu-user-static and binfmt-support inside an LXC

I'd like to run armhf executables inside an amd64 LXC container. How to do that? update-binfmts --display shows no qemu interpreters.
Velkan
  • 501
  • 1
  • 5
  • 15
0
votes
0 answers

Last execution time of executables in a particular folder

I plan on creating a script which would help me with detecting long-time unused manually installed packages. For this, it would be neat though if I had a way of finding out the executed time for each executable under, e.g. /usr/bin/,…
phk
  • 5,893
  • 7
  • 41
  • 70
0
votes
1 answer

How can I make registered extensions for `binfmt_misc` persist across reboots?

How can I make registered extensions for binfmt_misc persist across reboots? Consider the following command, which performs a binfmt_misc registration: echo ':golang:E::go::/tmp/test:OC' | sudo tee /proc/sys/fs/binfmt_misc/register It needs to be…
Shuzheng
  • 4,023
  • 1
  • 31
  • 71
0
votes
0 answers

How could I make the changes in `usr/include/linux/binfmts.h` file make effect?

I have Ubuntu server that is running Linux 4.15.0-1082-azure. I updated the usr/include/linux/binfmts.h file in order to increase the size of argument list. I changed the MAX_ARG_PAGES. I need to recompile, install and reboot into the new kernel…
aga.91
  • 13
  • 3
0
votes
1 answer

Steam Proton stopped working on Ubuntu 18.04.2 LTS

Ubuntu 18.04.2 LTS on AMD64 with Steam client now at version Feb 18 2019, package 1550534751. Yesterday, I could play Steam Play games (Windows games with the Proton fork of Wine) just fine on my machine. I rebooted, and Steam updated itself, and…
Jon Watte
  • 169
  • 2
  • 8
0
votes
0 answers

Is `/usr/lib/binfmt-support/run-detectors` supposed to choose mono or wine to run a windows or .net executable?

On Lubuntu 18.04, Is /usr/lib/binfmt-support/run-detectors supposed to choose mono or wine to run a windows or .net executable? $ cat /proc/sys/fs/binfmt_misc/cli enabled interpreter /usr/lib/binfmt-support/run-detectors flags: offset 0 magic…
Tim
  • 98,580
  • 191
  • 570
  • 977
0
votes
1 answer

Detect CLI or Wine executable in Manjaro

In my Linux Mint installation, I can directly execute a PE executable at the command line, and if it's a .NET/CLI executable, then it will automatically execute it with Mono, and otherwise, it will automatically execute it with Wine. This works…
P Daddy
  • 365
  • 3
  • 10