Skip to content

fix: Start Xvfb in server docker when GUI flag is used#873

Merged
tristpinsm merged 3 commits intomainfrom
issues-871-dev
Apr 16, 2026
Merged

fix: Start Xvfb in server docker when GUI flag is used#873
tristpinsm merged 3 commits intomainfrom
issues-871-dev

Conversation

@ruck314
Copy link
Copy Markdown
Contributor

@ruck314 ruck314 commented Apr 3, 2026

Summary

  • Install xvfb and x11-utils in the server Dockerfile
  • Auto-start Xvfb in start_server.sh when -g/--gui is passed and no working display is found
  • Prevents the Qt/XCB crash that aborts the server on startup with the GUI flag

Context

The rogue v6 update switched the GUI from pyrogue.gui (which supported both Qt and PyDM backends) to exclusively using pyrogue.pydm.runPyDM(). PyDM requires a working X display connection, and the server docker doesn't have one configured by default.

The fix is defensive: if X11 forwarding is properly set up (e.g., via docker-compose mounting /tmp/.X11-unix), it uses that. Otherwise, Xvfb provides a fallback virtual framebuffer so the server doesn't abort.

Closes #871

Test plan

  • Build server docker image and verify Xvfb packages are installed
  • Run server docker with -g flag and no DISPLAY — should start Xvfb automatically instead of crashing
  • Run server docker with -g flag and working X11 forwarding — should use existing display
  • Run server docker without -g flag — no Xvfb started, no change in behavior

Install Xvfb in the server Dockerfile and auto-start a virtual
framebuffer in start_server.sh when -g/--gui is passed and no
working display is found.  Prevents the Qt/XCB crash on startup.

Closes #871
@ruck314 ruck314 requested review from swh76 and tristpinsm as code owners April 3, 2026 15:44
@github-actions github-actions bot added the core Changes to the core code, which is used in the server application label Apr 3, 2026
ruck314 and others added 2 commits April 3, 2026 09:31
Replace the fixed 2-second sleep with a poll loop that waits until
FileWriter.FrameCount reaches FrameRxStats.FrameCnt. This eliminates
the race condition where in-flight frames are lost when the FileWriter
is closed before the pipeline fully drains.
@tristpinsm
Copy link
Copy Markdown
Collaborator

I tested and I found that it was crashing trying to bind to display :0. I think this is because we run the docker container with --network host and that is propagating the host display somehow. Changing to :99 fixed it.

When I forward X and try to use the GUI it pops up but just lags and is unusable. I don't ever use the GUI however, so that may be a problem with my system. Maybe @swh76 can give it a try?

@tristpinsm
Copy link
Copy Markdown
Collaborator

actually it works if I forward with -Y instead of -X

@tristpinsm tristpinsm merged commit 889b2e9 into main Apr 16, 2026
21 checks passed
@tristpinsm tristpinsm deleted the issues-871-dev branch April 16, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes to the core code, which is used in the server application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server docker gui broken in rogue 6 releases

2 participants