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

X11 forward option in daytona ssh #1206

Open
divanshu-go opened this issue Oct 6, 2024 · 20 comments
Open

X11 forward option in daytona ssh #1206

divanshu-go opened this issue Oct 6, 2024 · 20 comments
Labels
enhancement New feature or request hacktoberfest Hacktoberfest Issues ⚔️ Quest Tracks quest-bot quests

Comments

@divanshu-go
Copy link
Contributor

divanshu-go commented Oct 6, 2024

Add support for X11 forwarding via a flag in the daytona ssh command (e.g., -X or -Y)**

Description:
Daytona CLI currently does not support X11 forwarding for SSH connections, making it difficult to run GUI applications remotely.

For reference, a useful guide on enabling X11 forwarding is available here. It outlines configurations for both Linux and MacOS, and there's also a guide for Windows.

Solution:
Users should be able to pass a flag to daytona ssh to enable X11 forwarding, or receive steps on how to configure it manually.

Note: the current ssh server implementation lacks support for X11 requests.

https://github.com/daytonaio/daytona/tree/main/pkg/agent/ssh

@divanshu-go divanshu-go added the enhancement New feature or request label Oct 6, 2024
@Tpuljak
Copy link
Member

Tpuljak commented Oct 7, 2024

@bryans-go thanks for opening this issue. Everything in the description makes sense.

One thing we should avoid is bundling multiple issues into one. More specifically,

Notes
the current daytona ssh command does allow arguments(dtn ssh ) to it but those arguments are only executed to the remote machine and it doesn't support flags like the ssh do for eg. ssh -flag remote@ does
The user given -flag should be used like the ssh -flag remote@host
or
dtn ssh -flags -otherflag -thirdflag
dtn ssh should support all the ssh flags

This can be its own issue.

also the dtn ssh -edit should allow the users to edit the ssh_config of specific ProjectHostname

And this can be its own issue.

Please split those up so it's easier to track and discuss.

@divanshu-go
Copy link
Contributor Author

@bryans-go thanks for opening this issue. Everything in the description makes sense.

One thing we should avoid is bundling multiple issues into one. More specifically,

Notes
the current daytona ssh command does allow arguments(dtn ssh ) to it but those arguments are only executed to the remote machine and it doesn't support flags like the ssh do for eg. ssh -flag remote@ does
The user given -flag should be used like the ssh -flag remote@host
or
dtn ssh -flags -otherflag -thirdflag
dtn ssh should support all the ssh flags

This can be its own issue.

also the dtn ssh -edit should allow the users to edit the ssh_config of specific ProjectHostname

And this can be its own issue.

Please split those up so it's easier to track and discuss.

Done

Copy link

quest-bot bot commented Oct 8, 2024

New Quest! image New Quest!

A new Quest has been launched in @daytonaio’s repo.
Merge a PR that solves this issue to loot the Quest and earn your reward.


Loot of 20 USD has been stashed in this issue to reward the solver!

🗡 Comment @quest-bot embark to check-in for this Quest and start solving the issue. Other solvers will be notified!

⚔️ When you submit a PR, comment @quest-bot loot #1206 to link your PR to this Quest.

Questions? Check out the docs.

@quest-bot quest-bot bot added the ⚔️ Quest Tracks quest-bot quests label Oct 8, 2024
@divanshu-go
Copy link
Contributor Author

@quest-bot embark
on to it !

@Tpuljak Tpuljak added the hacktoberfest Hacktoberfest Issues label Oct 8, 2024
@RS-labhub
Copy link
Contributor

Hi @Tpuljak , do I need to make it compatible for macOS, linux, and Windows? I would like to work on this.. But I guess it's open for all, right??

If not assign me this 🙂

@quest-bot embark

@Tpuljak
Copy link
Member

Tpuljak commented Oct 8, 2024

@RS-labhub no need to get assigned. You're free to work on it of course.

Hi @Tpuljak , do I need to make it compatible for macOS, linux, and Windows? I would like to work on this.. But I guess it's open for all, right??

That's correct.

@RS-labhub
Copy link
Contributor

starting to work on it!

@RS-labhub
Copy link
Contributor

RS-labhub commented Oct 8, 2024

Oh wait.. someone is already working on it... Sorry @bryans-go, I didn't know about it.. Just going to the threads now and saw it. Nevermind, but are you still working on it?

Loll, I don't know how to cancel my attempt!

@RohanMishra315
Copy link

Hey @Tpuljak the changes should be made in the daytona/pkg/ssh file right ? whatever new commits need to be done.

@Tpuljak
Copy link
Member

Tpuljak commented Oct 8, 2024

Hey @Tpuljak the changes should be made in the daytona/pkg/ssh file right ? whatever new commits need to be done.

I don't think so. I think a new option needs to be added to the ssh config that we add (https://github.com/daytonaio/daytona/blob/main/cmd/daytona/config/ssh_file.go). I'm not completely sure so you'll need to test this out yourself.

@Abiji-2020
Copy link
Contributor

@bryans-go any further update on this? If not let me start working on it?

@divanshu-go
Copy link
Contributor Author

@Abiji-2020 feel free to open a PR. I'm still working on it but couldn't find a solution for it.
I'm not assigned to the issue means you can even raise a PR without asking from me.

@Abiji-2020
Copy link
Contributor

Add support for X11 forwarding via a flag in the daytona ssh command (e.g., -X or -Y)**

Description: Daytona CLI currently does not support X11 forwarding for SSH connections, making it difficult to run GUI applications remotely.

For reference, a useful guide on enabling X11 forwarding is available here. It outlines configurations for both Linux and MacOS, and there's also a guide for Windows.

Solution: Users should be able to pass a flag to daytona ssh to enable X11 forwarding, or receive steps on how to configure it manually.

In this we need to implement the client or server i.e we need to run a remote GUI app in the daytona or we need to forward the daytona server to be connected from external server??

@vedranjukic
Copy link
Member

@Abiji-2020, what would be the use case for connecting the daytona server from an external server?

@Tpuljak
Copy link
Member

Tpuljak commented Oct 15, 2024

@bryans-go can correct me if I'm wrong, but I believe the use case for X11 forwarding would be that users can run GUI application inside a Daytona project and them being able to view the app when connected via SSH.

@divanshu-go
Copy link
Contributor Author

divanshu-go commented Oct 15, 2024

@Tpuljak Exactly ! Thanks for this because a lot of users are not aware about this functionality of ssh.
and thats why I am referencing https://www.baeldung.com/linux/forward-x-over-ssh .

@divanshu-go
Copy link
Contributor Author

Note: the current ssh server implementation lacks support for X11 requests.
https://github.com/daytonaio/daytona/tree/main/pkg/agent/ssh

@Tpuljak
Copy link
Member

Tpuljak commented Oct 21, 2024

Note: the current ssh server implementation lacks support for X11 requests. https://github.com/daytonaio/daytona/tree/main/pkg/agent/ssh

@bryans-go are you saying that the lib that we use for SSH does not have support for X11 or is it simply lacking from our implementation?

@divanshu-go
Copy link
Contributor Author

divanshu-go commented Oct 21, 2024

I meant that the lib (gliders/ssh) doesn't have direct support or inbuilt support for x11, we can do a workaround using crypto ssh (gossh) to implement x11 request handler in our ssh server implentation
you can visit here https://pkg.go.dev/github.com/juser0719/teleport/lib/sshutils/x11 for more related functions to it

@Tpuljak
Copy link
Member

Tpuljak commented Oct 21, 2024

I meant that the lib (gliders/ssh) doesn't have direct support or inbuilt support for x11, we can do a workaround using crypto ssh (gossh) to implement x11 request handler in our ssh server implentation you can visit here https://pkg.go.dev/github.com/juser0719/teleport/lib/sshutils/x11 for more related functions to it

If there's a way to "inject" that functionality without completely rewriting the SSH server, then I don't see why not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest Hacktoberfest Issues ⚔️ Quest Tracks quest-bot quests
Projects
None yet
Development

No branches or pull requests

6 participants