| BOX64(1) | Manual | BOX64(1) |
box64 - Linux Userspace x86_64 Emulator with a twist
box64 [--help] [--version] executable
Box64 lets you run x86_64 Linux programs (such as games) on non-x86_64 Linux systems, like ARM (host system needs to be 64-bit little-endian). Since Box64 uses the native versions of some "system" libraries, like libc, libm, SDL, and OpenGL, it's easy to integrate and use with most applications, and performance can be surprisingly high in many cases. Box64 integrates with DynaRec (dynamic recompiler) for the ARM64 platform, providing a speed boost between 5 to 10 times faster than using only the interpreter.
There are many environment variables to control Box64's behaviour. In addition to environment variables, Box64 also looks for 2 places for rcfile: /etc/box64.box64rc and ~/.box64rc, in the format of .ini files. Settings priority: ~/.box64rc > /etc/box64.box64rc > environment variables. Example:
[factorio]
BOX64_DYNAREC_SAFEFLAGS=0
BOX64_DYNAREC_BIGBLOCK=2
BOX64_DYNAREC_FORWARD=1024
BOX64_DYNAREC_CALLRET=1
* XXXX : Add library XXXX to the needed libraries list.
* XXXX:YYYY:ZZZZ : Add library XXXX, YYYY and ZZZZ to the needed libraries list.
* 0 : Do not allow missing libraries. [Default]
* 1 : Allow missing libraries.
* XXXX : Pass argument XXXX to the program.
* XXXX YYYY ZZZZ : Pass arguments XXXX, YYYY and ZZZZ to the guest program.
* XXXX : Use bash executable at path XXXX.
* 0 : Does nothing. [Default]
* 1 : Add -cef-disable-gpu argument to the guest program.
* 0 : Does nothing. [Default]
* 1 : Add -cef-disable-gpu-compositor argument to the guest program.
* 0 : Emulate a Intel CPU Model. [Default]
* 1 : Emulate a AMD CPU Model.
* 0 : Use emulated crashhandler.so library if nedded.
* 1 : Use an internal dummy (empty) crashhandler.so library. [Default]
* 0 : Disable the logging of dlsym errors. [Default]
* 1 : Enable the logging of dlsym errors.
* 0 : Do not dump elfloader debug information. [Default]
* 1 : Dump elfloader debug information.
* 0 : Generate unaligned atomics handling code. [Default]
* 1 : Generate aligned atomics only, which is faster and smaller code size, but will cause SIGBUS for LOCK prefixed opcodes operating on aligned data addresses.
* 0 : Do not try to build block as big as possible, suitable for programs using lots of threads and JIT, like Unity.
* 1 : Build Dynarec block as big as possible.
* 2 : Build Dynarec block bigger, do not stop when block overlaps, but only for blocks in elf memory. [Default]
* 3 : Build Dynarec block bigger, do not stop when block overlaps, for all type of memory, useful for wine programs.
* 0 : Do not detect MonoBleedingEdge.
* 1 : Detect MonoBleedingEdge and apply BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_STRONGMEM=1 when detected. [Default]
* 0 : Do not optimize CALL/RET, use jump table. [Default]
* 1 : Try to optimize CALL/RET, skipping the jump table when possible.
* 0 : Disable the use of deferred flags.
* 1 : Enable the use of deferred flags. [Default]
* 0 : Do not allow continue running a block that is unprotected and potentially dirty. [Default]
* 1 : Allow continue to run a dynablock that write data in the same page as code. It can gets faster in loading time of some game but can also get unexpected crashes.
* 0 : Do not generate thr division-by-zero exception. [Default]
* 1 : Generate the division-by-zero exception.
* 0 : Do not dump DynaRec blocks. [Default]
* 1 : Dump DynaRec blocks.
* 2 : Dump DynaRec blocks with some colors.
* 0 : Precisely emulate the -NaN generation like on x86.
* 1 : Do not do anything special with -NAN generation, faster. [Default]
* 0 : Generate float/double -> int rounding and use current rounding mode for float/double computation like on x86.
* 1 : Do not do anything special with edge case rounding, faster. [Default]
* 2 : Generate float/double -> int rounding using current rounding mode for float/double computation like on x86, but use fast int -> float/double conversion.
* 0 : No forward value. When current block ends, do not try to go further even if there are previous forward jumps.
* 128 : Allow up to 128 bytes of gap between end of the block and the next forward jump. [Default]
* XXXX : Allow up to XXXX bytes of gap between end of the block and the next forward jump.
* 0 : Dynarec will not generate GDBJIT debuginfo. [Default]
* 1 : Dynarec will generate GDBJIT debuginfo.
* 2 : Dynarec will generate detailed GDBJIT debuginfo with internal state.
* 0 : Disable DynaRec logs. [Default]
* 1 : Enable minimal DynaRec logs.
* 2 : Enable debug level DynaRec logs.
* 3 : Enable verbose level DynaRec logs.
* 0 : Do not print the missing opcode. [Default]
* 1 : Print missing opcodes.
* 2 : Print the fallback to scalar opcodes, only valid on RISC-V.
* 0 : Do not use native flags.
* 1 : Use native flags when possible. [Default]
* 0 : Ignore x86 PAUSE instruction. [Default]
* 1 : Use YIELD to emulate x86 PAUSE instruction.
* 2 : Use WFI to emulate x86 PAUSE instruction.
* 3 : Use SEVL+WFE to emulate x86 PAUSE instruction.
* 0 : Dynarec will not generate perf map. [Default]
* 1 : Dynarec will generate perf map.
* 0 : Treat CALL/RET as if it never needs any flags.
* 1 : Most of RETs will need flags, most of CALLs will not. [Default]
* 2 : All CALL/RET will need flags.
* 0 : Do not try anything special. [Default]
* 1 : Enable some memory barriers when writing to memory to emulate the x86 strong memory model in a limited way.
* 2 : All in 1, plus memory barriers on SIMD instructions.
* 3 : All in 2, plus more memory barriers on a regular basis.
* 0 : Do not detect libtbb.
* 1 : Detect libtbb and apply conservative settings. [Default]
* 0 : No comparison. [Default]
* 1 : Each opcode runs on interpreter and on Dynarec, regs and memory are compared and printed when they differ.
* 0xXXXXXXXX-0xYYYYYYYY : Define the range where dynarec is tested (inclusive-exclusive).
* 0 : Do not trace DynaRec blocks. [Default]
* 1 : Trace DynaRec blocks, will slow down the program a lot and generates huge logs.
* 0 : Do not wait and use interpreter instead, might speedup a bit on massive multithread or JIT programs.
* 1 : Wait for a DynaRec code block to be ready. [Default]
* 0 : Use regular safe barrier.
* 1 : Use weak barriers to have more performance boost. [Default]
* 2 : All in 1, plus disabled the last write barriers.
* 0 : Try to use float when possible for x87 emulation. [Default]
* 1 : Only use Double for x87 emulation.
* XXXX : Force the use of emulated library XXXX.
* XXXX:YYYY:ZZZZ : Force the use of emulated libraries XXXX, YYYY and ZZZZ.
* XXXX=yyyy : Add environment variable XXXX with value yyyy.
* XXXX=yyyy : Add environment variable XXXX with value yyyy.
* 0 : Does nothing. [Default]
* 1 : Just exit.
* 0 : Do not fix 64bit inodes. [Default]
* 1 : Fix 64bit inodes.
* 0 : Trigger a TRAP signal if a handler is present. [Default]
* 1 : Skip the opcode silently.
* XXXX : Prepend argument XXXX to the program.
* XXXX YYYY ZZZZ : Prepend arguments XXXX, YYYY and ZZZZ to the guest program.
* 0 : Does nothing. [Default]
* 1 : Add --in-process-gpu argument to the guest program.
* 0 : Just print the message when the signal is caught. [Default]
* 1 : Launch gdb when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process and go in an endless loop, waiting. Inside gdb, you need to find the correct thread yourself (the one with `my_box64signalhandler` in is stack), then probably need to `finish` 1 or 2 functions (inside `usleep(..)`) and then you'll be in `my_box64signalhandler`, just before the printf of the Segfault message. Then `set waiting=0` to exit the infinite loop.
* 2 : Launch gdbserver when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process, and go in an endless loop, waiting. Use `gdb /PATH/TO/box64` and then `target remote 127.0.0.1: 1234` to connect to the gdbserver (or use actual IP if not on the machine). After that, the procedure is the same as with `BOX64_JITGDB=1`.
* 3 : Launch lldb when a SIGSEGV, SIGILL or SIGBUS signal is trapped, attached to the offending process and go in an endless loop, waiting.
* 0 : Does nothing.
* 1 : Detect libjvm, and apply BOX64_DYNAREC_BIGBLOCK=0 BOX64_DYNAREC_STRONGMEM=1 BOX64_SSE42=0 when detected. [Default]
* XXXX : Add path XXXX to the library path.
* XXXX : Force the loading of library XXXX.
* XXXX:YYYY : Force the loading of libraries XXXX and YYYY.
* 0 : Does nothing.
* 1 : Detect libcef, and apply BOX64_MALLOC_HACK=2 if detected. [Default]
* libXXXX : Set the name for libGL to libXXXX.
* /path/to/libXXXX : Set the name and path for libGL to /path/to/libXXXX, you can also use SDL_VIDEO_GL_DRIVER.
* 0xXXXXXXXX : Set the address where the program is loaded.
* 0 : Disable Box64 logs. [Default]
* 1 : Enable minimal Box64 logs.
* 2 : Enable debug level Box64 logs.
* 3 : Enable verbose level Box64 logs.
* 0 : Don't allow malloc operator to be redirected, rewriting code to use regular function. [Default]
* 1 : Allow malloc operator to be redirected.
* 2 : Like 0, but track special mmap/free (some redirected functions are inlined and cannot be redirected).
* 0 : Use the actual number of CPU cores. [Default]
* XXXX : Use XXXX CPU cores.
* 0 : Show the Box64 banner. [Default]
* 1 : Do not show the Box64 banner.
* 0xXXXXXXXX-0xYYYYYYYY : Define the range where dynablock creation is forbidden (inclusive-exclusive).
* 0 : Load wrapped GTK libraries. [Default]
* 1 : Do not load wrapped GTK libraries.
* 0 : Load PulseAudio libraries. [Default]
* 1 : Do not load PulseAudio libraries.
* 0 : Load rc files. [Default]
* 1 : Do not load any rc files.
* 0 : Does nothing. [Default]
* 1 : Add --no-sandbox argument to the guest program.
* 0 : Let the x86 program set sighandler for SIGSEGV. [Default]
* 1 : Disable the handling of SIGSEGV.
* 0 : Let the x86 program set sighandler for SIGILL. [Default]
* 1 : Disable the handling of SIGILL.
* 0 : Load Vulkan libraries. [Default]
* 1 : Do not load Vulkan libraries, both native and x86_64.
* XXXX : Add path XXXX to the binary path.
* 0 : Prefer native libraries over emulated ones. [Default]
* 1 : Prefer emulated libraries over native ones.
* 0 : Prefer libs with absolute path over wrapped ones. [Default]
* 1 : Prefer wrapped libs first even if the lib is specified with absolute path.
* XXXX : Load the rc file XXXX, default rc files will not be loaded.
* 0 : Use hardware counter for rdtsc opcode if available. [Default]
* 1 : Use hardware counter for rdtsc if and only if precision is at least 1GHz.
* 0 : Do not reserve high memory area for the program. [Default]
* 1 : Reserve high memory area for the program.
* 0 : Does nothing. [Default]
* 1 : Show last 16 wrapped function call when a signal is caught.
* XXX : Show last XXX wrapped function call when a signal is caught.
* 0 : Does nothing. [Default]
* 1 : Use a workaround for SDL_GetJoystickGUIDInfo function for wrapped SDL2.
* 0 : Do not expose SHAEXT capabilities.
* 1 : Expose SHAEXT capabilities. [Default]
* 0 : Does nothing. [Default]
* 1 : Show native and emulated backtrace when a signal is caught.
* 0 : Does nothing. [Default]
* 1 : Always show SIGSEGV signal detailes.
* 0 : Just track the flag. [Default]
* 1 : Apply SSE Flush to 0 flag directly.
* 0 : Do not expose SSE4.2 capabilities.
* 1 : Expose SSE4.2 capabilities. [Default]
* 0 : Do not synchronize rounding mode. [Default]
* 1 : Synchronize rounding mode between x86 and native.
* 0 : Disable colored trace output. [Default]
* 1 : Enable colored trace output.
* 0 : Disable EMM trace output. [Default]
* 1 : Enable EMM trace output.
* XXXX : Send all log and trace to file XXXX.
* XXXX%pid : Send all log and trace to file XXXX with pid appended.
* stderr : Send all log and trace to `stderr`.
* 0 : Disable trace output. [Default]
* 1 : Enable trace output. Trace starts before the initialization of dependencies.
* 0 : Start trace immediately. [Default]
* 1 : Start trace after 1 opcode executed.
* XXXX : Start trace after XXXX opcodes executed.
* 0 : Disable XMM trace output. [Default]
* 1 : Enable XMM trace output.
* 0 : Disable trace output. [Default]
* 1 : Enable trace output.
* symbolname : Enable trace output for `symbolname` only.
* 0xXXXXXXX-0xYYYYYYY : Enable trace output for the range of address (inclusive-exclusive).
* 0 : Does nothing.
* 1 : Detect UnityPlayer, and apply BOX64_DYNAREC_STRONGMEM=1 when detected. [Default]
* 0 : Prefer emulated libs for EGL and GLESv2. [Default]
* 1 : Prefer wrapped libs for EGL and GLESv2.
* 0 : Do not force Xorg GLX extension to be present. [Default]
* 1 : Require Xorg GLX extension when using XQueryExtension.
* 0 : Do not force synchronized operation on X11 display. [Default]
* 1 : Force synchronized operation on X11 display.
* 0 : Do not call XInitThreads. [Default]
* 1 : Call XInitThreads as soon as libX11 is loaded.
* 0 : Try to handle 80bits long double as precise as possible. [Default]
* 1 : Use 64bits double for x87.
| 2025-04-24 | box64 0.3.4+dfsg |