Skip to content

Instantly share code, notes, and snippets.

@bpmct
Last active June 19, 2026 16:23
Show Gist options
  • Select an option

  • Save bpmct/cf3a8956a0b2afbe8427027b64428711 to your computer and use it in GitHub Desktop.

Select an option

Save bpmct/cf3a8956a0b2afbe8427027b64428711 to your computer and use it in GitHub Desktop.
Adding external SSD as Steam library on Asahi Linux (FEX-Emu/muvm)

Adding an External SSD as a Steam Library on Asahi Linux

Steam on Asahi Linux runs x86_64 binaries via FEX-Emu inside a muvm MicroVM. This causes two problems that prevent adding an external drive as a Steam library through the normal UI.

Symptoms

  • Settings → Storage shows nothing / "Add Drive" does nothing
  • Manually selecting a path gives no feedback or silently fails

Root Causes

1. UDisks2 not available inside muvm

Steam uses the UDisks2 D-Bus service to discover storage devices. Since Steam runs inside a MicroVM, it can't reach UDisks2 on the host:

Error: Initialize: failed to connect to UDisks2: Could not connect: No such file or directory
Error: OnLibraryFoldersInitialized: Failed to initialize storage device manager
Error: operator(): failed to retrieve file open dialog results

This is why the Storage settings page shows nothing and the file picker doesn't work.

2. SELinux unlabeled_t on the ext4 filesystem

An ext4 drive formatted outside of Fedora won't have SELinux xattrs set. Files show unlabeled_t context, which can interfere with Steam's library validation:

drwxr-xr-x  benpotter  unconfined_u:object_r:unlabeled_t:s0  /mnt/SteamGames

Fix

Step 1 — Mount the drive persistently via fstab

DEVICE=/dev/sda1   # adjust to your device
MOUNTPOINT=/mnt/SteamGames
UUID=$(sudo blkid -s UUID -o value "$DEVICE")

sudo mkdir -p "$MOUNTPOINT"
sudo bash -c "echo 'UUID=$UUID $MOUNTPOINT ext4 defaults,nofail,x-systemd.device-timeout=10 0 2' >> /etc/fstab"
sudo systemctl daemon-reload
sudo mount "$MOUNTPOINT"
sudo chown -R "$USER:$USER" "$MOUNTPOINT"

Step 2 — Fix SELinux labels on the drive

context= mount option doesn't work for ext4 (incompatible with seclabel). Use semanage instead to add a persistent file context policy:

sudo semanage fcontext -a -t home_root_t "/mnt/SteamGames(/.*)?"
sudo restorecon -Rv /mnt/SteamGames/

This persists across reboots — new files created on the drive will also get the correct label.

Step 3 — Create the steamapps directory

mkdir -p /mnt/SteamGames/steamapps
restorecon -Rv /mnt/SteamGames/

Step 4 — Manually add the library to libraryfolders.vdf

Since the Steam UI can't add drives (UDisks2 missing), edit the VDF directly. Quit Steam first, then:

nano ~/.local/share/Steam/steamapps/libraryfolders.vdf

Add a second entry so the file looks like this:

"libraryfolders"
{
    "0"
    {
        "path"      "/home/USERNAME/.local/share/Steam"
        "label"     ""
        "contentid" "YOUR_EXISTING_ID"
        "totalsize" "0"
        "update_clean_bytes_tally"  "0"
        "time_last_update_verified" "0"
        "apps"
        {
        }
    }
    "1"
    {
        "path"      "/mnt/SteamGames"
        "label"     ""
        "contentid" ""
        "totalsize" "0"
        "update_clean_bytes_tally"  "0"
        "time_last_update_verified" "0"
        "apps"
        {
        }
    }
}

Step 5 — Relaunch Steam

Steam will read the VDF on startup, mount the library, and populate contentid and totalsize automatically. The drive will then appear in Settings → Storage.

Environment

  • Asahi Linux (Fedora Asahi Remix) on Apple Silicon (M2)
  • Steam via fex-steam (FEX-Emu + muvm MicroVM for x86_64 translation)
  • External SSD formatted as ext4
  • SELinux in enforcing mode (targeted policy)

Steam UI Crashes on Asahi Linux (muvm X11 Bridge Race Condition)

Symptom

Steam window disappears shortly after switching focus away from it. The underlying Steam process (inside muvm) keeps running — downloads and games continue — but the UI is gone.

Root Cause

The fex-steam launcher hardcodes -cef-force-occlusion in its launch args (/usr/bin/steam, line 26). This flag tells CEF to always treat the window as occluded/hidden. When you focus away, the window manager sends real X11 focus-out events, CEF's occlusion handling fires and destroys 12+ child render windows simultaneously. The muvm X11 bridge then races to modify those now-dead windows, causing a cascade of X11 errors and crashing the UI:

X error received. Request: DestroyWindowRequest, Error: WindowError{bad_value = 46137362}  (× 12)
X error received. Request: SendEventRequest,    Error: WindowError{bad_value = 46138106}
X error received. Request: ChangeWindowAttributesRequest, Error: WindowError{bad_value = 46137371}

Fix

Create a muvm wrapper at ~/.local/bin/muvm that strips -cef-force-occlusion before passing args to the real muvm. Since ~/.local/bin is earlier in $PATH than /usr/bin, this intercepts every Steam launch automatically.

cat > ~/.local/bin/muvm << 'WRAPPER'
#!/bin/bash
# Strip -cef-force-occlusion from Steam launch args.
# That flag causes CEF to destroy X11 windows on focus loss, which
# triggers a race condition in muvm's X11 bridge and crashes the Steam UI.
new_args=()
for arg in "$@"; do
    new_args+=("${arg//-cef-force-occlusion/}")
done
exec /usr/bin/muvm "${new_args[@]}"
WRAPPER
chmod +x ~/.local/bin/muvm

Relaunch Steam — the UI now survives focus changes and games launch normally.

Why -cef-force-occlusion was added

The flag was added by the Asahi team to prevent Steam's UI from going black — without it, CEF would detect the window as always occluded (an XWayland quirk in the muvm X11 bridge) and stop rendering. Removing it restores normal CEF window lifecycle, and in practice the black-screen issue does not occur with current muvm versions.

Confirmed working

  • muvm 0.6.0, fex-emu 2604, Fedora Asahi Remix, Apple M2 Pro (June 2026)
  • Games launch via Proton Experimental without issues
  • Steam UI survives focus switching

Status

Still worth filing upstream at https://github.com/AsahiLinux/muvm/issues — the root fix belongs in the X11 bridge, not a user-space wrapper. Wayland support (issue #8) would also bypass the X11 bridge entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment