Binfmt misc

binfmt_misc (Miscellaneous Binary Format) is a capability of the Linux kernel which allows arbitrary executable file formats to be recognized and passed to certain user space applications, such as emulators and virtual machines. It is one of a number of binary format handlers in the kernel that are involved in preparing a user-space program to run.

The executable formats are registered through the special purpose file system binfmt_misc file-system interface (usually mounted under part of /proc). This is either done directly by sending special sequences to the register procfs file or using a wrapper like Debian-based distributions binfmt-support package or systemd's systemd-binfmt.service.

Registration

An executable file type can be added by writing a line to the register file, of the form:

:name:type:offset:magic:mask:interpreter:flags

Each format has a corresponding file entry in the /proc/sys/fs/binfmt_misc directory which can be read to get information about a given file format, or written to disable, enable or deregister it.

Deregistration

$ echo -1 >/proc/sys/fs/binfmt_misc/status # all entries
$ echo -1 >/proc/sys/fs/binfmt_misc/qemu-xtensa # single entry

Common usage

References

  1. ↑ Kernel Support for miscellaneous Binary Formats (binfmt_misc) The Linux Kernel documentation
  2. ↑ How programs get run, January 28, 2015, by David Drysdale, LWN.net
  3. ↑ Details of package binfmt-support in sid, Debian
  4. ↑ systemd-binfmt.service, freedesktop.org
  5. ↑ binfmt.d, freedesktop.org
  6. ↑ https://docs.kernel.org/admin-guide/binfmt-misc.html
  7. ↑ Java Binary Kernel Support for Linux v1.03 The Linux Kernel documentation
  8. ↑ Mono Binary Kernel Support for Linux The Linux Kernel documentation
  9. ↑ Guide:Running Mono Applications
  10. ↑ Official QEMU mirror, QEMU, 23 November 2022
  11. ↑ Using Go as a scripting language in Linux, Cloudflare, 2018-02-20, retrieved 2019-05-05
  12. ↑ "Appimage - NixOS Wiki". nixos.wiki. Retrieved 2025-11-27.