Skip to content

Instantly share code, notes, and snippets.

@lucasb-eyer
Created April 13, 2026 06:43
Show Gist options
  • Select an option

  • Save lucasb-eyer/3efffda82e1a1cbd396d35d3272870f5 to your computer and use it in GitHub Desktop.

Select an option

Save lucasb-eyer/3efffda82e1a1cbd396d35d3272870f5 to your computer and use it in GitHub Desktop.
Prompt to make IB tws work on wayland arch linux

IBKR Desktop Wayland Fix Notes

This install is in the current workdir.

What broke

IBKR Desktop uses Qt Jambi and is sensitive to the native Qt version it loads. The app's bundled Qt was 6.8.3, but at one point some files in lib/qt/lib/ and lib/qt/plugins/platforms/ were replaced with Arch system Qt 6.11 pieces. That caused the launcher to fail early with a Qt Jambi native mismatch.

The specific bad state looked like this:

  • lib/qt/lib/libQt6Core.so.6 was a symlink to /usr/lib/libQt6Core.so.6
  • lib/qt/lib/libQt6WaylandClient.so.6 was a symlink to /usr/lib/libQt6WaylandClient.so.6
  • lib/qt/plugins/platforms/libqwayland.so linked against Qt 6.11

The important point is:

  • Do not replace IBKR's full Qt stack with system Qt.
  • Keep IBKR's bundled Qt version.
  • If Wayland support is needed, add Wayland plugins and Wayland client libs built for the same Qt version as the bundled IBKR Qt.

What worked here

The local backup at lib/qt/lib/bak68/ contained the original bundled Qt 6.8.3 libraries. Restoring those fixed the Qt Jambi mismatch.

This install did not originally have matching bundled Wayland client libraries, so the working fix was to extract the matching Arch Archive package:

  • qt6-wayland-6.8.3-1-x86_64.pkg.tar.zst

Then copy only the matching Wayland pieces into the install tree.

Recovery procedure after a future update

Run all commands from the workdir.

1. Inspect the current bundled Qt version

Use whichever versioned file exists:

ls lib/qt/lib/libQt6Core.so.6*
find lib/qt/lib -maxdepth 1 -type f -o -type l | sed 's#^.*/##' | grep '^libQt6Core\.so'

If there is a local backup directory like lib/qt/lib/bak68/, inspect it too:

ls lib/qt/lib/bak68/libQt6Core.so.6*

For this install, the backup version was 6.8.3.

2. Restore the bundled Qt libs if they were replaced with system symlinks

This is only appropriate if the updater or a previous manual experiment replaced files in lib/qt/lib/ with symlinks to /usr/lib/....

Example check:

ls -l lib/qt/lib/libQt6Core.so.6 lib/qt/lib/libQt6Gui.so.6 lib/qt/lib/libQt6Widgets.so.6

If they point to /usr/lib, restore from the backup:

rm -f lib/qt/lib/libQt6*.so*
mv lib/qt/lib/bak68/* lib/qt/lib/

Adjust the backup directory name if a future version uses something else.

3. Check the Wayland platform plugin linkage

Use LD_LIBRARY_PATH so the check prefers the local bundled Qt first:

LD_LIBRARY_PATH="$PWD/lib/qt/lib" \
ldd lib/qt/plugins/platforms/libqwayland-generic.so | \
grep -E 'Qt6Core|Qt6Gui|Qt6Wayland|=> /usr/lib|not found'

Healthy output should show:

  • libQt6Core.so.6 => /home/lb/.local/ntws/lib/qt/lib/...
  • libQt6Gui.so.6 => /home/lb/.local/ntws/lib/qt/lib/...
  • libQt6WaylandClient.so.6 => /home/lb/.local/ntws/lib/qt/lib/...

If libqwayland-generic.so does not exist, inspect lib/qt/plugins/platforms/ for the actual Wayland plugin filename:

find lib/qt/plugins/platforms -maxdepth 1 -type f -printf '%f\n' | sort

4. If the Wayland plugin still links to system Qt, fetch the matching archive package

Use the exact Qt version matching the bundled IBKR Qt. For the version fixed here, that package was:

  • https://archive.archlinux.org/packages/q/qt6-wayland/qt6-wayland-6.8.3-1-x86_64.pkg.tar.zst

Example extraction:

curl -L https://archive.archlinux.org/packages/q/qt6-wayland/qt6-wayland-6.8.3-1-x86_64.pkg.tar.zst \
  -o /tmp/qt6-wayland-6.8.3-1-x86_64.pkg.tar.zst

mkdir -p /tmp/qt-wayland-fix
tar -xf /tmp/qt6-wayland-6.8.3-1-x86_64.pkg.tar.zst -C /tmp/qt-wayland-fix

If the updater changes the bundled Qt version, use the matching qt6-wayland version from the Arch Archive instead of 6.8.3.

5. Replace only the Wayland pieces with matching-version files

rm -f lib/qt/plugins/platforms/libqwayland.so
cp -f /tmp/qt-wayland-fix/usr/lib/qt6/plugins/platforms/libqwayland-*.so lib/qt/plugins/platforms/
cp -f /tmp/qt-wayland-fix/usr/lib/libQt6WaylandClient.so* lib/qt/lib/
cp -f /tmp/qt-wayland-fix/usr/lib/libQt6WaylandEglClientHwIntegration.so* lib/qt/lib/
cp -rf /tmp/qt-wayland-fix/usr/lib/qt6/plugins/wayland-* lib/qt/plugins/

Do not replace the rest of lib/qt/lib/ with system Qt.

6. Verify again

LD_LIBRARY_PATH="$PWD/lib/qt/lib" \
ldd lib/qt/plugins/platforms/libqwayland-generic.so | \
grep -E 'Qt6Core|Qt6Gui|Qt6Wayland|=> /usr/lib|not found'

The plugin should now resolve its Qt dependencies from the local install tree.

7. Launch under Wayland

Use ./launch.sh if it is still present and executable.

Equivalent command:

LD_LIBRARY_PATH="$PWD/lib/qt/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \
QT_QPA_PLATFORM=wayland \
QT_WAYLAND_DISABLE_WINDOWDECORATION=1 \
./ntws

Important warning about QtWebEngine flags

Do not force:

QTWEBENGINE_CHROMIUM_FLAGS="--ozone-platform=wayland"

On this install that crashed with:

FATAL:platform_selection.cc(45)] Invalid ozone platform: wayland

The app launched successfully under Wayland without that flag.

Quick triage checklist for a future assistant

  1. Confirm the install path is still pwd or adjust commands.
  2. Check whether lib/qt/lib/libQt6Core.so.6 points into /usr/lib.
  3. Restore the bundled Qt libs from a local backup if available.
  4. Check ldd on the Wayland platform plugin with LD_LIBRARY_PATH="$PWD/lib/qt/lib".
  5. If the plugin still wants system Qt, fetch the matching qt6-wayland archive for the bundled Qt version and copy only the Wayland-related files.
  6. Launch with QT_QPA_PLATFORM=wayland and without QTWEBENGINE_CHROMIUM_FLAGS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment