Installing Miscellaneous Binary Format (binfmts)
Install binfmts
The binfmt_misc kernel module, contained in versions 2.1.43 and later of the Linux kernel,
allows system administrators to register interpreters for various binary formats based on
a magic number or their file extension, and cause the appropriate interpreter to be invoked
whenever a matching file is executed.
Install Qemu
The package provides the user mode emulation, built statically. In this mode QEMU can launch Linux processes compiled for one CPU on another CPU.
The qemu-user-static package registers binary formats which the provided
emulators can handle, so that it will be possible to run foreign binaries directly.
Configure for aarch64 Architecture (arm64)
When not enabled already.
Check the registration which is in the kernel module and not in the binfmts database.
Execute ARM 64-bit binary using an environment variable to set the -L option for the underwater executed qemu-aarch64-static.
To make most needed arm libraries available install the package
gcc-aarch64-linux-gnu.
The shell command above is the same as the next command.
Configure for Windows x86-64 Architecture (Wine)
Package configuration
Install the package which also is will install dependency package binfmt-support.
Manual configuration
Install and enable execution of Windows 64-bit executables.
This how to remove the previous made registration.
Check the configuration
Check if wine is registered.
Executing local compiled binary
Execute the Windows executable adding the paths to find the needed dynamic libraries (DLL's).
WINEPATH='Z:\usr\x86_64-w64-mingw32\lib;Z:\usr\lib\gcc\x86_64-w64-mingw32\13-posix;lib' ./hello-world.exe
The shell command above is actually calling
WINEPATH='Z:\usr\x86_64-w64-mingw32\lib;Z:\usr\lib\gcc\x86_64-w64-mingw32\13-posix;lib' /usr/bin/wine hello-world.exe
The relative
libis a subdirectory of the directory wherehello-world.exeexecutable is in, to find a DLL.