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.
This project provides binaries built via GitHub Actions which can be downloaded from the Releases page.
-
Download the shared library for the required architecture. This command downloads the
x86_64
build of the library from the latest release. There are alsox86
andaarch64
builds.curl --location --remote-name https://github.com/jwillikers/unity-single-instance-fix/releases/latest/download/libunity-single-instance-fix-x86_64.so
-
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%
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.
-
Install an implementation of Nix, such as Lix used here.
curl -sSf -L https://install.lix.systems/lix | sh -s -- install
-
Clone the source code of this repository locally.
git clone https://github.com/jwillikers/unity-single-instance-fix.git
-
Then change into the project directory.
cd unity-single-instance-fix
-
Install direnv for your system according to the direnv installation instructions.
sudo rpm-ostree install direnv sudo systemctl reboot
-
Integrate direnv with your shell by following the instructions on the direnv Setup page.
-
Permit the direnv configuration in the repository.
direnv allow
-
Build the shared library with Nix or the just command runner.
- Nix
-
nix build
- just
-
just
Contributions in the form of issues, feedback, and even pull requests are welcome. Make sure to adhere to the project’s Code of Conduct.
This project is built on the hard work of countless open source contributors. Several of these projects are enumerated below.
The project’s Code of Conduct is available in the Code of Conduct file.
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