Grand Theft Auto IV: The Complete Edition

Grand Theft Auto IV: The Complete Edition

Not enough ratings
GTA Connected on Linux
By lightwo
Making the absolutely proprietary multiplayer mod work on Proton/Wine.
   
Award
Favorite
Favorited
Unfavorite
Guide Moved!
This guide has been moved here[blog.lightwo.net]

Read more
The Problem
Windows game mods aren't as straightforward on Linux, but luckily, it's only a matter of a few more steps in place of the usual process.

However, currently there is a bigger issue. Even though GTA Connected has "support for Windows XP and WINE"[gtaconnected.com], optimisations added to Proton/Wine over the years have caused issues getting it to work: namely, Fsync and Esync.

Related issue on GTA Connected issue tracker[bugs.gtaconnected.com]

Sadly, disabling these optimisations comes at a significant performance loss, however, it is required to make the mod playable as of the time of writing.

This guide goes over both the installation of GTA Connected itself and the workaround for the aforementioned issue.

Make sure to subscribe to the comment section of this guide and bookmark the issue page[bugs.gtaconnected.com] in order to know when the issue is fixed!
Setting up on Proton
  1. Download old binaries compatible with GTA Connected
  2. In your game library, right click the game > Manage > Browse local files
  3. Unpack the Retail directory from the downloaded archive into the game directory, as such (no files should be overwritten):
    GTAIV ├── GTAIV.exe (unmodified) ├── Retail │   ├── GTAIV.exe │   └── (other files) └── (other files)
  4. Install winetricks[wiki.winehq.org] and protontricks[github.com] to your system
    • Desktop system: Use your package manager if the packages are available on the repos or use install instructions from linked pages
    • SteamOS: Skip installing winetricks, use Flatpak-specific instructions[github.com] to install protontricks
  5. Download the latest GTA Connected client installer from the download section[gtaconnected.com] of the official website
  6. Run the installer
    • GUI method: Open a file manager, navigate to where the file was downloaded, then right click > Protontricks Launcher, and from the list, select Grand Theft Auto IV (12210)
    • CLI method: Change directory to where the file was downloaded, then (adjust file name to the downloaded version):
      protontricks-launch --appid 12210 GTAC-x.x.x.exe
  7. Either deselect "Run GTA Connected" in the installer, or close the client before proceeding
  8. Navigate here (replace <steam-library> with the path to the Steam library where the game is installed):
    <steam-library>/steamapps/compatdata/12210/pfx/drive_c/users/steamuser/AppData/Local/Jack's Mini Network/Grand Theft Auto Connected
  9. Set up a way to quickly launch GTA Connected
    • Shortcut method: Create a shortcut of Launcher.exe, name it "GTA Connected", and replace the Command field with this (TODO: check if disabling Fsync and Esync works):
      PROTON_NO_ESYNC=1 PROTON_NO_FSYNC=1 protontricks-launch --appid 12210 Launcher.exe
    • Shell script method: Make a script like this:
      #!/bin/sh # Path to the GTA Connected client cd "/path/to/Grand Theft Auto Connected" # Access violation workaround export PROTON_NO_ESYNC=1 export PROTON_NO_FSYNC=1 # Launching protontricks-launch --appid 12210 Launcher.exe
  10. Launch GTA Connected
  11. In the process of selecting your game executable, make sure to select GTAIV.exe stored in the Retail directory from earlier
  12. Play the game, hopefully it should work out of the box!
The Gist: Workaround Only
Provided that you already went through the procedure to install GTA Connected prior to reading the guide, and are greeted with the access violation error whenever you attempt to play on any server, all you need to know is that Fsync and Esync need to be disabled.

If you use Lutris, Bottles or another Wine prefix manager, there are most likely switches to disable Fsync and Esync you can use instead, however don't forget to toggle them back before playing the base game.

Wine environment variables
WINEFSYNC=0 WINEESYNC=0

Proton environment variables
PROTON_NO_FSYNC=1 PROTON_NO_ESYNC=1
Troubleshooting
Mods
GTA Connected has a form of anti-cheat that only allows whitelisted mods[wiki.gtaconnected.com]. This, unfortunately, means that even mods that fix the game won't work, most notably those that fix the memory-related issues.

Launch arguments and commandline.txt not working
Note: This method does not work if GTA Connected client is restarted after an update. It must be started cleanly.

Steam launch arguments won't work because protontricks assumes the program you are trying to run isn't the game itself.

On the other hand, commandline.txt is supposed to be read by the game, but if the game is launched through GTA Connected, it is ignored.

Instead, modify the shortcut/shell script you use to launch GTA Connected by appending the launch arguments to Launcher.exe. The launcher will forward these arguments to the game.

Example:
(...)-launch --appid 12210 Launcher.exe -availablevidmem 2452.0

The game reverts to safe mode
This is caused by the game's faulty VRAM check that breaks if the GPU selected by the game has over ~2 GB of VRAM. Even if the same launch arguments are used as the ones to make the base game work properly, if the detected number is over 2 GB, this procedure must be followed.

Procedure for 1.0.8.0 (absolute value)
Use this argument:
-availablevidmem 2452.0

Procedure for 1.0.7.0 (relative value)
  1. Take note of the VRAM amount detected by the game in the Graphics menu (the second number in the Resource Usage line)
  2. Divide 2452 with the number obtained from the previous step, only the first one or two decimals are enough
  3. Use this argument (replace X.X with the number from the previous step):
    -availablevidmem X.X

The game freezes on launch
Whenever this happens, kill GTAIV.exe.

Selecting Window mode under Tools > Game Settings... may make this freeze less likely to happen.
Attribution
Sources:
40 Comments
BestPriceTrader 23 Aug @ 8:20am 
The unemployed always use linux
21 Aug @ 4:38am 
nice proprietary software
lightwo  [author] 31 May, 2024 @ 12:41am 
While I haven't tried it yet, it should be possible with a mod such as Zolika1351's Trainer, which allows you to start single-player missions in multiplayer:

https://gtaforums.com/topic/896795-1000-1080-zolika1351s-trainermod-menu-rewritten/
Paravoxian 30 May, 2024 @ 6:24pm 
I make it to work figuring out what you are trying to say.
-I install gta connect with lutris using the option to install an exe. (using the same directory as the tutorial here, installed inside the pfx folder)
-Then i make a folder shortcut of the GTAIV in home (because i cant acess invisible files in explorer in gta connect)
-Open the config of gta iv that i installed with lutris and changed the executable for the Launch.exe directory.
-Then in GTA Connect to configure the GTAIV.exe location in retail folder i go to / then home/user and click in the shorrtcut and the rest its story. Perfect!

A question for the author that have a server and know more, can i play missions coop like Deal Breaker and Hangman's NOOSE? Thx a lot in any case!!!
lightwo  [author] 29 May, 2024 @ 12:20pm 
I am not in any of the Discord "servers" related to GTAC or GTAIV, you could have a look though.

I do host a game server (as in, one of the servers that appear in the server list), but am seldomly active in general. This comment section is the only place I know where GTAC on Linux is being discussed.
Paravoxian 29 May, 2024 @ 7:20am 
There's a discord group of gta iv for linux? maybe if i share the steps on my screen have something that i missing.
lightwo  [author] 27 May, 2024 @ 3:14pm 
It seems as if you did everything correctly, I don't know why you're getting that error.

Error related to launcher.xml sounds like GTAC can't open its layout file. I am pretty sure GTAC has no additional dependencies, so... your guesses are as good as mine.

I don't know, sorry. You could try running it with wine-ge instead.
Paravoxian 27 May, 2024 @ 1:13pm 
I tried and uninstalled fine, i installed again with
cd /home/moon/GTAONLINE/
protontricks-launch --appid 12210 GTAC-1.6.10.exe
cd home/moon/.steam/steam/steamapps/compatdata/12210/pfx/drive_c/users/steamuser/AppData/Local/Jack\'s\ Mini\ Network/Grand\ Theft\ Auto\ Connected/
protontricks-launch --appid 12210 Launcher.exe
and still getting the error launcher xml. maybe i installed something worg from protontricks or wine?
lightwo  [author] 27 May, 2024 @ 12:21am 
Have you opted for the shortcut or the script method? Whichever it is, you have to start Launcher.exe inside the directory it is installed in.

Unfortunately, judging by the command you sent in the comment, it does seem like you're starting it from the correct directory. I just tested and didn't get the same error. Can you try to install GTA Connected again?

I believe you should be able to uninstall GTAC before installing it again by replacing "Launcher.exe" with "uninstaller", so try that.
Paravoxian 26 May, 2024 @ 11:32pm 
Im getting "unable to open launch.xml" when i try to run the final step.
"protontricks-launch --appid 12210 Launcher.exe"