-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Local companion expose port of local machine to remote machine #6240
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
Comments
You can use ssh port forward |
Working on that now. |
But I'm getting connection timed out
|
Host name seem error, it not contain gitpod.it |
Open and check host name. C:Users\SomeUser\AppData\Local\Temp\gitpod_ssh_config |
ssh -F C:\Users\SomeUser\AppData\Local\Temp\gitpod_ssh_config -R 2331:localhost:2331 teal-cougar-a34yifdw.ws-us17.gitpod.io |
ssh -F C:\Users\SomeUser\AppData\Local\Temp\gitpod_ssh_config -R 2331:localhost:2331 teal-cougar-a34yifdw |
Just use host field |
The GDB server I am using now fails to start after succesfully ssh forwarding the port. |
Wait a second |
Should I run this from my remote workspace? |
About to try. Doesn't have anything to do with the fact that I'm just trying to serve up a raw tcp socket? |
yes, you need open. |
you can start GDB first then start ssh forward |
Will try |
you can try http first , exclude the reasons |
I described found approach in Discord and want to repost it here because spend a lot of time getting it to works. Companion App should be run with 'auto-tunnel=false'. "gitpod-local-companion-windows.exe --auto-tunnel=false". Pay attention to run ssh with localhost cause as I understood, Companion App will proxying shh to Gitpod by itself. Necessary to use 'auto-tunnel=false' because when Remote Port Forwarding forwards local opened port 3333 to the remote side, the function 'auto-tunnel' see that the forwarded port 3333 showed up on the remote side and it tries to open the same port 3333 on the local side again in the backward direction. But will falls cause GDB already used the same port. Another bad case without 'auto-tunnel=false' is that GitPod remembers previously opened ports on the remote side and if try to run Companion App before GDB it opens successfully port on the local side and GDB will fall cause the port will be busy. Also, the approach works on Linux but is broken on Windows. |
In the related issue #6247 with remote port forwarding, we have resolved another connection problem. For future readers: "localhost" can be resolved by the system to ipv6 "::1" address. If a target application listens on the ipv4 address -- the port forwarding will not work. In the case of embedded development, such tools like J-Link GDB and OpenOCD listens to on ipv4 address. So, the resulting command lines should be like:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Spoke with a user about this today (@konne) the use case is this:
I'll see if @konne is able to provide a replication of this setup, if not we can also create one to support with this issue. |
Related internal document [1] |
If anyone would be interested in using from their code the described approach of opening local ports, I have a Rust library which I have used to do it. The library can open local ports to remote GitPod instances by passing hostname of instance, ran instance ID and desired ports. It is poorly designed. In particular, there is long blocking on some function calls. But as an idea it works and may end up helpful to someone. |
Thanks for raising @0Grit ! For remote port forwarding, please see:
Which should be compatible with the copy/paste SSH which you can get from the dashboard:
A nice extension here would be to provide out of the box methods to do typical But that would also require: So unless there's anything else required here, I'll close the issue 🙏 Also added some notes to: To better document some local app functionalities, as described above by @ila-embsys |
I need to debug embedded targets that are physically connected to my local machine and or network.
The path of least resistance for the moment is to have a gdbserver listening on port 2331 waiting for a gdb client within the remote workspace to connect.
The text was updated successfully, but these errors were encountered: