Desktop, X11 & Wayland

An X11 application cannot open its display

A stale DISPLAY or missing X authorization can break one launch context. Compare the failing process with the working desktop session.

On this page
  1. Symptoms & scope
  2. Possible causes
  3. Diagnose safely
  4. Evidence-guided next steps
  5. References & review
  6. Related problems

Symptoms & scope

  • The application opens from a desktop terminal but not a launcher or remote shell.
  • A toolkit reports that it cannot open the display.

Relevant environment

X11 apps on Xorg or Xwayland, including SSH forwarding; run checks as the desktop user, not root.

Recognizable messages (synthetic examples)
(example-app:841): Gtk-WARNING **: cannot open display: :99

Check the launch environment, server availability and authorization; this is not a GPU-crash diagnosis.

Possible causes

These are possible explanations, not a confirmed diagnosis. Several independent faults can coexist.

  • DISPLAY may refer to a previous session or an unavailable Xwayland server.
  • XAUTHORITY may refer to the wrong account or authority file.

Diagnose safely

Run one command at a time in the relevant session. Read the explanation first. Uppercase placeholders need your own values; tools and privileges vary by distribution. These commands are displayed here and never executed by the website.

Check 1

Run in the failing context and compare with a working terminal in the same session. Missing variables can make printenv return nonzero.

printenv DISPLAY XAUTHORITY XDG_SESSION_TYPE

Interpret the result: A different display or authority path suggests stale launcher exports; an unset XAUTHORITY is not automatically wrong because a default file may be used.

Check 2

Reads authority-file metadata and entry count without printing reusable authentication cookies.

xauth info

Interpret the result: The authority file should belong to the intended session. A missing file, wrong path or no entries is a clue, not proof that the display server is stopped.

Evidence-guided next steps

Remove stale display overrides from the launcher

If the working terminal has different session values, back up the launcher or shell fragment and remove only hard-coded DISPLAY and XAUTHORITY assignments. Start the program as the logged-in desktop user so it inherits the session’s current values.

Precautions: Do not run the GUI as root or use xhost + to bypass authentication. Wayland’s presence does not guarantee Xwayland is enabled.

Recovery / rollback: Restore the saved launcher or shell fragment if the override was required for a separate verified display.

Did this solution help you?

Share this solution#

Reestablish the intended SSH X11 forwarding

If the failure occurs only over SSH, verify the local X server is available and the remote server permits X11 forwarding, then create a fresh ssh -X session. Use the DISPLAY assigned by SSH rather than setting the remote machine’s display manually.

Precautions: Trusted -Y forwarding increases the remote application’s access to the local display; use it only for an explicitly trusted host and application.

Recovery / rollback: Close the forwarded session and restore any host-specific forwarding setting changed for the test.

Did this solution help you?

Share this solution#

References & review

This guide was prepared from primary project or distribution sources and reviewed on the date shown. This is an editorial source check, not evidence that a fix was reproduced on your hardware. Diagnostic log examples are synthetic fixtures. Version-dependent details must be checked against your installed release.