binfmt-dispatcher is a simple dispatcher for binfmt_misc that dynamically picks the best interpreter to use at runtime.
binfmt-dispatcher is packaged in Fedora as of Fedora Linux 40. It can be installed with:
$ sudo dnf install binfmt-dispatcher
which will automatically register it as a binfmt_misc handler via systemd and installer a basic configuration.
binfmt-dispatcher should be registered as a binfmt_misc handler. If using systemd, this is accomplished via binfmt.d (sample configs are provided for x86 and x86-64). It is recommended to prefix the config with zz-
or something akin to ensure it's parsed last, as systemd processes these in lexicographic order. After installing the config, remember to restart systemd-binfmt.service for it to take effect.
binfmt-dispatcher parses configuration from several sources:
- drop-in configs in
/usr/lib/binfmt-dispatcher.d/*.toml
/etc/binfmt-dispatcher.toml
- the running user XDG config (usually
$HOME/.config/binfmt-dispatcher/binfmt-dispatcher.toml
)
Configs are parsed in order and later settings win. A fully commented config is provided and should be fairly self-explanatory.
When run as an interpreter, binfmt-dispatcher will parse the configs, pick the best interpreter to use based on it and the binary being run, and then run it. If enabled (via the use_muvm
config setting), binfmt-dispatcher will use muvm to execute the interpreter in a microVM if the system page-size is not 4k.
This project is MIT licensed. See the LICENSE file for the full text of the license.