Lets talk Gitpod Local Companion localhost

I just read this tweet about a Gitpod blog “Gitpod Local Companion - localhost is going remote” about being able to use local host connected with your Gitpod session.

Can we talk about it. What are people finding it like?

Any time line for two way tunneling?

My use case would be to be able to compile C++ code using Gitpod and then using localhost be able to flash that code to micro-controller devices, much like platform.io which also uses VS code.

Hope Q3, to support it automatically. But btw since you have SSH now, you can make use of all SSH goodness, including remote port forwarding. Just don’t forget to use -F /tmp/gitpod_ssh_config {workspace-id} as a host. It would be interesting to know whether it works for you.

…tried it, worked like a charm, annoying that it gets auto local port forwarded again, something we can improve with native integration :smiley: the command was in my case: ssh -R 8080:localhost:8080 -F /tmp/gitpod_ssh_config coffee-aphid-lcm6bu7l -N

2 Likes

@akosyakov

So mine seems to work, although not really sure how to use it. What I am interested in is flashing code to an Arduino using the arduino-cli a quick test of if the client has access to the COM port would be


brew install arduino-cli


arduino-cli board list

If anything is plugged into the COM port it should showup (Might have to be an Arduino). Any suggestions?

More information about the arduino-cli here

If this can eventually be done, I will add a video to my Gitpod playlist here

I guess a more general question, would be, can localhost access a COM port through VS Code, and do we have any examples of that happening?

I guess a more general question, would be, can localhost access a COM port through VS Code, and do we have any examples of that happening?

As far as I understand serial ports operate on the physical level and we tunnel only the transport (TCP). You will need something which connects the serial port over TCP/IP. Maybe try suggestions from here https://stackoverflow.com/a/22689163/961588 or https://superuser.com/a/717886

btw platformio seems to have own solution which flushes through their servers: PlatformIO Remote Agent — PlatformIO latest documentation

1 Like

Thanks @akosyakov

A while ago I got platformio working on gitpod here I will look into their remote agent.

I wonder whether anyone try to use remote interpreter feature of JetBrains IDEs with the local companion? They seem to support php, node.js any python. For instance, from PHPStorm: Configure remote PHP interpreters | PhpStorm cc @shaal

@akosyakov I’m testing this now. I’m not sure if I test the right thing?
In GitHub - shaal/DrupalPod: Start Drupal contributions with 1 click. I have a script - .gitpod/phpstorm.sh, which opens PHPStorm on port 9999.

When I have the Gitpod Local Companion running, I can also open it on localhost:9999.

As far as I can tell the experience works well (the same) on both https://9999-gray-heron-a676soyj.ws-us11.gitpod.io/ and localhost:9999

Do you mean you run PhpStorm wtihin the gitpod workspace? In such case you don’t need the local app.

The idea of the local app that you use your local PhpStorm to have native experience instead of using browser and connect it via SSH to the gitpod workspace.

1 Like

@akosyakov I finally had chance to test this out.
Using Gitpod Local Companion, I was able to connect VSCode to Gitpod as a remote repository :tada:

I tried doing a similar thing using PHPStorm, but for some reason it wouldn’t let me,
here’s a screenshot:

Do you see what might be wrong here?

1 Like

I don’t think Host looks good, it should be Hostname from the config file, i.e. 127.0.0.1. Have you tried?

So PHPStorm does not allow to configure path to a ssh config file?

Thank you @akosyakov
You were right, the Host should be 127.0.0.1
PHPStorm does support ssh config file, in the screenshot you can see they call it Private key file -

I tried following phpstorm documentation - Create New Project: Add Remote Server | PhpStorm

I can create SSH Configuration, but the only way to utilize it seems to be SFTP connection.
So for now, using that SSH configuration, I can open Tools->Start SSH session,
And it will open PHPStorm terminal that connects directly to my Gitpod’s workspace.
But I could not find a way for PHPStorm to load remote project, to be able to utilize the IDE locally and work on remote project that is on Gitpod.

2 Likes

I meant using remote intepreters like in here: Remote PHP Interpreters in PhpStorm 8 - YouTube
Indeed you will need to use SFTP to mount remote workspace to edit files via PHPStorm, unfortunately they don’t support virtual filesystems yet.

Are there any updates on the two way tunnelting feature? Would be great to have an easy ‘out-of-the-box’ solution beside using chisel or ssh

Unfortunately not for Q4 we are focusing on brining JetBrains Remote Dev support right now. We should have more time Q1/Q2 next year to bring the local app to GA.

cc @loujaybee

Please look at this comment for the current workaround: https://github.com/gitpod-io/gitpod/issues/6240#issuecomment-944960645

1 Like

thanks for the fast update and the workaround link! I’ll continue using chisel inbetween as workaround. Looking forward to Q1/Q2 next year ;)…

“Local companion” is “open in vscode” right?

How do you guys deal with Gitpod overwriting the ssh config path everytime?
Screenshot 2021-11-30 at 10.16.48

I have other VSCode server(s) and I have to re-edit my SSH config path every time after using Gitpod

(I have to use other server because gitpod does not provide GPUs, so I use my own GPUs)

Unfortunately it is blocker for now: Gitpod Remote extension overrides `remote.SSH.configFile` setting · Issue #5889 · gitpod-io/gitpod · GitHub We looked into alternatives way, but have not had real opportunity to work on improving it yet.

2 Likes