microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.67k stars 293 forks source link

Update default extensions on every connection #463

Open jsochacki opened 5 years ago

jsochacki commented 5 years ago

Steps to Reproduce:

  1. Use the following script to generate a dedicated ssh key and upload to remote server
    
    #!/bin/bash
    # set -x
    if [ "$#" -ne 5 ]; then
    echo "Usage: setup_ssh_key.sh <LOCAL_UNAME> <USRNAME_ON_HOST> <MACHINE_IP> <MACHINE_NICKNAME> <SSH_PORT>"
    echo "<MACHINE_NICKNAME> is literally whatever you want it to be but"
    echo "will be what you type after ssh, i.e. ssh <MACHINE_NICKNAME>"
    echo "and this will dealias to ssh $USRNAME@$MACHINE_IP -p <SSH_PORT>"
    echo "Unless this is a special case <SSH_PORT> should be 22"
    exit
    fi

LOCAL_UNAME=$1 USRNAME_ON_HOST=$2 MACHINE_IP=$3 MACHINE_NICKNAME=$4 SSH_PORT=$5

mkdir -p ~/.ssh sudo chown $LOCAL_UNAME ~/.ssh sudo chgrp $LOCAL_UNAME ~/.ssh

echo "running keygen"

ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa-remote-ssh-$MACHINE_NICKNAME

echo "adding Host to .ssh/config"

echo "Host $MACHINE_NICKNAME" >> ~/.ssh/config echo " HostName $MACHINE_IP" >> ~/.ssh/config echo " Port $SSH_PORT" >> ~/.ssh/config echo " User $USRNAME_ON_HOST" >> ~/.ssh/config echo " IdentityFile ~/.ssh/id_rsa-remote-ssh-$MACHINE_NICKNAME" >> ~/.ssh/config

echo "adding IdentityFile ~/.ssh/id_rsa-remote-ssh-$MACHINE_NICKNAME to authorized_keys on $MACHINE_NICKNAME"

sudo ssh-copy-id -i ~/.ssh/id_rsa-remote-ssh-$MACHINE_NICKNAME.pub -p $SSH_PORT $USRNAME_ON_HOST@$MACHINE_IP

If you don't do this programs wont be able to load the key

sudo chown $LOCAL_UNAME ~/.ssh/config ~/.ssh/id_rsa-remote-ssh-$MACHINE_NICKNAME ~/.ssh/id_rsa-remote-ssh-$MACHINE_NICKNAME.pub sudo chgrp $LOCAL_UNAME ~/.ssh/config ~/.ssh/id_rsa-remote-ssh-$MACHINE_NICKNAME ~/.ssh/id_rsa-remote-ssh-$MACHINE_NICKNAME.pub

echo "Done"

2.  Use VScode to connect to remote server with the following setting .json

{ "vs-kubernetes": { "vs-kubernetes.helm-path": "/home/nogood/.vs-kubernetes/tools/helm/linux-amd64/helm", "vs-kubernetes.draft-path": "/home/nogood/.vs-kubernetes/tools/draft/linux-amd64/draft", "vs-kubernetes.minikube-path": "/home/nogood/.vs-kubernetes/tools/minikube/linux-amd64/minikube", "vs-kubernetes.kubectl-path": "/home/nogood/.vs-kubernetes/tools/kubectl/kubectl" }, "telemetry.enableTelemetry": false, "window.zoomLevel": 0, "breadcrumbs.enabled": true, "files.associations": { "*.rmd": "markdown" }, "editor.suggestSelection": "first", "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", "cmake.configureOnOpen": true, "editor.tabSize": 3, "editor.fontSize": 12, "editor.rulers": [ 80, 120 ], "editor.autoClosingBrackets": "always", "editor.autoClosingQuotes": "always", "editor.dragAndDrop": false, "editor.detectIndentation": false, "editor.parameterHints.cycle": true, "editor.showFoldingControls": "always", "editor.renderLineHighlight": "all", "files.trimTrailingWhitespace": true, "[cpp]": { "editor.defaultFormatter": "ms-vscode.cpptools" }, "editor.minimap.showSlider": "always", "editor.minimap.side": "left", "editor.suggest.snippetsPreventQuickSuggestions": false, "editor.wordBasedSuggestions": false, "files.eol": "\n", "files.trimFinalNewlines": true, "workbench.commandPalette.preserveInput": true, "workbench.quickOpen.preserveInput": true, "workbench.editor.openSideBySideDirection": "down", "zenMode.fullScreen": false, "zenMode.hideActivityBar": false, "zenMode.hideStatusBar": false, "zenMode.hideLineNumbers": false, "zenMode.hideTabs": false, "window.menuBarVisibility": "toggle", "window.restoreWindows": "all", "search.collapseResults": "alwaysCollapse", "search.quickOpen.includeSymbols": true, "search.showLineNumbers": true, "debug.console.fontSize": 12, "debug.console.fontFamily": "'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'", "debug.showSubSessionsInToolBar": true, "scm.alwaysShowProviders": true, "scm.alwaysShowActions": true, "extensions.autoUpdate": false, "terminal.integrated.copyOnSelection": true, "terminal.integrated.cursorBlinking": true, "terminal.integrated.drawBoldTextInBrightColors": false, "terminal.integrated.fontSize": 12, "terminal.integrated.lineHeight": 0, "terminal.integrated.rightClickBehavior": "selectWord", "terminal.integrated.scrollback": 10000, "update.enableWindowsBackgroundUpdates": false, "update.mode": "manual", "bookmarks.backgroundLineColor": "rgba(21, 126, 251, 0.3)", "bookmarks.navigateThroughAllFiles": true, "bookmarks.saveBookmarksInProject": true, "bookmarks.useWorkaroundForFormatters": true, "bracket-pair-colorizer-2.forceIterationColorCycle": true, "bracket-pair-colorizer-2.forceUniqueOpeningColor": true, "bracket-pair-colorizer-2.highlightActiveScope": true, "bracket-pair-colorizer-2.showBracketsInGutter": true, "bracket-pair-colorizer-2.showBracketsInRuler": true, "liveshare.showReadOnlyUsersInEditor": "always", "liveshare.populateGitCoAuthors": "always", "liveshare.allowGuestDebugControl": true, "liveshare.allowGuestTaskControl": true, "liveshare.account": "", "liveshare.accountProvider": "github", "python.condaPath": "/opt/anaconda3/condabin/conda", "python.dataScience.sendSelectionToInteractiveWindow": true, "python.jediEnabled": false, "liveshare.audio.startCallOnShare": true, "git.alwaysShowStagedChangesResourceGroup": true, "git.allowForcePush": true, "git.detectSubmodulesLimit": 20, "sync.askGistName": true, "cmake.saveBeforeBuild": false, "C_Cpp.default.cppStandard": "c++17", "C_Cpp.default.cStandard": "c11", "C_Cpp.default.intelliSenseMode": "gcc-x64", "C_Cpp.clang_formatstyle": "{ AccessModifierOffset: 0, AlignAfterOpenBracket: Align, AlignConsecutiveAssignments: true, AlignConsecutiveDeclarations: true, AlignEscapedNewlines: Left, AlignOperands: true, AlignTrailingComments: true, AllowAllParametersOfDeclarationOnNextLine: false, AllowShortBlocksOnASingleLine: false, AllowShortCaseLabelsOnASingleLine: false, AllowShortFunctionsOnASingleLine: Inline, AllowShortIfStatementsOnASingleLine: false, AllowShortLoopsOnASingleLine: false, AlwaysBreakAfterReturnType: None, AlwaysBreakBeforeMultilineStrings: true, AlwaysBreakTemplateDeclarations: true, BinPackArguments: true, BinPackParameters: false, BraceWrapping: {AfterClass: true, AfterControlStatement: true, AfterEnum: true, AfterFunction: true, AfterNamespace: true, AfterObjCDeclaration: true, AfterStruct: true, AfterUnion: true, AfterExternBlock: true, BeforeCatch: true, BeforeElse: true, IndentBraces: false, SplitEmptyFunction: false, SplitEmptyRecord: false, SplitEmptyNamespace: false}, BreakBeforeBinaryOperators: NonAssignment, BreakBeforeBraces: Custom, BreakBeforeInheritanceComma: true, BreakBeforeTernaryOperators: true, BreakConstructorInitializers: AfterColon, BreakStringLiterals: true, ColumnLimit: 80, CommentPragmas: '^ NOSPLIT:', CompactNamespaces: false, ConstructorInitializerAllOnOneLineOrOnePerLine: true, ConstructorInitializerIndentWidth: 3, ContinuationIndentWidth: 4, Cpp11BracedListStyle: true, DerivePointerAlignment: false, DisableFormat: false, FixNamespaceComments: true, IncludeBlocks: Regroup, IncludeCategories: [{Regex: '\"([A-Za-z0-9.\/-])+\"', Priority: 3}, {Regex: '<([A-Za-z0-9.\/-])+>', Priority: 2}, {Regex: '<([A-Za-z0-9\/-])+>', Priority: 1}], IndentCaseLabels: true, IndentPPDirectives: AfterHash, IndentWidth: 3, IndentWrappedFunctionNames: true, KeepEmptyLinesAtTheStartOfBlocks: false, MaxEmptyLinesToKeep: 1, NamespaceIndentation: All, PenaltyBreakAssignment: 10, PenaltyBreakBeforeFirstCallParameter: 2, PenaltyBreakComment: 1, PenaltyBreakFirstLessLess: 5, PenaltyBreakString: 1, PenaltyExcessCharacter: 1, PenaltyReturnTypeOnItsOwnLine: 1, PointerAlignment: Left, ReflowComments: true, SortIncludes: true, SortUsingDeclarations: true, SpaceAfterCStyleCast: false, SpaceAfterTemplateKeyword: false, SpaceBeforeAssignmentOperators: true, SpaceBeforeParens: Never, SpaceInEmptyParentheses: false, SpacesBeforeTrailingComments: 1, SpacesInAngles: false, SpacesInCStyleCastParentheses: false, SpacesInContainerLiterals: false, SpacesInParentheses: false, SpacesInSquareBrackets: false, Standard: Cpp11, TabWidth: 3, UseTab: Never}", "editor.formatOnPaste": true, "editor.formatOnType": true, "editor.formatOnSave": true, "editor.autoSurround": "quotes", "remote.SSH.showLoginTerminal": true, "remote.extensionKind": { "peterjausovec.vscode-docker": "workspace", "ms-vscode-remote.remote-containers": "workspace", "ms-kubernetes-tools.vscode-kubernetes-tools": "workspace", "ms-vsliveshare.vsliveshare-pack": "workspace", "ms-vsliveshare.vsliveshare": "workspace", "ms-vsliveshare.vsliveshare-audio": "workspace", "alefragnani.bookmarks": "workspace" }, "remote.SSH.defaultExtensions": [ "peterjausovec.vscode-docker", "ms-vscode-remote.remote-containers", "ms-kubernetes-tools.vscode-kubernetes-tools", "ms-vsliveshare.vsliveshare-pack", "ms-vsliveshare.vsliveshare", "ms-vsliveshare.vsliveshare-audio", "alefragnani.bookmarks" ], "remote.containers.defaultExtensions": [ "peterjausovec.vscode-docker", "ms-vscode-remote.remote-containers", "ms-kubernetes-tools.vscode-kubernetes-tools", "ms-vsliveshare.vsliveshare-pack", "ms-vsliveshare.vsliveshare", "ms-vsliveshare.vsliveshare-audio", "alefragnani.bookmarks" ] }


I have tried all variants of the last three settings such as just using remote.SSH.defaultExtensions or just using remote.extensionKind to no avail.  They will not auto install nor will they appear in the remote workspace for use.  I can connect to and develop on the remote just fine.  I have root and su access as well.  I can install them manually using the UI but the auto install does not work.

"remote.extensionKind": { "peterjausovec.vscode-docker": "workspace", "ms-vscode-remote.remote-containers": "workspace", "ms-kubernetes-tools.vscode-kubernetes-tools": "workspace", "ms-vsliveshare.vsliveshare-pack": "workspace", "ms-vsliveshare.vsliveshare": "workspace", "ms-vsliveshare.vsliveshare-audio": "workspace", "alefragnani.bookmarks": "workspace" }, "remote.SSH.defaultExtensions": [ "peterjausovec.vscode-docker", "ms-vscode-remote.remote-containers", "ms-kubernetes-tools.vscode-kubernetes-tools", "ms-vsliveshare.vsliveshare-pack", "ms-vsliveshare.vsliveshare", "ms-vsliveshare.vsliveshare-audio", "alefragnani.bookmarks" ], "remote.containers.defaultExtensions": [ "peterjausovec.vscode-docker", "ms-vscode-remote.remote-containers", "ms-kubernetes-tools.vscode-kubernetes-tools", "ms-vsliveshare.vsliveshare-pack", "ms-vsliveshare.vsliveshare", "ms-vsliveshare.vsliveshare-audio", "alefragnani.bookmarks" ]



<!-- Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes/No
roblourens commented 5 years ago

Could you share the full log from the "Remote - SSH" output channel?

image

JMDC-SUN commented 5 years ago

It seem remote docker no install extensions. I use a remote docker through by 'Docker Extention' Attach Visual Studio Code. 1) I save all extensions to './vscode/settings.json' in project on Docker Container. 2) I save all extensions to './devcontainer/devcontainer.json' in project on Docker Container. 3) I set "- your-volume-name-goes-here:~/.vscode-remote" to Docker Container.

When I rebuild my container, the remote extensions not be installed. I found '~/.vscode-server-insiders' in Docker Container. If I need set a volume for '~/.vscode-server-insiders' like vscode-remote?

jsochacki commented 5 years ago

Here is what I get, I had to redact some things as this is for internal work

''' SSH Resolver called for "ssh-remote+7b22686f73744e616d6522blablabla" SSH Resolver called for host: blabla Setting up SSH remote "blabla" Using commit id "4ca38ce5584d7cd67b435b3c32ef1240c6a29628" and quality "insider" for server Install and start server if needed

Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-43-generic x86_64)

291 packages can be updated. 84 updates are security updates.

bash: cannot set terminal process group (4968): Inappropriate ioctl for device bash: no job control in this shell Found existing installation... Found running server...

*

10cd1c5c-9011-4119-8109-acf31576dc2c==35987== "install" terminal command done Received install output: 10cd1c5c-9011-4119-8109-acf31576dc2c==35987== Server is listening on port 35987 Spawning tunnel with: ssh blabla -L localhost:7023:localhost:35987 "echo -e 'Connected to SSH Host - Please do not close this terminal' && sleep infinity" Spawned SSH tunnel between local port 7023 and remote port 35987 Waiting for ssh tunnel to be ready Tunneling remote port 35987 to local port 7023 Resolving "ssh-remote+7b22686f73744e616d65223ablablabla" to "localhost:7023", attempt: 1 Connected to SSH Host - Please do not close this terminal

'''

That is the entire output

jsochacki commented 5 years ago

This is supposed to automatically install them correct? I'm not misunderstanding the purpose of those commands am I?

rfgamaral commented 5 years ago

Assuming remote.SSH.defaultExtensions is a list of extensions that should be installed automatically on every SSH Host, it's also not working for me.

Here's what I have on my settings.json:

"remote.SSH.defaultExtensions": [
    "bungcip.better-toml",
    "eamodio.gitlens"
],
"remote.extensionKind": {
    "bungcip.better-toml": "workspace",
    "eamodio.gitlens": "workspace"
}

When I invoke Developer: Reload Window I was expecting the bungcip.better-toml to be automatically installed in the SSH Host, but it was not. I do have the option to install it manually:

image

But as mentioned before, I was expecting and assuming the remote.SSH.defaultExtensions option is to install extensions automatically. Is this assumption wrong or could this be a bug?

Here's my log from the Output channel:

SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a224859504552562d5542554e5455227d"
SSH Resolver called for host: HYPERV-UBUNTU
Setting up SSH remote "HYPERV-UBUNTU"
Using commit id "6964233e81c68f5a5f34e7eb1da0836e1d539f14" and quality "insider" for server
Install and start server if needed
> 
> Pseudo-terminal will not be allocated because stdin is not a terminal.
> 
> Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-50-generic x86_64)
> 
>  * Documentation:  https://help.ubuntu.com
>  * Management:     https://landscape.canonical.com
>  * Support:        https://ubuntu.com/advantage
> 
>  * Ubuntu's Kubernetes 1.14 distributions can bypass Docker and use containerd
>    directly, see https://bit.ly/ubuntu-containerd or try it now with
> 
>      snap install microk8s --classic
> 
>  * Canonical Livepatch is available for installation.
>    - Reduce system reboots and improve kernel security. Activate at:
>      https://ubuntu.com/livepatch
> 
> 0 packages can be updated.
> 0 updates are security updates.
> 
> 
> bash: cannot set terminal process group (56997): Inappropriate ioctl for device
> bash: no job control in this shell
> 
> Found existing installation...
> Found running server...
> 
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
> 
> 
> 6f011ec4-50b0-40c0-b2df-170585e2522b==37301==
> 
"install" terminal command done
Received install output: 6f011ec4-50b0-40c0-b2df-170585e2522b==37301==
Server is listening on port 37301
Spawning tunnel with: ssh  HYPERV-UBUNTU -N -L localhost:29386:localhost:37301
Spawned SSH tunnel between local port 29386 and remote port 37301
Waiting for ssh tunnel to be ready
Tunneling remote port 37301 to local port 29386
Resolving "ssh-remote+7b22686f73744e616d65223a224859504552562d5542554e5455227d" to "localhost:29386", attempt: 1
jsochacki commented 5 years ago

Update, If i install vscode from the server and then re connect like it is a new server It does download all the extensions upon install. The difference between before where it didn't and now was that I had already connected to the server once before adding the lines to my json file. Apparently those lines need to be there before you connect to a server and it does the wget and set up.

Here is what I get now

SSH Resolver called for "ssh-remote+7b22686f73744e616d65bla"
SSH Resolver called for host: bla
Setting up SSH remote "bla"
Using commit id "bla" and quality "insider" for server
Install and start server if needed
> Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-43-generic x86_64)
> 
>  * Documentation:  https://help.ubuntu.com
>  * Management:     https://landscape.canonical.com
>  * Support:        https://ubuntu.com/advantage
> 
>   System information as of Wed May 29 21:59:30 EDT 2019
> 
>   System load:  0.06               Processes:               918
>   Usage of /:   9.8% of 833.87GB   Users logged in:         3
>   Memory usage: 38%                IP address for enp1s0f0: bla
>   Swap usage:   0%                 IP address for docker0:  bla
> 
>  * Ubuntu's Kubernetes 1.14 distributions can bypass Docker and use containerd
>    directly, see https://bit.ly/ubuntu-containerd or try it now with
> 
>      snap install microk8s --classic
> 
>  * Canonical Livepatch is available for installation.
>    - Reduce system reboots and improve kernel security. Activate at:
>      https://ubuntu.com/livepatch
> 
> 291 packages can be updated.
> 84 updates are security updates.
> 
> 
> bash: cannot set terminal process group (26606): Inappropriate ioctl for device
> bash: no job control in this shell
> Installing...
> Downloading with wget
> WARNING: tar exited with non-0 exit code
> Installing extensions...
> Remote configuration data at /home/jsochacki/.vscode-remote
> Installing extensions...
> Installing extension 'aaron-bond.better-comments' v2.0.5...
> Extension 'aaron-bond.better-comments' v2.0.5 was successfully installed.
> Installing extension 'alefragnani.bookmarks' v10.4.4...
> Extension 'alefragnani.bookmarks' v10.4.4 was successfully installed.
> Installing extension 'asabil.meson' v1.2.0...
> Extension 'asabil.meson' v1.2.0 was successfully installed.
> Installing extension 'bramvanbilsen.matlab-code-run' v1.0.2...
> Extension 'bramvanbilsen.matlab-code-run' v1.0.2 was successfully installed.
> Installing extension 'coenraads.bracket-pair-colorizer-2' v0.0.28...
> Extension 'coenraads.bracket-pair-colorizer-2' v0.0.28 was successfully installed.
> Installing extension 'dbatools.search' v1.1.3...
> Extension 'dbatools.search' v1.1.3 was successfully installed.
> Installing extension 'formulahendry.code-runner' v0.9.9...
> Extension 'formulahendry.code-runner' v0.9.9 was successfully installed.
> Installing extension 'gimly81.matlab' v1.1.0...
> Extension 'gimly81.matlab' v1.1.0 was successfully installed.
> Installing extension 'kriegalex.vscode-cudacpp' v0.1.1...
> Extension 'kriegalex.vscode-cudacpp' v0.1.1 was successfully installed.
> Installing extension 'mhutchie.git-graph' v1.7.0...
> Extension 'mhutchie.git-graph' v1.7.0 was successfully installed.
> Installing extension 'mikhail-arkhipov.r' v0.0.6...
> Extension 'mikhail-arkhipov.r' v0.0.6 was successfully installed.
> Installing extension 'ms-kubernetes-tools.vscode-kubernetes-tools' v1.0.0...
> Extension 'ms-kubernetes-tools.vscode-kubernetes-tools' v1.0.0 was successfully installed.
> Installing extension 'ms-python.anaconda-extension-pack' v1.0.1...
> Extension 'ms-python.anaconda-extension-pack' v1.0.1 was successfully installed.
> Extension 'ms-python.python' is already installed.
> Installing extension 'ms-vscode-remote.remote-containers' v0.57.0...
> Extension 'ms-vscode-remote.remote-containers' v0.57.0 was successfully installed.
> Installing extension 'ms-vscode-remote.remote-ssh' v0.37.0...
> Extension 'ms-vscode-remote.remote-ssh' v0.37.0 was successfully installed.
> Extension 'ms-vscode-remote.remote-ssh-edit' is already installed.
> Extension 'ms-vscode-remote.remote-ssh-explorer' is already installed.
> Installing extension 'ms-vscode-remote.remote-wsl' v0.36.0...
> Extension 'ms-vscode-remote.remote-wsl' v0.36.0 was successfully installed.
> Installing extension 'ms-vscode-remote.vscode-remote-extensionpack' v0.14.0...
> Extension 'ms-vscode-remote.vscode-remote-extensionpack' v0.14.0 was successfully installed.
> Installing extension 'ms-vscode.cpptools' v0.23.1...
> Extension 'ms-vscode.cpptools' v0.23.1 was successfully installed.
> Installing extension 'ms-vscode.github-issues-prs' v0.9.1...
> Extension 'ms-vscode.github-issues-prs' v0.9.1 was successfully installed.
> Installing extension 'ms-vscode.vs-keybindings' v0.2.0...
> Extension 'ms-vscode.vs-keybindings' v0.2.0 was successfully installed.
> Installing extension 'ms-vsliveshare.vsliveshare' v1.0.311...
> Extension 'ms-vsliveshare.vsliveshare' v1.0.311 was successfully installed.
> Installing extension 'ms-vsliveshare.vsliveshare-audio' v0.1.50...
> Extension 'ms-vsliveshare.vsliveshare-audio' v0.1.50 was successfully installed.
> Installing extension 'ms-vsliveshare.vsliveshare-pack' v0.2.12...
> Extension 'ms-vsliveshare.vsliveshare-pack' v0.2.12 was successfully installed.
> Installing extension 'peterjausovec.vscode-docker' v0.6.2...
> Extension 'peterjausovec.vscode-docker' v0.6.2 was successfully installed.
> Installing extension 'piotrpalarz.vscode-gitignore-generator' v1.0.1...
> Extension 'piotrpalarz.vscode-gitignore-generator' v1.0.1 was successfully installed.
> Extension 'redhat.vscode-yaml' is already installed.
> Installing extension 'sanaajani.taskrunnercode' v0.3.0...
> Extension 'sanaajani.taskrunnercode' v0.3.0 was successfully installed.
> Installing extension 'shan.code-settings-sync' v3.2.9...
> Extension 'shan.code-settings-sync' v3.2.9 was successfully installed.
> Installing extension 'twxs.cmake' v0.0.17...
> Extension 'twxs.cmake' v0.0.17 was successfully installed.
> Installing extension 'vector-of-bool.cmake-tools' v1.1.3...
> Extension 'vector-of-bool.cmake-tools' v1.1.3 was successfully installed.
> Installing extension 'visualstudioexptteam.vscodeintellicode' v1.1.6...
> Extension 'visualstudioexptteam.vscodeintellicode' v1.1.6 was successfully installed.
> Installing extension 'vscoss.vscode-ansible' v0.5.2...
> Extension 'vscoss.vscode-ansible' v0.5.2 was successfully installed.
> Installing extension 'zenor.makefile-creator' v0.0.3...
> Extension 'zenor.makefile-creator' v0.0.3 was successfully installed.
> Printing the current remote environment...
> LS_COLORS=
> SSH_CONNECTION=bla 53434 bla22
> LESSCLOSE=/usr/bin/lesspipe %s %s
> LANG=en_US.UTF-8
> XDG_SESSION_ID=1813
> USER=jsochacki
> GOPATH=/home/jsochacki/go
> PWD=/home/jsochacki
> HOME=/home/jsochacki
> GOROOT=/usr/local/go
> SSH_CLIENT=bla53434 22
> XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
> MAIL=/var/mail/jsochacki
> SHELL=/bin/bash
> SHLVL=3
> PROMPT_COMMAND=if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/.logs/bash-history-$(date "+%Y-%m-%d").log; fi
> LOGNAME=jsochacki
> DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/102186/bus
> XDG_RUNTIME_DIR=/run/user/102186
> PATH=/usr/local/eclipse:/opt/MATLAB/R2016b/bin:/home/jsochacki/go/bin:/usr/local/go/bin:/home/jsochacki/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
> LESSOPEN=| /usr/bin/lesspipe %s
> _=/usr/bin/printenv
> OLDPWD=/home/jsochacki/.vscode-remote/bin/bla
> Starting agent...
> Waiting for server log...
>  
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>  
> b10ec6ee-b313-4c4e-b6c6-bla==41019==
"install" terminal command done
Received install output: b10ec6ee-b313-4c4e-b6c6-2cb8c8714e94==41019==
Server is listening on port 41019
Spawning tunnel with: ssh  bla-L localhost:11254:localhost:41019 "echo -e 'Connected to SSH Host - Please do not close this terminal' && sleep infinity"
Spawned SSH tunnel between local port 11254 and remote port 41019
Waiting for ssh tunnel to be ready
Tunneling remote port 41019 to local port 11254
Resolving "ssh-remote+bla" to "localhost:11254", attempt: 1
> Connected to SSH Host - Please do not close this terminal
roblourens commented 4 years ago

Looked into this again, and as I remember, running --install-extension for a bunch of extensions that are already installed can be slow, and it scales up with the number of extensions. @sandy081 is it possible that vscode is doing more work than necessary to check whether an extension is already installed? Or the ssh extension can probably check whether an extension is installed by looking for its folder without actually starting vscode. It takes about 700ms for 4 extensions, 1.7s for 9 extensions, and I can't delay every connection by that long.

sandy081 commented 4 years ago

You can check for list of extensions installed using the cli arg --list-extensions and install only those which are missing

roblourens commented 4 years ago

Oh, good point. Currently that doesn't work through server.sh but I'm sure that's fixable.

sandy081 commented 4 years ago

I assume listing extensions through server CLI is supported already

aaron-manning commented 4 years ago

Experiencing this issue with remote containers extension.

The following workspace settings.json installs no extension:

{
  "remote.containers.defaultExtensions": [
    "bradlc.vscode-tailwindcss"
  ],
  "remote.extensionKind": {
    "bradlc.vscode-tailwindcss": [
      "workspace"
    ]
  }
}