docs/USAGE.md
There are many environment variables to control Box64's behaviour, which will be listed below by category.
There are 2 types of Box64 builds: the Wine WOW64 build (WowBox64) and the regular Linux build. Beware only some of the environment variables are available in WowBox64.
In addition to environment variables, if you're using the regular Linux build, Box64 also looks for 2 places for rcfile by default: the system-wide /etc/box64.box64rc and user-specific ~/.box64rc.
While in WowBox64, the configuration file is checked at %USERPROFILE%/.box64rc only.
Settings priority follows this order (from highest to lowest): ~/.box64rc > /etc/box64.box64rc > environment variables.
Example configuration:
[factorio]
BOX64_DYNAREC_SAFEFLAGS=0
BOX64_DYNAREC_BIGBLOCK=2
BOX64_DYNAREC_FORWARD=1024
BOX64_DYNAREC_CALLRET=1
This configuration will apply the specified settings application-wide to any executable named factorio.
Wildcard Matching
Asterisks (*) can be used for basic pattern matching in application names. For instance, [*setup*] will match any program containing "setup" in its name. Note this implements simple wildcard matching rather than full regex support.
Custom Configuration File
The BOX64_RCFILE environment variable can specify an alternative configuration file instead of the default /etc/box64.box64rc.
Per-File Settings
Sections starting with / apply to specific files. For example:
[/d3d9.dll]
BOX64_DYNAREC_SAFEFLAGS=0
These settings will only affect the d3d9.dll file. This syntax also works for emulated Linux libraries, e.g., [/libstdc++.so.6].
Enable/disable the Dynamic Recompiler (a.k.a DynaRec). This option defaults to 1 if it's enabled in the build options for a supported architecture. Available in WowBox64.
Generate aligned atomics only (only available on Arm64 for now). Available in WowBox64.
Enable building bigger DynaRec code blocks for better performance. Available in WowBox64.
Optimize CALL/RET opcodes. Available in WowBox64.
Optimize CALL/RET further with Secondary Entry Points (SEP). Have no effect is CALLRET is not enabled Available in WowBox64.
Enable or disable the use of deferred flags. Available in WowBox64.
Allow continue running a block that is unprotected and potentially dirty.
Disable detection of hot page (where code is executed and data written at the same time).
Use alternative way to detect HotPages (legacy way).
Enable or disable fast NaN handling. Available in WowBox64.
Enable or disable fast rounding. Available in WowBox64.
Define max allowed forward value when building block. Available in WowBox64.
Enable or disable the use of native flags. Available in WowBox64.
Enable x86 PAUSE emulation, may help the performance of spinlocks. Available in WowBox64.
Purge dynablocks that haven't been executed recently, based on tick age threshold (BOX64_DYNAREC_PURGE_AGE).
Tick age threshold for dynablock purging (requires BOX64_DYNAREC_PURGE=1).
Behaviour of flags emulation on CALL/RET opcodes and other edge cases. Available in WowBox64.
Enable the emulation of x86 strong memory model. Available in WowBox64.
Use volatile metadata parsed from PE files, only valid for 64bit Windows games.
Wait or not for the building of a DynaRec code block to be ready. Available in WowBox64.
Tweak the memory barriers to reduce the performance impact by strong memory emualtion. Available in WowBox64.
Enable/disable the Dynamic Recompiler Cache (a.k.a DynaCache). This option defaults to 2 (to read cache if present but not generate any). DynaCache write file to home folder by default, and can grow without limit.
Set the folder for DynaCache files. Default is $XDG_CACHE_HOME/box64 or $HOME/.cache/box64 if $XDG_CACHE_HOME is not set.
Minimum size, in KB, for a DynaCache to be written to disk. Default size is 350KB
Force 32-bit compatible memory mappings on 64-bit programs that run 32-bit code (like Wine WOW64), can improve performance.
Forbid dynablock creation in the address range specified, helpful for debugging behaviour difference between Dynarec and Interpreter. Available in WowBox64.
Remove Architecture metatdata from Dynarec blocks (used on signal). Available in WowBox64.
Use hardware counter for rdtsc if available.
Arguments to pass to the guest program, only valid if there is no existing arguments.
Prepend arguments to the command line.
Add --in-process-gpu argument to the guest program.
Add --no-sandbox argument to the guest program.
Expose AES capabilities. Available in WowBox64.
Specify the architecture in rcfiles to which the current entry applies. This option only takes effect when used inside rcfiles.
arm64: Only apply current entry for AArch64.la64: Only apply current entry for LoongArch64.rv64: Only apply current entry for RISC-V.<empty>: Apply current entry for all architectures, will be replaced by more specific entries. [Default]Expose AVX extension to CPUID and cpuinfo file. Default value is 2 on Arm64 because it's fully implemented in DynaRec, 0 otherwise. Available in WowBox64.
Path to the bash executable.
Specify the CPU type to emulate. Available in WowBox64.
Use a dummy crash handler or not.
Detect MonoBleedingEdge and apply conservative settings (Linux only).
Enable or disable the generation of division-by-zero exception. Available in WowBox64.
Enable or disable libtbb detection.
Force the use of float/double for x87 emulation. Available in WowBox64.
Allow the use of Dynarec in Signal Handlers.
Just exit, do not try to run the program.
Fix 64bit inodes.
Force symbols from BOX64_LD_PRELOAD libraries to be resolved by RTLD_NEXT.
Ignore INT3 instructions.
Detect libjvm and apply conservative settings.
Detect libcef and apply BOX64_MALLOC_HACK settings.
Behaviour when hooking malloc operators.
Maximum CPU cores exposed. Available in WowBox64.
Do not load any rc files.
Path to look for x86_64 binaries.
Expose PCLMULQDQ capabilities. Available in WowBox64.
Predefined sets of environment variables with compatibility or performance in mind. Available in WowBox64.
Path to a python3 executable.
Path to the rc file to load.
Report Invariant TSC bit in CPUID for Intel CPU type.
Reserve high memory area for the program, always enabled on Box32.
Use a workaround for SDL_GetJoystickGUIDInfo function for wrapped SDL2.
Expose SHAEXT (a.k.a. SHA_NI) capabilities. Available in WowBox64.
Behaviour of SSE Flush to 0 flags. Also tracking SSE exception flags. Available in WowBox64.
Expose SSE4.2 capabilities. Available in WowBox64.
Force Vulkan for Linux Steam UI.
Synchronize rounding mode between x86 and native.
Detect UnityPlayer and apply conservative settings.
Games is a Unity one.
Force Xorg GLX extension to be present.
Force synchronized operation on X11 display.
Call XInitThreads when loading X11. This is mostly for old Loki games with the Loki_Compat library.
Behavoiur of x87 80bits long double. Available in WowBox64.
Enable or disable the logging of dlsym errors.
Dump elfloader debug information. Available in WowBox64.
Enable DynaRec dump. Available in WowBox64.
Dump DynaRec blocks in the specified range. Available in WowBox64.
The GDBJIT debugging support, only available on build with -DGDBJIT=ON, enable it with gdb command: jit-reader-load /usr/local/lib/libbox64gdbjitreader.so.
Disable or enable DynaRec logs. Available in WowBox64.
Print missing opcodes. Available in WowBox64.
Disable optional host extensions.
crc32,pmull,aes,atomics,sha1,sha2,uscat,flagm,flagm2,frintts,afp,rndr, LoongArch: lasx,lbt,frecipe,lam_bh,lamcas,scq, and RISC-V: zba,zbb,zbc,zbs,vector,xtheadba,xtheadbb,xtheadbs,xtheadmemidx,xtheadmempair,xtheadcondmov.Generate map file for Linux perf tool.
Enable DynaRec execution comparison with the interpreter, very slow, only for testing. Available in WowBox64.
Enable deduplication of IP address where COSIM find a difference. Available in WowBox64.
Do not dump test code when BOX64_DYNAREC_DUMP is enabled. Available in WowBox64.
Enable or disable DynaRec trace.
Launch gdb or not for SIGSEGV, SIGILL, and SIGBUS.
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.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.Set the address where the program is loaded, only active for PIE guest programs.
Enable or disable Box64 logs, default value is 0 if stdout is not terminal, 1 otherwise. Available in WowBox64.
Disable the Box64 banner. Available in WowBox64.
Remove NoDynarec range after a delay. Available in WowBox64.
Disable the handling of SIGSEGV.
Disable the handling of SIGILL.
Show last few wrapped function call when a signal is caught.
Show native and emulated backtrace when a signal is caught.
Always show SIGSEGV signal detailes.
Enable or disable colored trace output.
Enable or disable EMM (i.e. MMX) trace output.
Send all log and trace to a file instead of stdout.
stderr. [Default]stdout.Same as BOX64_TRACE but starts the trace immediately.
symbolname only. Trace starts before the initialization of dependencies.Start trace after N opcodes executed.
Enable or disable XMM (i.e. SSE) trace output.
Only available on box64 build with trace. Adds trace of all instructions executed, along with a register dump.
symbolname only.Add an environment variable.
Add an environment variable.
Add extras to the needed libraries list, rarely needed.
Allow missing libraries to be ignored.
Force the use of emulated libraries.
Path to look for x86_64 libraries.
Force loading libraries with the binary.
Set the name for libGL.
Do not load wrapped GTK libraries.
Do not load PulseAudio libraries (both native and x86_64).
Do not load Vulkan libraries.
Do not load x64 Vulkan overlay.
Prefer emulated libraries over native ones.
Prefer wrapped libs first even if the lib is specified with absolute path.
Prefer wrapped libs for EGL and GLESv2.