Troubleshooting Steam Flatpak on Alpine Linux: D-Bus Session Issues

The Steam Flatpak on Alpine Linux requires a working D-Bus session bus and the flatpak-portal service to run correctly. If you encounter errors related to dbus-launch or missing D-Bus session bus, follow these steps to resolve the issue.

Step 1: Install D-Bus and Required Utilities

The first step is to install the required D-Bus utilities on your Alpine system:

  1. Install the dbus package:

    doas apk add dbus
    
  2. Start the D-Bus service:

    doas rc-service dbus start
    
  3. Enable the D-Bus service to start automatically on boot:

    doas rc-update add dbus default
    

Step 2: Install dbus-x11 for dbus-launch

The dbus-launch utility may not be included by default in Alpine’s dbus package. To ensure it is available, install the dbus-x11 package:

  1. Install dbus-x11:

    doas apk add dbus-x11
    
  2. Verify dbus-launch is installed:

    which dbus-launch
    

    It should return a path, e.g., /usr/bin/dbus-launch.

Step 3: Set Up the D-Bus Session Environment

Sometimes, the Flatpak environment may not automatically detect the correct D-Bus session. You can manually set up the D-Bus session:

  1. Launch dbus-launch and export the session variables:

    export $(dbus-launch)
    
    # I also had luck with running this
    eval $(dbus-launch --sh-syntax)
    echo $DBUS_SESSION_BUS_ADDRESS
    
  2. After that, try running the Steam Flatpak again:

    flatpak run com.valvesoftware.Steam
    

Step 4: Verify Flatpak's Environment

If the problem persists, check if the Flatpak environment is correctly configured to find dbus-launch:

  1. Check the environment PATH for the Flatpak:

    flatpak run --command=bash com.valvesoftware.Steam -c 'echo $PATH'
    
  2. Ensure that /usr/bin/ is included in the output. If not, Flatpak may not be able to find dbus-launch.

Step 5: Install flatpak-dbus Support Package (If Needed)

In some cases, additional Flatpak-related D-Bus functionality is required. You can install the flatpak-dbus package to ensure proper support for D-Bus inside the Flatpak environment:

  1. Install flatpak-dbus:

    doas apk add flatpak-dbus
    
  2. Try launching the Steam Flatpak again:

    flatpak run com.valvesoftware.Steam
    

Conclusion

These steps should resolve the issue of missing dbus-launch when running the Steam Flatpak on Alpine Linux. If you continue to face issues, make sure your environment variables are properly set, and verify that Flatpak is able to find necessary utilities like dbus-launch.