vscode-remote-release icon indicating copy to clipboard operation
vscode-remote-release copied to clipboard

Do not install extensions on start up when remote does not support installing extensions

Open sandy081 opened this issue 1 year ago • 4 comments

I see users are having remote set up with limited network connectivity. In such cases they can configure to install extensions on remote by downloading them locally enabling setting - remote.downloadExtensionsLocally. This will download extensions locally and install the downloaded extensions in the remote.

But I see dev containers and remote SSH extensions start servers on remote with passing extensions to install on start up. If remote cannot support installing extension (recently have issues with signing verifications), then this is can lead to remote not working or taking long time to start or with some bad experience.

Hence, I would recommend remote extensions not to start server with installing extensions in these situation and install the extension after starting the server via client.

sandy081 avatar Jun 21 '24 15:06 sandy081

@sandy081 "install via client" would be using the VS Code CLI on the remote or locally?

chrmarti avatar Jun 24 '24 07:06 chrmarti

Via client => Locally. There is a command to install extension which you can use to install.

sandy081 avatar Jun 24 '24 07:06 sandy081

I can also provide a new command that can do bulk install of extensions.

sandy081 avatar Jun 24 '24 08:06 sandy081

I'm in support of this idea/behaviour, have a related open ticket: https://github.com/microsoft/vscode-remote-release/issues/9090

jzyrobert avatar Jun 24 '24 11:06 jzyrobert

How do I know that I'm in this situation, do we need to test connectivity (in bash/powershell) here? Can the CLI do this and fail more gracefully when the extension can't be installed? It just seems easier to implement on that end.

roblourens avatar Jul 01 '24 18:07 roblourens

I guess we could by the remote.downloadExtensionsLocally setting. What might work more seamless for the user though is if the server would remember which extensions should be installed when downloads fail and let the UI do the downloading once it connects to the server.

chrmarti avatar Jul 02 '24 06:07 chrmarti

That extension can be configured on the remote, meaning the resolver can't necessarily read it before connecting and deciding whether to install extensions.

roblourens avatar Jul 02 '24 17:07 roblourens

That extension can be configured on the remote

Can you please describe more?

My proposal here is to install extensions on remote via client after connecting to the remote

sandy081 avatar Jul 03 '24 15:07 sandy081

Sorry, I meant 'setting', just that we can't check that setting while running the resolver.

The reason we've wanted to do this via the CLI before fully connecting is that we can avoid having to reload the window again after extensions get installed.

roblourens avatar Jul 03 '24 18:07 roblourens

I have a question, vscode should currently support remote server development in a restricted network environment (without Internet connectivity), right?

Blues-star avatar Jul 04 '24 09:07 Blues-star

The reason we've wanted to do this via the CLI before fully connecting is that we can avoid having to reload the window again after extensions get installed.

I do not think a reload is required when extensions are installed. They can be enabled immediately.

sandy081 avatar Jul 09 '24 10:07 sandy081

numerous open issues related for SSH: https://github.com/microsoft/vscode-remote-release/issues/5927#issuecomment-2542472315, https://github.com/microsoft/vscode-remote-release/issues/9090, https://github.com/microsoft/vscode-remote-release/issues/9454

joshspicer avatar Jan 23 '25 17:01 joshspicer

I think for Dev Containers configuring the proxy in Docker should make it work (https://docs.docker.com/engine/cli/proxy/). Docker will then set env variables on all containers that are also passed to the server startup. This only supports basic auth though.

The other remote extensions could pick up the proxy env variables from probing shell env variables.

chrmarti avatar Jan 24 '25 09:01 chrmarti

~~Working on a solution here: https://github.com/microsoft/vscode/pull/238815~~

joshspicer avatar Jan 28 '25 19:01 joshspicer

We have a fallback mechanism now for when --install-extension is used on server launch, but for whatever reason the extension fails to install.

In my testing (where I deny access to the marketplace on the remote), things work great. I can imagine there are other network configurations (silently dropping or allowing the request to timeout?) that perhaps would still cause problems

Closed this issue as tracking that work

joshspicer avatar Feb 21 '25 18:02 joshspicer