-
Notifications
You must be signed in to change notification settings - Fork 331
Persistent SSH session #3096
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
#1790 also related. |
Not a perfectly solution, but what about opening the terminal into Screen. Users could reconnected back to their screen session each time, also gives more fine grain control over resource releases (properly terminating a process vs an always persistent session) |
This is a well-known pattern in the Cloud Applications. The problem is always that lifecycles of Server and client are not synchronized and either server or client or connection can go down at any point all clients will hang. Then, clients have to re-authenticate. If the client is idle at the point of time was idle its user will have no knowledge of how to proceed. To avoid such a died-end situation client needs awareness of the "session status" i.e. Server needs session management and ability to report either current session status to the client, at least, by the explicit client's request or every re-connect request coming from the client has had session attribute. There is also a security risk that the session can be hijacked by anybody who has a valid login of the server when the client was idle. |
Glad I found this! Just wanted to mention that I believe this is far larger in scope than the Julia extension. I bet most people forced to work from home these days would really appreciate this feature! |
This is what i need for stop using RDP to remote developmet. Sometimes i need keep service runing for several days and i don't want keep my own pc on just for it. Keep process running without vscode remain connected and re-establish connection/state after re-open vscode will be amazing! |
This would be a real game changer for myself, and I believe, a whole lot of people. Now I use tmux to achieve the same but it is uncomfortable in many ways |
Glad to hear that this feature request was received, it would be very useful for my working context. |
Is there any progress on this feature recently? |
Hopefully the timeout considers people coming back to work from long weekends, and resuming/waking up a sleeping computer/laptop :) |
Agreed, e.g. tmux interferes with mouse scrolling, and does 100x other things on top of having just a persistent SSH session. Considering vscode has a server running remotely... it shouldn't be impossible to have a |
It has been nearly two years since this issue opened. Could we pay a little attention to solve the problem? I think it is a great improvement to users. |
@davidanthoff Is there some kind of workaround available for a remote and long-lasting Julia session, that would allow disconnecting and reconnecting multiple times without losing the (remote) Julia REPL ? |
@lrnv It supports tmux now https://discourse.julialang.org/t/ann-vs-code-extension-1-2-released/62118 |
I would be happy if VS code finally managed to restore all terminals properly after SSH disconnect. My major pain with tmux in VS Code Remote is that I can't copy&paste text to my vs code editor. Is there an easy way to fix it? I tried xclip on my remote Ubuntu and set -g mouse on
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -se c -i"
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -se c -i" from https://www.vinnie.work/blog/2020-11-24-why-so-hard-tmux-copy-paste/ article without any success. Apparently it is not good for VS code terminal approach which is understandable - we have another link in our chain (Mac <-> Ubuntu <-> tmux ) |
For the time the code server keeps running, either the default time-out or when keeping it running forever using this solution #3096 (comment), how can I reconnect to it? For me even if on the host the code server and all related processes are still running, when I reconnect to the host (even if the ssh connection is only interrupted for a few seconds), it starts a second code server on the host instead of reconnecting to the old one. |
Has anyone tried a simpler way to create a tunnel with https://code.visualstudio.com/docs/remote/tunnels ? I'm only worried that this "server" Edit:tl;dr doesn't work like we expected I tried it. It's kind of scary, but fairly simple. The important thing is that You need to install code on the server (e.g. the deb package). The After you run Then you can click the link to open VSCode in browser and again authenticate to gain access to the machine. I did it, and the machine also showed up in my remote explorer on the locally installed VSCode. When I closed the browser I could still use my remote connection from my PC. I guess you could try to skip this step and manually add this remote server to your local VSCode by URI, without opening the browser. The browser version works nicely, because it preserves all windows and terminal sessions. Unfortunately, desktop VSCode treat this connection slightly differently, because it ties all editor and terminal windows to specific desktop instance. Once you close the VSCode window all progress is gone. |
Any updates on official support for this feature? |
hey, any updates here? |
Yeap, we need this feature!! And there must also be support for Jupyter Notebooks |
AWS Cloud9 already has this persistent feature for years and years now. Gitpod also provides this via their own extension, however, it's tied to Gitpod servers (arguably cheaper than Azure Dev Box) and you need to configure timeouts to be higher than default (depending on your usecase). So, the possibility is there, it's just not getting enough attention. I wonder why this stays stall for a long time, and yet it's got lots of demands. |
4 years later, and this issue still open. |
I think (but I still have not tested) that here is the problem |
Interesting finding. So you're saying that you've tested it and it became persistent afterwards? |
Any updates on this? For remote AI training on GPU machines this is going to be such a huge quality of life improvement. |
Another vote for this! |
For those who consider persistent ssh session as a critically important feature, you can also try JetBrains Fleet. By utilizing its collaboration feature(which is similar to vscode-tunnel), it keeps terminals and debugging sessions after client being closed. Though it's not open source, and it does not even support plugins. |
I also think we need this. And the worst part is how it is so easy to implement by making the stupid --enable-remote-auto-shutdown optional from the settings yet it has been 4 years and no progress. |
Is there a confirmation from the team that PRs with a flag in extension settings for |
@ionagamed The microsoft remote development extensions are not open source (see #30). From my exploration, the struct CodeServerArgs in code_server.rs needs to have an additional Option argument (e.g. keep_alive), which needs to be used in the listen_on_port function. To actually wire this back up to the extension settings, we would need permission to access and directly contribute to the actual extension. It's so infuriating that they have close-sourced the extension and simultaneously don't bother with SIMPLE quality of life improvements because they are focused on the (profitable) dev containers project, or the Microsoft hosted remote - tunnels, for which the rug can be pulled at any time. We should just write our own remote ssh dev extension. |
That would be a great addition |
I want this too. |
this would be great! |
Any news regarding this feature? This would be a great improvement. In my usecase, when I build a devcontainer, it might take hours, and I don't want to keep VSCode open on my laptop for that long - I'd like to close VSCode, do something else on my laptop, and reattach peoredically to check the progress. For now, as a workaround, I'm inspecting logs of devcontainer and running them manually with |
I've been using |
Thanks much for this idea! It did not work for me directly - I guess .../.vscode-server is executed with "#!/usr/bin/env sh" which still points to /usr/bin/sh, rather than one in the PATH. I got it working via another dirty hack:
and creating slightly modified version of your suggestion in
I have observed side effects as some errors reported on vscode startup, but no visible issues otherwise. BTW, instead of using those two I suspect in the above line better to quote |
Please please please please please |
Any updates on this long-lasting issue? |
As part of my work I often find myself starting a long-running command (e.g. a build) in a VS Code Terminal, and then close my laptop and go to a meeting. When I open my laptop again 30 minutes later, I have to run the command again because the VS Code server bailed while I was away. This is quite annoying - at the very least the grace period should be customizable (I would personally set it to something like 3 hours). |
A lot of users of our Julia extension love the remote SSH features, they are super useful in a scientific research computing context!
One thing that has come up a lot lately, though, is that folks want an ability to have a persistent session on a server that they can disconnect from and then reconnect to way later.
The scenario is essentially something like this:
I think this might be related to #440, but what I'm really asking for is not just an option to change the timeout, but some way to make the timeout infinit, so that the server session never shuts down.
This might also require some kind of UI, maybe a command like "Disconnect but keep server alive" or something like that, not sure.
The text was updated successfully, but these errors were encountered: