I can successfully forward X11 by connecting to my Github Codespace via
$ gh cs ssh
as my ~/.ssh/config
includes
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
ForwardX11 yes
ForwardX11Trusted yes
and I am running an X server locally (locally DISPLAY=:0
), and xauth
is installed in the Github Codespace. I can successfully start X applications remotely and they are forwarded. In the remote shell, DISPLAY=localhost:10.0
.
However, when I connect via VSCode and the Github Codespaces extension, X forwarding does not work.
DISPLAY
is not set in the remote shell. Even if I set it manually (via export DISPLAY=localhost:10.0
) it doesn't work. For instance, when I try to run an application using pygame, I get pygame.error: No available video device
.
How can I forward X11 when connecting to a Github Codespace via the VSCode extension? Thank you.