Skip to content

jwillikers/unity-single-instance-fix

Repository files navigation

Unity Single Instance Fix

CI

A fix for the Unity single instance issue on Linux that effects old Unity games. The problem and fix are documented in Eike Sauer’s blog post Fix for old Unity games for Linux not starting anymore. This repository just provides prebuilt binaries for the fix so that you don’t have to compile them yourself.

Usage

This project provides binaries built via GitHub Actions which can be downloaded from the Releases page.

  1. Download the shared library for the required architecture. This command downloads the x86_64 build of the library from the latest release. There are also x86 and aarch64 builds.

    curl --location --remote-name https://github.com/jwillikers/unity-single-instance-fix/releases/latest/download/libunity-single-instance-fix-x86_64.so
  2. Add the shared library to LD_PRELOAD path when running the game.

    Command-line
    LD_PRELOAD=/path/to/libunity-single-instance-fix-x86_64.so ./game.x86_64
    Steam launch command
    LD_PRELOAD=/path/to/libunity-single-instance-fix-x86_64.so %command%

Develop

For compatibility with glibc, the GitHub Actions builds use the oldest supported Linux runners. For development, Nix is used for reproducibility. Nix is used to manage all of the necessary dependencies. The nix develop command can be used to enter or run commands in an environment with all of the necessary dependencies. For convenience, direnv can be used to automatically load this environment when entering the project’s directory. The mkhl.direnv VSCode extension integrates this environment in VSCode for development. Nix also generates the configuration for pre-commit, which automates formatting and various checks when committing changes.

  1. Install an implementation of Nix, such as Lix used here.

    curl -sSf -L https://install.lix.systems/lix | sh -s -- install
  2. Clone the source code of this repository locally.

    git clone https://github.com/jwillikers/unity-single-instance-fix.git
  3. Then change into the project directory.

    cd unity-single-instance-fix
  4. Install direnv for your system according to the direnv installation instructions.

    sudo rpm-ostree install direnv
    sudo systemctl reboot
  5. Integrate direnv with your shell by following the instructions on the direnv Setup page.

  6. Permit the direnv configuration in the repository.

    direnv allow
  7. Build the shared library with Nix or the just command runner.

    Nix
    nix build
    just
    just

Contributing

Contributions in the form of issues, feedback, and even pull requests are welcome. Make sure to adhere to the project’s Code of Conduct.

Open Source Software

This project is built on the hard work of countless open source contributors. Several of these projects are enumerated below.

Code of Conduct

The project’s Code of Conduct is available in the Code of Conduct file.

License

This repository is licensed under the MIT license, available in the license file. The C code is from Eike Sauer’s blog post Fix for old Unity games for Linux not starting anymore and is licensed under CC BY-NC-SA.

© 2025 Jordan Williams

Authors

About

A fix for the Unity single instance issue on Linux that effects old Unity games.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •