enable Gui in codeSpaces ‐Install X11‐Virtual Display - nglthu/JavaGuiProject GitHub Wiki

gh cs ssh -- -XY

Use x11 forwarding.

+On the codespaces, ssh X11 forwarding is enabled by default.

+Just make sure to install xauth package,

sudo apt-get update

sudo apt-get install xauth

+then connect to codespaces use gh cs ssh -- -X.

To achieve this, simply create a .gitpod.yml file containing:

image: gitpod/workspace-full-vnc
ports:
  - port: 6080
    onOpen: open-preview

Then just commit and push this file, close your workspace, and create a new Gitpod workspace for your repository. This will give you a X11 server.

https://x410.dev/cookbook/enabling-ssh-x11-forwarding-in-visual-studio-code-for-remote-development/

Reference:

https://stackoverflow.com/questions/72676914/how-to-enable-gui-app-in-github-codespaces