loft-sh / devpod

Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
https://devpod.sh
Mozilla Public License 2.0
8.43k stars 306 forks source link

Support X11 forwarding #654

Open fpoirotte opened 10 months ago

fpoirotte commented 10 months ago

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 commented 9 months ago

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 commented 8 months ago

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

decipher2k commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

@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 commented 7 months ago

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 commented 6 months ago

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

haakobja commented 3 weeks ago

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