Home EmulatorsFEX-Emu Allows You to Run Your Favorite x86 and x86-64 Apps on ARM64 Linux Devices

FEX-Emu Allows You to Run Your Favorite x86 and x86-64 Apps on ARM64 Linux Devices

By sk
1.6K views 7 mins read

The computing devices constantly improves, and now powerful ARM-based devices run Linux better than ever before. But, many key applications still need the older x86 or x86-64 instruction sets. FEX-Emu is an innovative solution that bridges this gap. It provides a fast way to run x86 programs on ARM64 Linux systems.

In this blog post, we will explain how FEX works and why it is quickly becoming an important tool for the future of Linux gaming and productivity.

What Exactly is FEX?

FEX is an x86 and x86-64 userspace emulator built specifically for ARM64 Linux. This means it helps programs designed for Intel or AMD chips run successfully on hardware using ARM chips.

Think of FEX as a specialized, real-time translator. It translates instructions from one architecture (x86) so the host system (ARM64) can understand them. It supports compatibility for both 32-bit and 64-bit x86 binaries.

FEX-Emu provides an alternative to other tools like QEMU-user and Box64. Box64 also lets you run x86_64 Linux programs on non-x86 Linux systems, including RiSC-V or LoongArch.

How Does FEX Achieve High Speed?

FEX focuses on speed so users can enjoy real gaming performance. Therefore, it relies on several advanced technologies to reduce overhead and lag:

1. Binary Recompilation and Custom IR

FEX uses an advanced binary recompiler. This compiler supports modern x86 extensions, including SSE4.1, and plans exist for AVX and AVX2 support.

The core of this technology is a custom Intermediate Representation (IR). Using this custom IR allows FEX to generate more optimized code than older, traditional JIT (Just-in-Time) compilers.

FEX also uses JIT code caching and IR caching. This experimental code cache minimizes in-game stuttering as much as possible.

2. Library Forwarding (Thunking)

Emulating every single instruction creates massive overhead. Therefore, FEX avoids emulating common system tasks. It achieves this by supporting forwarding API calls.

The system forwards calls for graphics (like Vulkan or OpenGL) to the native host system libraries. Because the GPU is not an x86-64 CPU, the GPU code runs natively. Only the CPU code requires emulation. This efficient process greatly reduces emulation overhead.

3. System Call Translation

FEX includes a comprehensive system call translation layer. This layer handles differences between the emulated operating system and the host system. It even implements specialized features like seccomp. However, most system calls and ioctl() functions can pass straight through.

FEX for Gaming and the Industry

FEX is not just a niche project; it plays an important role in major industry strategies, especially in gaming.

Wine/Proton Integration

FEX-Emu works alongside Wine and/or Proton. This combination allows users to play Windows games on ARM64 Linux.

CodeWeavers, the company behind CrossOver (a productized version of Wine), has started incorporating FEX into their preview versions for ARM.

Furthermore, FEX's modular design lets it serve as a WoW64/ARM64EC backend within Wine environments.

Valve Sponsorship and the Steam Frame

Valve, the company that runs Steam, has devoted significant resources to FEX development. They sponsor the project. FEX is also used by the new Steam Frame, which is an ARM64 Snapdragon 8 Gen 3 device designed to run PC and PCVR gaming titles.

This commitment shows Valve's long-term interest in moving Linux gaming onto ARM architecture.

Please note that FEX is designed to run all x86 and x86-64 programs and applications on ARM64 Linux devices, not just games. But its development prioritizes the high performance and low latency required for demanding applications such as games.

Getting Started with FEX

FEX requires ARMv8.0+ hardware. Setting up FEX is straightforward on supported distributions, but it requires several components:

1. RootFS Requirement

An x86-64 RootFS is mandatory on AArch64 hosts. A RootFS provides the necessary file system structure for the emulated programs. You can download ready-made x86 images using the FEXRootFSFetcher tool.

2. Runtime Configuration (FEXConfig)

FEX provides a user-friendly, Qt-based GUI called FEXConfig. You use this application to manage settings. This system allows for per-application configuration. Users can tweak performance settings for specific games.

Configuration options to ensure you set include:

  • RootFS path.
  • Core: JIT.
  • Silent Logging (which helps remove information spam).
  • Block Size (500 is a good default).

3. Handling Complexity: Memory Models

When setting up FEX, you encounter the tricky x86 Total Store Ordering (TSO) memory model.

ARM systems use a weaker memory model. By default, FEX performs conservative TSO emulation, which can be computationally intensive. However, FEX has settings that allow you to weaken or disable TSO.

Disabling TSO favors performance, but you might risk incorrectness, which could cause a game crash. Newer Windows x86 binaries compiled with Microsoft's Visual Studio compiler 2019+ might contain helpful metadata that informs the emulator when TSO is truly needed.

You can read more about this in the link below:

Quick Start Installation (Ubuntu)

For Ubuntu versions 22.04, 24.04, 24.10, and 25.04, FEX developers have provided a quick installation method using a Python script.

To install FEX via this method, execute the following command in your terminal:

curl --silent https://raw.githubusercontent.com/FEX-Emu/FEX/main/Scripts/InstallFEX.py | python3

This script will do the following steps for you:

  1. Installing FEX through a PPA.
  2. Downloading a RootFS necessary for use with FEX. (The FEXRootFSFetcher tool can be used to install various x86 images).

If you are using a distribution other than the specified Ubuntu versions, or if you prefer to build FEX-Emu from source, please follow the Fex install guide on the official FEX-Emu Wiki.

Frequently Asked Questions (FAQ)

Q: What is FEX and what problem does it solve?

A: FEX-Emu is a fast userspace x86 and x86-64 emulator designed for ARM64 Linux devices. It solves the compatibility problem by allowing computer programs built for traditional Intel or AMD CPUs (x86 architecture) to run on modern ARM-based systems.

FEX provides backwards compatibility for AArch64, offers broad compatibility with both 32-bit and 64-bit binaries, and is designed to be fast enough for real gaming.

Q: What technical features make FEX fast and reduce lag?

A: FEX-Emu uses several advanced techniques to minimize performance overhead.

1. Binary Recompilation: It features an advanced binary recompiler that translates x86 instructions for the ARM64 host.

2. Custom IR: The recompiler uses a custom Intermediate Representation (IR) that allows it to generate more optimized code than a traditional JIT (Just-in-Time) compiler.

3. Caching: An experimental code cache and IR caching help to minimize in-game stuttering as much as possible.

4. Library Forwarding (Thunking): To avoid unnecessarily emulating common tasks, FEX supports forwarding API calls directly to native host system libraries, such as Vulkan or OpenGL, significantly reducing emulation overhead for graphics processing.

Q: Can FEX run Windows games on ARM Linux devices?

A: Yes, FEX can be used alongside Wine/Proton to play Windows games. Its modular core enables FEX to function effectively as a WoW64/ARM64EC backend within Wine environments.

Furthermore, a per-app configuration system allows users to tweak performance settings for specific games.

Q: Does FEX have major industry support?

A: Yes, FEX receives significant industry backing, particularly from the gaming sector:

1. Valve Sponsorship: Valve is sponsoring FEX. The technology is crucial for the new Steam Frame, an ARM64 Snapdragon 8 Gen 3 device designed to run PC and PCVR gaming titles.

2. CodeWeavers: CodeWeavers, the main corporate sponsor of Wine and developer of CrossOver, has started incorporating FEX into its preview versions for ARM to allow games like Cyberpunk 2077 to run.

Q: What are the primary prerequisites for using FEX?

A: To run FEX, you must meet two main hardware and software requirements:

Hardware: FEX requires ARMv8.0+ hardware.

RootFS: On AArch64 hosts, a x86-64 RootFS path is mandatory for running applications. Users can install various x86 images using the FEXRootFSFetcher tool.

Q: How does FEX compare to similar tools like Box64 or QEMU-User?

A: FEX-Emu, QEMU-user, and Box64 all share the core goal of allowing x86 programs to run on ARM64 Linux devices.

FEX focuses on high performance through its advanced binary recompiler and custom IR, which is designed to generate highly optimized code.

Box64 enables x86_64 Linux programs to run on non-x86 64-bit systems like ARM, RiSC-V, or LoongArch.

QEMU-user also performs userspace emulation by translating system calls, adjusting parameters, and handling POSIX signal redirection, similar to FEX.

However, FEX's architectural choices focus specifically on low-overhead execution for gaming workloads.

Conclusion

FEX-Emu offers powerful userspace x86 emulation, opening up massive compatibility potential for ARM64 Linux systems.

By using custom recompiler technology and aggressive library forwarding, FEX provides performance fast enough to enable real gaming.

Valve's sponsorship confirms FEX's role as a major component in the future of cross-platform gaming.

For more details, check the FEX-Emu GitHub repository.

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More