-
Notifications
You must be signed in to change notification settings - Fork 293
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
Use VS Code Remote with offline client #1242
Comments
Hmmm the number of permutations here could get pretty large over time. We now have:
Planned:
There's a number of others that have been requested ranging from MIPS and Power PC to alternate operating systems like BSD. I'm sure musl/Alpine for ARM will come up. Clearly we would need a solid Node implication to step into any of these along with community test support, but it illustrates a general class of problem that the dynamic story solves. I guess we'd likely need a page with all the different permutations people can grab. |
1.) As mentioned in #15, settings should be provided to choose the server to download (in the Settings UI as well as obviously 2.) Users should probably be able to choose to download more than one server. Then when client connects to the host, the extension does a check to see which server it should use. Discovering this, it then transfers the server over to the host and does the install. 3.) Extensions should be downloaded for use by the server at the same time as the server downloads based once again upon the architecture. For now, we just need 1 done followed by 3. 2 is an eventual need for some users but probably not as much of a need as 1 and 3. |
I mentioned this in #15 but I would like to mention it here too. The C++ extension from Microsoft seems to handle this well by providing the offline installers for the components that get downloaded (https://github.com/microsoft/vscode-cpptools). Granted remote plugin is slightly trickier in that it really needs to exist on two machines but I would think that we could use a similar mechanism to download whichever permutations we want/need to our local machines (or a network share) and then use a setting to specify the location from which to pull the server files. The setting could default to empty or to some other value to indicate that it should be downloaded from github as it does now but if it's set to a path (local or network share), then it should look for the needed server in that location. I think it would be reasonable for the plugin to do a quick (short timeout) check for internet to see if there are any newer versions of the server and produce a warning message that newer versions are available but should still use the version of the server from whatever location is specified. |
Why wouldn't we just cache whatever we determine at runtime after an update and use the cached copy until the next update. Most users will have connectivity at some point, its really just about getting this working at home or on the go when I may not have internet 24/7. The configuration is also quite static. I will only be using it on a specific machine with a specific setup, sure there are lots of permutations but VSCode is already doing the work of figuring out which files to download, it sounds like a simple change to cache that and use the cached copies if no updates are needed. Additionally if it couldn't connect to the internet it would skip updating the files and just run as is. |
There are corporate and government networks as well that may be more lenient with the client OS but not the remote server. I have such a case for my use-case. Nobody developing at home should need to worry about it if it's personal network. That should simply be a matter of updating FW rules to allow traffic from the endpoints they specify in the docs. |
@strike5150: Don't be so sure about "most" users having connectivity at some point. Many corporations don't allow internet access except via a protected browser. Other applications are firewalled and can only access the internal network. Those that use VSCode at my work have to manually download update and extension files. |
Agree with @BMellor . A lot of corporations do not allow internet access because of information security concern. |
Can you open a new issue and explain some more, and include the log from the Remote-SSH output channel? |
I think i might have solved the problem. Thank you for your attention. @roblourens I reviewed the javascript code of the vscode-remote-ssh. It seems that the plugin is trying to use wget on the target machine to get something from the localhost, which is the target machine, to check if the server is working. But mine plugin seems to always get a invalid output from the wget command. I double checked my vscode configuration on two machine (offline and online), and found that the offline machine has a vscode-remote-ssh plugin at version 0.45.2. However, the online machine, which is the one works fine, had a vscode-remote-ssh plugin at version 0.46.1. I upgraded the plugin of the offline machine to 0.46.1 and all problems were solved. The issue should be caused by the mis-match version of plugin and server, though the root-cause is not clear yet. |
I think we should have two settings:
As 2 , Can we use local host as a proxy to install remote-ssh( And I think this can be default). And another suggest: |
2 is already supported, like the OP says. You can set |
A quick fix for now that should be enabled anyways: Fix this error: How is this error generated? Assuming someone manually grabbed the tar.gz manually, then installed it on the remote host: Update the extension, This error can been seen when looking at extensions. The actual output says something about curl failing. Seeing how the client refused to connect due to a hard-coded line for the version, this makes sense. The server should at least allow the last 5 versions to work before providing a prompt in a Windows Dialog preferably to install a new version with a link to the servers provided for quick easy one click download, which we could click on when disconnected from the corporate network. At that point we could then save it to wherever the server temporarily lives on client side, tell the extension to look for it when attempting to connect once the secure connection between client and host is in place. Discovering it, it will then proceed with the scp and installation process. |
Is this the same as #1242? |
I would consider it a sub task. Though I actually tested the recent Nightly and it appears that whenever you update VSCode, the issue I mentioned above (and also #1802 (comment) ) occurs. Updating the extension itself no longer seems to be the problem, perhaps it never was. So more accurately, VS Code should keep compatibility with the previous 5 servers. I think it's a check in the extension that verifies the server version is the same as what's reported by VSCode (Insiders) and so fails if they mismatch. IMO the only reason the server shouldn't work is because it becomes too incompatible with the VSCode client. Connecting itself should never be the problem. |
Its been around 2~3 months since the last comment here, Is there any update in this regard? should we or can we be expecting something in near future(even possibly the next release) to address this ? |
I use this trick for both side offline connection. |
@fakhamatia Some WiFi routers running OpenWRT Unix has SSH Server package installed. Check your model in OpenWRT portal |
Have there been any advancements towards using Remote SSH when neither hosts are connected to internet ? Thanks |
Have there been any updates on this? Is it on the roadmap? |
Where can I find older versions? I have an older version of vscode 1.52.1 on an offline network. I can't update vscode but would like to add the extension... I think it is 0.64.0_1 that I need... |
Just wanted to support this issue. I have been bitten by it multiple times already. I want to thank anyone that may be looking into it. |
+1 |
One way to get it done: |
If anyone needs to do this — here's an approach that worked for me for the past couple of years:
|
upping again: this is a major inconvenience as I use dev containers to make programming on Windows acceptable. right now, even though the image is available locally, i am unable to start the dev container when im not connected to the internet. |
I have already posted this comment in issue #1802, but duplicating here. It is quite ridiculous that even though I have connected to the same Docker container hundreds of times before and should presumably have a cached copy of the VSCode server locally, I cannot connect to it when offline. The fact that I need an internet connection for something that is entirely local is mind boggling. If I am on the go, in an airplane, or in a cafe and don't want to use the public Wifi, tools should work without a constant internet connection. Please please fix this, this is embarassing! |
It's still possible via modifying the JS file, but the link is outdated. You have to edit other lines right now. |
The Link is working for me, but the described method isn't. I got stuck at the "Download VS Code Server..." Message... |
For those asking about the status in the Remote - SSH extension: The Edit : I've validated that "offline mode" does work end to end with the default settings. If you're having problems, you can also try disabling To validate, I "airgapped" a remote machine by denying all inbound/outbound access on a VM with iptables: With these settings I was able to connect to this remote machine from my Mac. In the logs you'll see an initial wget/curl fail (since the host is "airgapped") and then (by default) scp is used to copy over the bootstrapping server.
Lastly, I'm seeing some comments in this thread regarding dev containers - please redirect that feedback to #10173 so its seen by the relevant folks |
#15 improved the experience when connecting to a host that isn't connected to the internet. Some users also need to connect from a client that is not connected to the internet. This would require a way for them to manually download the server and set it up on the host, or give it to the client to transfer to each host. And the user would have to do this after every vscode update.
The text was updated successfully, but these errors were encountered: