Files
ubuntu-post-install/docs/SWBF2-2017-wolf-setup.md
T
Claude 5cff764d3b docs: add EA auth dependency context, login process, and longevity notes
Documents the EA account requirement, first-time login flow, credential
caching for machine transfers, community server options if EA shuts down,
and the SWBF2 2005 alternative for a launcher-free experience.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8ckUJQtj1pH8jtAddBDZs
2026-06-22 05:02:19 +00:00

11 KiB
Raw Blame History

Star Wars Battlefront II (2017) — Wolf/Moonlight Setup

AppID: 1237950
Proton: GE-Proton10-34 (required — stock Proton does not work with EA App)
Platform: Wolf (Games-on-Whales) — WolfSteam Docker container


The EA dependency problem

SWBF2 (2017) has a hard dependency on EA's authentication infrastructure:

  • Steam handles payment, library, and game files
  • EA App handles identity and authentication — even for offline single-player

First launch requires an internet connection and an EA account login. After that, EA App caches credentials locally and subsequent launches work offline — but only until the token expires or EA's servers go dark permanently.

What happens when EA shuts down authentication servers?
The game becomes unplayable through legitimate means. EA has done this before (Battlefield 2, The Sims Online, older Origin titles). For a 9-year-old game with a shrinking playerbase, this is a real risk.

Community options if/when that happens:

  • Private servers — the SWBF2 community has projects like Kyber for multiplayer. If EA kills auth, expect the community to build replacement auth servers as they did for BF2 (BF2Hub, OpenSpy).
  • Play SWBF2 (2005) instead — the classic 2005 Battlefront II runs natively on Linux through Proton with zero launcher requirements, no accounts, no phoning home. AppID: 6060. It just works.

Backing up credentials for machine transfers:
EA App caches credentials inside the Wine prefix. Back up the entire compatdata directory:

tar -czf swbf2-prefix-backup.tar.gz \
  /home/retro/.steam/steam/steamapps/compatdata/1237950/

Restore it on another machine and the cached login travels with it — until the token expires (EA tokens last weeks to months). Not a permanent solution but useful for migrations.


Why this is hard (technically)


The bwrap problem (why you can't just docker exec)

The WolfSteam container runs Steam as uid 1000 (retro inside container). docker exec carries high Linux capabilities (CapEff ≈ 0xa8ac35fb). Steam processes have CapEff=0.

When a high-cap shell tries to run bwrap (used by Steam's sniper/pressure-vessel runtime), bwrap attempts a privileged uid-map path that fails:

setting up uid map: Permission denied

This means you cannot run Proton or wine64 via docker exec — bwrap always fails. Only Steam itself can properly launch programs through sniper+GE-Proton.


Solution overview

  1. Intercept the Steam launch with a wrapper script (via launch options)
  2. Spoof Origin registry entries so SWBF2 thinks its launcher is present
  3. Skip link2ea:// entirely — launch starwarsbattlefrontii.exe directly

No EA account needed. No EA App login needed.


Step-by-step

1. Find the WolfSteam container name and Steam user ID

WOLF_CONTAINER=$(docker ps --format '{{.Names}}' | grep Wolf)
echo "$WOLF_CONTAINER"

STEAM_UID=$(docker exec "$WOLF_CONTAINER" ls /home/retro/.steam/steam/userdata/)
echo "$STEAM_UID"

CONFIG_DIR="/home/retro/.steam/steam/userdata/$STEAM_UID/config"

2. Lock localconfig.vdf against Steam overwriting it

Steam uses atomic rename (write temp + rename) when saving config. chmod 444 on the file is bypassed by the rename. Lock the directory instead:

docker exec "$WOLF_CONTAINER" chmod 555 "$CONFIG_DIR"

3. Set SWBF2 launch options in localconfig.vdf

Kill Steam first so it flushes and releases the file, then edit:

docker exec "$WOLF_CONTAINER" pkill -f steam.sh || true
sleep 3

CONFIG_FILE="$CONFIG_DIR/localconfig.vdf"

# The file needs a LaunchOptions entry under AppID 1237950.
# Find the block and add/replace LaunchOptions:
docker exec "$WOLF_CONTAINER" grep -A5 '"1237950"' "$CONFIG_FILE"
# If LaunchOptions is missing, add it manually to the 1237950 block:
#   "LaunchOptions"   "STEAM_UNIX_SOCKET=/tmp/steam.sock /home/retro/ea_install.sh %command%"

The launch option value must be:

STEAM_UNIX_SOCKET=/tmp/steam.sock /home/retro/ea_install.sh %command%

4. Write the Origin registry spoof

SWBF2's binary checks for Origin in the registry before starting. Spoof it by writing directly to Wine's system.reg (plain text file — no Wine needed):

SYSREG="/home/retro/.steam/steam/steamapps/compatdata/1237950/pfx/system.reg"
TIMESTAMP=$(date +%s)

docker exec "$WOLF_CONTAINER" bash -c "cat >> '$SYSREG' << 'REGEOF'

[Software\\\\Origin] $TIMESTAMP
\"ClientPath\"=\"C:\\\\\\\\Program Files\\\\\\\\Electronic Arts\\\\\\\\EA Desktop\\\\\\\\EA Desktop\\\\\\\\EADesktop.exe\"
\"InstallDir\"=\"C:\\\\\\\\Program Files\\\\\\\\Electronic Arts\\\\\\\\EA Desktop\\\\\\\\EA Desktop\\\\\\\\\"

[Software\\\\Wow6432Node\\\\Origin] $TIMESTAMP
\"ClientPath\"=\"C:\\\\\\\\Program Files\\\\\\\\Electronic Arts\\\\\\\\EA Desktop\\\\\\\\EA Desktop\\\\\\\\EADesktop.exe\"
\"InstallDir\"=\"C:\\\\\\\\Program Files\\\\\\\\Electronic Arts\\\\\\\\EA Desktop\\\\\\\\EA Desktop\\\\\\\\\"
REGEOF"

# Verify
docker exec "$WOLF_CONTAINER" grep -A3 'Software\\\\Origin' "$SYSREG"

5. Write the launch wrapper

The wrapper receives Steam's full launch chain as $@ (args 111 are the sniper+GE-Proton preamble, arg 12 is normally link2ea://...). Replace the last arg with the actual game executable:

cat > /tmp/ea_install.sh << 'EOF'
#!/bin/bash
echo "=== launch $(date) ===" >> /tmp/ea_install.log
GAME_EXE="/home/retro/.steam/steam/steamapps/common/STAR WARS Battlefront II/starwarsbattlefrontii.exe"
exec "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" "${10}" "${11}" "$GAME_EXE"
EOF
chmod +x /tmp/ea_install.sh
docker cp /tmp/ea_install.sh "$WOLF_CONTAINER":/home/retro/ea_install.sh

6. Launch SWBF2 in Moonlight — first-time EA login

On first launch Steam passes link2ea://launchgame/1237950?platform=steam&theme=swbfii to GE-Proton, which hands it to Link2EA.exe. EA App opens and shows a login screen.

Vulkan shader compilation appears before the game loads on first run. Let it complete — do not skip it. It only runs once and takes several minutes.

EA App login:

  1. Log in with your EA account credentials
  2. Check "Stay logged in" / "Remember me" — this caches the token locally
  3. EA App links your Steam purchase to your EA account
  4. The game launches

After first login, credentials are cached in the Wine prefix at:

compatdata/1237950/pfx/drive_c/users/steamuser/AppData/Local/EADesktop/

Subsequent launches skip the login screen entirely.

7. Restore clean state (after confirmed working)

# Restore directory to writable so Steam can save normally
docker exec "$WOLF_CONTAINER" chmod 755 "$CONFIG_DIR"

# Remove LaunchOptions for 1237950 from localconfig.vdf while Steam is stopped

Background: what Steam actually passes to the wrapper

$1  = /path/to/steam-launch-wrapper
$2  = --
$3  = /path/to/reaper
$4  = SteamLaunch
$5  = AppId=1237950
$6  = --
$7  = /path/to/SteamLinuxRuntime_sniper/_v2-entry-point
$8  = --verb=waitforexitandrun
$9  = --
$10 = /path/to/GE-Proton10-34/proton
$11 = waitforexitandrun
$12 = link2ea://launchgame/1237950?platform=steam&theme=swbfii  ← we replace this

What doesn't work (and why)

Running msiexec / Wine via docker exec

docker exec carries Linux capabilities that break bwrap. Any attempt to run Proton/wine64 outside Steam's own launch chain gets:

setting up uid map: Permission denied

Running the EA App MSI through Wine (INST-14-1603)

The MSI's JunoConfigureRegistry .NET custom action uses SetSecurityDescriptorSddlForm to set registry ACLs. Wine doesn't support this — the action returns 0 (failure), causing the entire install to roll back. DISABLEROLLBACK=1 doesn't help because MSI logs the product as already-registered from the first attempt, causing subsequent runs to produce an empty log and exit.

link2ea:// approach with EA account

EA App requires an EA account linked to your Steam account. ea.com/signup is unreliable. Even with an account, EA Desktop must be installed in the Wine prefix (see msiextract bypass below if needed). Bypassing the game exe directly is simpler.

msiextract bypass (if EA App files are needed for something else)

If you need EA Desktop files in the prefix for another reason:

# Copy MSI out of container (appears in drive_c after first launch attempt)
docker cp "$WOLF_CONTAINER:/home/retro/.steam/steam/steamapps/compatdata/1237950/pfx/drive_c/ea_app.msi" \
    /tmp/ea_app.msi

# Extract on host (bypasses JunoConfigureRegistry entirely)
sudo apt-get install -y msitools
mkdir -p /tmp/ea_app_extracted
msiextract -C /tmp/ea_app_extracted /tmp/ea_app.msi

PFXBASE="/home/retro/.steam/steam/steamapps/compatdata/1237950/pfx/drive_c/Program Files/Electronic Arts/EA Desktop"
docker exec "$WOLF_CONTAINER" bash -c "
  [ -L '$PFXBASE/EA Desktop' ] && rm '$PFXBASE/EA Desktop'
  mkdir -p '$PFXBASE/14.2.0.3345'
  ln -s 14.2.0.3345 '$PFXBASE/EA Desktop'
"
docker cp "/tmp/ea_app_extracted/Electronic Arts/EA Desktop/EA Desktop/." \
    "$WOLF_CONTAINER:$PFXBASE/14.2.0.3345/"

Troubleshooting

Game exits in ~6 seconds, no popup

Check wrapper log inside container:

docker exec "$WOLF_CONTAINER" bash -c "
  cat /tmp/ea_install.log | tail -20
  find /home/retro/.steam/steam/steamapps/compatdata/1237950/ -name '*.log' \
    -newer /tmp/ea_install.log 2>/dev/null | xargs tail -20 2>/dev/null
"

"Origin is not installed" popup

Origin registry entries missing. Repeat step 4 and verify:

docker exec "$WOLF_CONTAINER" grep -A3 'Software\\\\Origin' \
  '/home/retro/.steam/steam/steamapps/compatdata/1237950/pfx/system.reg'

Wrapper never runs (Steam ignores launch options)

Steam wrote config before chmod 555 was applied. Kill Steam, verify chmod 555 is set on the config directory, edit localconfig.vdf, then start Steam again.

localconfig.vdf gets overwritten on Steam shutdown

chmod 555 on the directory (not the file) prevents the atomic rename Steam uses.

wine64 segfaults outside Steam (exit 139)

GE-Proton10's wine64 requires the sniper runtime. Never call it via docker exec.


Key paths (inside WolfSteam container)

Path Description
/home/retro/.steam/steam/steamapps/compatdata/1237950/pfx/ SWBF2 Wine prefix
/home/retro/.steam/steam/steamapps/compatdata/1237950/pfx/system.reg Wine HKLM registry (plain text)
/home/retro/.steam/steam/steamapps/compatdata/1237950/pfx/drive_c/ea_app.msi EA App MSI (~227 MB, appears after first launch)
/home/retro/.steam/steam/steamapps/common/STAR WARS Battlefront II/starwarsbattlefrontii.exe Actual game binary
/home/retro/.steam/steam/userdata/<uid>/config/localconfig.vdf Steam per-user config (launch options)
/home/retro/ea_install.sh Launch wrapper script
/tmp/ea_install.log Wrapper log (inside container, resets on container restart)