Can't connect to X11 using ':99'
Expected Behavior
Application starts normally.
Actual Behavior
The application fails to start. The browser may remain on the startup screen or report a startup error.
Exception
java.awt.AWTError: Can't connect to X11 window server using ':99' as the value of the DISPLAY variable.
Steps to Reproduce the Problem
- Install Webswing on Linux
- Start Webswing
- Start any application through browser
Solution
Check the display configuration of the standalone server or the Session Pool that launches the application.
- To use built-in XHeadless: leave
DISPLAYunset and keepwebswing.xheadless.enabled=true(the default). Restart the server or Session Pool after changing its configuration. Thestartcommand automatically usesxvfb-runwhen it is available and no external display is configured. The foregroundruncommand does not start Xvfb. To use built-in XHeadless even with Xvfb installed, userunor the direct Java systemd service withoutDISPLAY. - To use an external display: verify that
DISPLAYpoints to a running X server and that the Webswing service account has access, including the required Xauthority credentials. A stale local display or incorrect remote address can prevent automatic fallback. - If
xvfb-runfails before Webswing starts: check thatxvfb-runandxauthare installed and the selected display number is available. Check the startup log even if the script prints STARTED. - If a custom launcher starts applications in another container or network environment: provide a display reachable from that environment.
Review the server or Session Pool log for the original connection error before retrying the application. Native X11 features that require a full X server need Xvfb or another external display.