Skip to content
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

Test: "Install 'defaultExtensions' through client if remote server cannot access marketplace" #241779

Open
2 tasks
joshspicer opened this issue Feb 24, 2025 · 0 comments
Assignees
Milestone

Comments

@joshspicer
Copy link
Member

joshspicer commented Feb 24, 2025

Refs: microsoft/vscode-remote-release#9090

Complexity: 4

Create Issue


In this TPI you'll test a fallback option for installing extensions that Remote - SSH utilizes.

Prerequisite

Set up some remote host that does not have outbound access to the internet. The remote needs to fail to download extensions from the internet when initialized.

Here are some options of how to do that:

[Option 1] Use a docker container as your remote

Here's a pre-made docker configuration that should work as your "remote" machine to SSH to.

The SSH server listens on 'localhost' post 1234.

[Option 2] Firewall on a linux VM

An easy way to block network access on a linux box is to install ufw (uncomplicated firewall) and run the commands:

sudo apt install ufw   # or similar for your distro
sudo ufw status allow 22
sudo ufw default deny outgoing
sudo ufw status verbose # check your firewall rules (make sure you don't block inbound ssh!)

sudo ufw enable

[Option 3] Block DNS requests

You should also be able to emulate this issue if you aren't able to resolve the DNS name marketplace.visualstudio.com on the remote. You'll still need to be able to resolve this on the local side.

TPI Steps

  1. Ensure you don't have any extensions cached by deleting ~/.vscode-server-insiders on your remote machine
  2. Add some marketplace extensions to the remote.SSH.defaultExtensions setting. For example, in settings.json:
{
  "remote.SSH.defaultExtensions": [
    "joshspicer.touchbarcommandshortcuts",
    "EditorConfig.EditorConfig",
    "MS-vsliveshare.vsliveshare"
  ]
}

3 Connect to the host with Remote - SSH.
4. Confirm that the extensions eventually install

Image

You'll see similar messages in the window log

2025-02-24 08:27:03.021 [info] [Window] Installing '2' extensions relayed from server
2025-02-24 08:27:03.045 [warning] [Window] Relayed failed extension 'joshspicer.fakefakefake' from server is not found in the gallery
2025-02-24 08:27:03.045 [info] [Window] Downloading the 'joshspicer.touchbarcommandshortcuts' extension locally and install
2025-02-24 08:27:03.291 [info] [Views] Added views:workbench.panel.repl.view in workbench.panel.repl
2025-02-24 08:27:03.568 [info] [Window] Downloaded extension: joshspicer.touchbarcommandshortcuts /Users/jospicer/.vscode-oss-dev/CachedExtensionVSIXs/joshspicer.touchbarcommandshortcuts-0.0.2
2025-02-24 08:27:03.670 [info] [Window] Successfully installed 'joshspicer.touchbarcommandshortcuts' extension

Somewhere on the remote machine you should expect there to be logs with the string Relaying the following extensions to install later.

[~/.vscode-server-insiders]$ grep -ir relay ~/.vscode-server-insiders

/Users/jospicer/.vscode-server-oss-dev/data/logs/20250224T150831/remoteagent.log:2025-02-24 15:08:32.842 [info] Relaying the following extensions to install later: joshspicer.touchbarcommandshortcuts, joshspicer.fakefakefake

If you encounter any issues, please share both your 'window' log, Remote - SSH output log, and any logs on your remote machine similar to above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants