How to Disable the Ubuntu ‘Wayland’ Protocol in Firefox (Force X11/XWayland)

Modern versions of Ubuntu Desktop use the Wayland display server by default. In an effort to modernise the Linux desktop, Mozilla Firefox (which comes pre-installed as a Snap package on Ubuntu) is now configured to natively run on Wayland rather than relying on X11 compatibility layers.

While Wayland offers smoother scrolling and better security, it still suffers from severe bugs when interacting with certain screen recording software, older NVIDIA drivers, or specific fractional scaling configurations. If Firefox is glitching, freezing, or refusing to share your screen correctly in Zoom or Google Meet, forcing the browser to fall back to the older, more stable X11 (via XWayland) protocol can instantly fix these issues.

How to Force Firefox to Use X11 in Ubuntu

You must modify the environment variables of the Firefox launcher to instruct it to ignore the native Wayland session.

  1. Open your Terminal (Ctrl + Alt + T).
  2. Because the default Firefox in modern Ubuntu is a Snap package, you cannot simply edit the system-wide .desktop file in /usr/share/applications/. Instead, you should create a local user override.
  3. Copy the Firefox launcher file to your local user directory by typing: cp /var/lib/snapd/desktop/applications/firefox_firefox.desktop ~/.local/share/applications/
  4. Open this local file in the nano text editor: nano ~/.local/share/applications/firefox_firefox.desktop
  5. Look for the line that starts with Exec=env BAMF_DESKTOP_FILE_HINT... (This is usually around line 10 or 11).
  6. Carefully modify this line by inserting DISABLE_WAYLAND=1 right after the env command. The line should look something like this: Exec=env DISABLE_WAYLAND=1 BAMF_DESKTOP_FILE_HINT=...
  7. Ensure you apply this exact same change to any other Exec= lines further down in the file (which govern right-click actions like “Open a New Window”).
  8. Save the file by pressing Ctrl + O, then Enter. Exit by pressing Ctrl + X.

Close any open Firefox windows. The next time you click the Firefox icon on your dock, the browser will launch using the X11 compatibility layer instead of native Wayland, resolving most screen-sharing and rendering bugs.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.