Skip to main content

Flatpak Apps Won't Launch While Gaming

Troubleshooting: Flatpak Apps Won't Launch While Gaming (VRChat / Heavy Proton Games)

The Problem: You are playing a heavy game through Proton (like VRChat) and decide you want to open a Flatpak app like Discord, Vivaldi, or Spotify. You click the icon, but absolutely nothing happens.

If you try to run the app from the terminal (e.g., flatpak run com.vivaldi.Vivaldi), you get a weird error that looks like this:

bwrap: Can't find source path /run/user/1000/doc/by-app/com.vivaldi.Vivaldi: No such file or directory

Why This Happens: Linux limits how many "open files" (called file descriptors) a single user session can have at once. When you run Windows games through Proton, it uses compatibility tools called Esync and Fsync to translate Windows commands into Linux commands. To keep your frame rates high, these tools open a massive, ungodly number of file descriptors.

Heavy games like VRChat will easily chew through Linux's default limit. When the limit is reached, your background services get choked out. Specifically, a background messenger called xdg-document-portal crashes. Flatpak apps absolutely need this portal running to securely launch. If the portal crashes, Flatpaks refuse to open.

The Quick Fix (Without closing your game): You just need to reboot the crashed background messenger. Open your terminal and run:

systemctl --user restart xdg-document-portal.service
systemctl --user restart xdg-desktop-portal.service

Your apps will now launch normally again! (Don't worry, restarting these services will not crash your game).

The Permanent Fix: Valve officially recommends increasing the maximum file descriptor limit to 1,048,576 for gaming setups. To permanently fix this so you never have to think about it again, copy and paste these three blocks into your terminal. You will be asked for your sudo password.

1. Fix the limit for background user services (like the Flatpak portal):

sudo mkdir -p /etc/systemd/user.conf.d
echo -e "[Manager]\nDefaultLimitNOFILE=1048576" | sudo tee /etc/systemd/user.conf.d/99-gaming-limits.conf

2. Fix the limit for system-wide services:

sudo mkdir -p /etc/systemd/system.conf.d
echo -e "[Manager]\nDefaultLimitNOFILE=1048576" | sudo tee /etc/systemd/system.conf.d/99-gaming-limits.conf

3. Fix the limit for your actual desktop session:

echo -e "* hard nofile 1048576\n* soft nofile 1048576" | sudo tee /etc/security/limits.d/99-gaming-limits.conf

Once you've run those, reboot your PC. Your PC will now have plenty of file "tickets" to go around, and VRChat will no longer break your Flatpaks.