Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support X11 forwarding #654

Open
fpoirotte opened this issue Aug 28, 2023 · 11 comments · May be fixed by #829
Open

Support X11 forwarding #654

fpoirotte opened this issue Aug 28, 2023 · 11 comments · May be fixed by #829
Assignees
Labels
enhancement New feature or request stale

Comments

@fpoirotte
Copy link

Is your feature request related to a problem?
Hi, I would like to run a graphical application inside a devpod workspace, using X11 forwarding.

I found no information on how to enable the X11 forwarding protocol in the documentations.

Is this already supported? If not, is it a planned feature?
What would be the best way to achieve X11 forwarding?

Which solution do you suggest?
If the feature is already available, add a quickstart how-to on the subject.
If not, add support for X11 forwarding.

Which alternative solutions exist?
None that I am aware of.

Additional context
n/a

@pascalbreuninger
Copy link
Member

Hi @fpoirotte, just saw this issue now. Supporting X11 is on our roadmap, albeit not with the highest priority.
If you need it quickly, feel free to open a PR and kickstart the feature

@decipher2k
Copy link

X11 forwarding would be a killer feature. DevPod isn't really cool without it.

@decipher2k
Copy link

decipher2k commented Oct 14, 2023

Is your feature request related to a problem? Hi, I would like to run a graphical application inside a devpod workspace, using X11 forwarding.

I found no information on how to enable the X11 forwarding protocol in the documentations.

Is this already supported? If not, is it a planned feature? What would be the best way to achieve X11 forwarding?

Which solution do you suggest? If the feature is already available, add a quickstart how-to on the subject. If not, add support for X11 forwarding.

Which alternative solutions exist? None that I am aware of.

Additional context n/a

You could setup your own prebuild workspace and use Xming:
http://www.straightrunning.com/XmingNotes/
with a prebuild workspace:
https://devpod.sh/docs/developing-in-workspaces/prebuild-a-workspace

XMing is an X11-Server for Windows.

For more convenience, you could use MobaXterm (it has got an X11 server built in, and can connect using a config file) clientside.
MobaXterm does also support macros for running the IDE, so you can really start the whole pod with a single click.

afaik an SSH server has got to be setup in the container in both cases.

@behrica
Copy link

behrica commented Oct 28, 2023

https://github.com/novnc/noVNC

is an other option to run linux graphical apps inside Docker and expose a "web browser interface" to them.
This should work as-is, as it iust needs a TCP port exposed.

See as well here:
https://github.com/devcontainers/features/tree/main/src/desktop-lite

@vquemener
Copy link

Hi @fpoirotte, just saw this issue now. Supporting X11 is on our roadmap, albeit not with the highest priority. If you need it quickly, feel free to open a PR and kickstart the feature

Hi @pascalbreuninger, thanks for your awesome work on DevPod!

Is this roadmap public?

Would you say there's a good chance that X11 forwarding support will be available in 2024?

@pascalbreuninger
Copy link
Member

pascalbreuninger commented Nov 3, 2023

@vquemener thanks 😄

Nope, it's in our internal tracker but we were discussing opening the DevPod Roadmap up to the open source community. No tangible outcome yet though

As for X11 support, it's certainly possible in 2024 but your contribution could even bring it in 2023 😉

fpoirotte added a commit to fpoirotte/devpod that referenced this issue Dec 4, 2023
@fpoirotte
Copy link
Author

I've created draft pull requests to address this issue.
I'm a novice when it comes to Go, so apologies if the code quality is subpar.
I haven't had time to write tests yet (I'm not entirely sure how to test this anyway as e2e tests would require a working graphical server for this to work).

@pascalbreuninger
Copy link
Member

@fpoirotte thanks a lot, we'll take a look!

@pascalbreuninger pascalbreuninger added the enhancement New feature or request label Apr 18, 2024
@haakobja
Copy link

Is your feature request related to a problem? Hi, I would like to run a graphical application inside a devpod workspace, using X11 forwarding.

I found no information on how to enable the X11 forwarding protocol in the documentations.

Is this already supported? If not, is it a planned feature? What would be the best way to achieve X11 forwarding?

Which solution do you suggest? If the feature is already available, add a quickstart how-to on the subject. If not, add support for X11 forwarding.

Which alternative solutions exist? None that I am aware of.

Additional context n/a

I know this is an old topic, but here's my 5 cents.

X11 Forwarding is possible by adding the DISPLAY environment variable to devcontainer.json. However it only works without extra software if you're using Linux. StackOverflow provides more information: https://stackoverflow.com/questions/44429394/x11-forwarding-of-a-gui-app-running-in-docker.

If you're using Windows, I don't know how to get it to work, but I successfully got it to work on Mac using XQuartz and adding this to my devcontainer.json:

"containerEnv": {
  "DISPLAY": "host.containers.internal:0"
}

Please note that XQuartz must be running and you must execute the following command xhost + 127.0.0.1 before you start your container

@fpoirotte
Copy link
Author

@haakobja : yes, it's possible to set the DISPLAY variable environment, however it exposes the application to additional risk: the X11 traffic will not pass through devpod's SSH tunnel (and is thus sent in cleartext).

It also adds additional constraints (e.g. the X11 server must listen on the network rather than on a UNIX socket, or you must use the host's network inside the container, or mount the X11 server's UNIX socket inside the container and authorize the container explicitly with tools like xauth).
All of these solutions are cumbersome and may pose additional security problems.

The idea behind this ticket is to bake support for the SSH X11 forwarding protocol into devpod's SSH server directly.
That way, users can simply enable X11 forwarding in their SSH client when connecting to the workspace (ssh -X workspace.devpod) and graphical applications will "just work" provided there is a running X11 server on the client.

Copy link

This issue is stale because it has been open for 60 days with no activity.

@github-actions github-actions bot added the stale label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants