我想在离线环境下使用RemoteSSH

问题描述 投票:0回答:1

我想在离线环境中使用RemoteSSH for VScode。 不过,我还是忍不住去下载VS code Server。

settings.jsom 如下,useExecServer 设置为 false。


{
    "json.schemas": [

    ],
    "remote.SSH.useExecServer": false,
    "update.mode": "none",
    "extensions.autoUpdate": false,
    "extensions.autoCheckUpdates": false
}

这是错误消息。

[09:01:11.327] Got request to download on client for {"artifact":"server-linux-legacy-x64","destPath":"/home/opc/.vscode-server/bin/4849ca9bdf9666755eb463db297b69e5385090e3/vscode-server.tar.gz"}
[09:01:11.327] server download URL: https://update.code.visualstudio.com/commit:4849ca9bdf9666755eb463db297b69e5385090e3/server-linux-legacy-x64/stable
[09:01:11.327] Downloading VS Code server locally...
[09:01:32.340] Resolver error: Error: VS Code Server (Failed to fetch) をダウンロードできませんでした

我也尝试过将下载的文件放在连接处的Internet环境中,但没有成功。

[opc@testserver ~]$ ll .v
.viminfo        .vscode-server/
[opc@testserver ~]$ ll .vscode-server/
bin/                                                        vscode-cli-4849ca9bdf9666755eb463db297b69e5385090e3.tar.gz
[opc@testserver ~]$ ll .vscode-server/bin/4849ca9bdf9666755eb463db297b69e5385090e3/
code                              vscode-scp-done.flag
vscode_cli_alpine_x64_cli.tar.gz  vscode-server.tar.gz
[opc@testserver ~]$ ll .vscode-server/bin/4849ca9bdf9666755eb463db297b69e5385090e3/
total 29952
-rwxrwxr-x. 1 opc opc 21701432 Sep  4 13:08 code
-rw-r--r--. 1 opc opc  8964808 Sep 30 10:08 vscode_cli_alpine_x64_cli.tar.gz
-rw-rw-r--. 1 opc opc        0 Sep 30 10:50 vscode-scp-done.flag
-rw-rw-r--. 1 opc opc        0 Oct  1 00:01 vscode-server.tar.gz
[opc@testserver ~]$

全文如下。

[09:01:07.395] Log Level: 2
[09:01:07.413] SSH Resolver called for "ssh-remote+testserver", attempt 1
[09:01:07.415] "remote.SSH.useLocalServer": false
[09:01:07.415] "remote.SSH.useExecServer": false
[09:01:07.417] "remote.SSH.showLoginTerminal": false
[09:01:07.417] "remote.SSH.remotePlatform": {}
[09:01:07.418] "remote.SSH.path": undefined
[09:01:07.418] "remote.SSH.configFile": undefined
[09:01:07.418] "remote.SSH.useFlock": true
[09:01:07.419] "remote.SSH.lockfilesInTmp": false
[09:01:07.419] "remote.SSH.localServerDownload": auto
[09:01:07.419] "remote.SSH.remoteServerListenOnSocket": false
[09:01:07.420] "remote.SSH.showLoginTerminal": false
[09:01:07.420] "remote.SSH.defaultExtensions": []
[09:01:07.420] "remote.SSH.loglevel": 2
[09:01:07.420] "remote.SSH.enableDynamicForwarding": true
[09:01:07.421] "remote.SSH.enableRemoteCommand": false
[09:01:07.421] "remote.SSH.serverPickPortsFromRange": {}
[09:01:07.421] "remote.SSH.serverInstallPath": {}
[09:01:07.422] "remote.SSH.permitPtyAllocation": false
[09:01:07.422] "remote.SSH.preferredLocalPortRange: undefined
[09:01:07.422] "remote.SSH.useCurlAndWgetConfigurationFiles: false
[09:01:07.432] VS Code version: 1.93.0
[09:01:07.432] Remote-SSH version: [email protected]
[09:01:07.432] win32 x64
[09:01:07.436] SSH Resolver called for host: testserver
[09:01:07.436] Setting up SSH remote "testserver"
[09:01:07.442] Using commit id "4849ca9bdf9666755eb463db297b69e5385090e3" and quality "stable" for server
[09:01:07.449] Script variables:
 {
  "InstallExitCode.24": "AlreadyInProgress",
  "InstallExitCode.25": "ServerDownloadFailed",
  "InstallExitCode.26": "NoDownloaderAvailable",
  "InstallExitCode.27": "UnsupportedArch",
  "InstallExitCode.28": "StatusCheckFailed",
  "InstallExitCode.29": "NeedInsidersArch",
  "InstallExitCode.30": "NoDownloaderAvailableForStatusCheck",
  "InstallExitCode.31": "ServerTransferFailed",
  "InstallExitCode.32": "ServerFailedToStart",
  "InstallExitCode.33": "NeedInsidersWindows",
  "InstallExitCode.34": "CreateInstallDirFailed",
  "InstallExitCode.35": "UnsupportedPlatform",
  "InstallExitCode.36": "ServerTerminatedCVE20201416",
  "InstallExitCode.37": "UnpackFailed",
  "InstallExitCode.38": "ChangeDirFailed",
  "InstallExitCode.AlreadyInProgress": "24",
  "InstallExitCode.ServerDownloadFailed": "25",
  "InstallExitCode.NoDownloaderAvailable": "26",
  "InstallExitCode.NoDownloaderAvailableForStatusCheck": "30",
  "InstallExitCode.UnsupportedArch": "27",
  "InstallExitCode.StatusCheckFailed": "28",
  "InstallExitCode.NeedInsidersArch": "29",
  "InstallExitCode.ServerTransferFailed": "31",
  "InstallExitCode.ServerFailedToStart": "32",
  "InstallExitCode.NeedInsidersWindows": "33",
  "InstallExitCode.CreateInstallDirFailed": "34",
  "InstallExitCode.UnsupportedPlatform": "35",
  "InstallExitCode.ServerTerminatedCVE20201416": "36",
  "InstallExitCode.UnpackFailed": "37",
  "InstallExitCode.ChangeDirFailed": "38",
  "InstallUnpackCode.Success": "success",
  "InstallUnpackCode.Error": "error",
  "InstallUnpackCode.MissingFiles": "missingFiles",
  "uuid": "32739e016167",
  "startMarker": "32739e016167: running",
  "commitId": "4849ca9bdf9666755eb463db297b69e5385090e3",
  "quality": "stable",
  "token": "11a11111-11a1-111a-111a-aa111a1aa1aa",
  "vscodeAgentFolder": "$HOME/.vscode-server",
  "allowClientDownload": "1",
  "forceClientDownload": "0",
  "cliNameInArchive": "code",
  "ignoreWgetConfigFlag": " --no-config ",
  "ignoreCurlConfigFlag": " --disable ",
  "wgetTriesSegment": "--tries=1",
  "listenArgs": "--on-host=127.0.0.1 --on-port",
  "getDownloadServerStartTrigger": "32739e016167:trigger_server_download",
  "getDownloadServerEndTrigger": "32739e016167:trigger_server_download_end",
  "getProgressDownloading": "32739e016167%%1%%",
  "getProgressInstalling": "32739e016167%%2%%"
}
[09:01:07.453] Install and start server if needed
[09:01:10.109] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[09:01:10.114] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[09:01:10.114] Checking ssh with "C:\Windows\ssh.exe -V"
[09:01:10.116] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[09:01:10.116] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[09:01:10.117] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[09:01:10.118] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[09:01:10.119] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[09:01:10.119] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[09:01:10.168] > O
[09:01:10.169] > p
[09:01:10.169] > e
[09:01:10.169] > n
[09:01:10.170] > S
[09:01:10.170] > S
[09:01:10.170] > H
[09:01:10.170] > _
[09:01:10.171] > f
[09:01:10.171] > o
[09:01:10.171] > r
[09:01:10.171] > _
[09:01:10.172] > W
[09:01:10.173] > i
[09:01:10.173] > n
[09:01:10.173] > d
[09:01:10.174] > ows_8.1p1,
[09:01:10.174] >  LibreSSL 3.0.2

[09:01:10.180] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 56552 testserver bash
[09:01:10.182] Generated SSH command: 'type "C:\Users\ocs\AppData\Local\Temp\2\vscode-linux-multi-line-command-testserver-95118882.sh" | "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 56552 testserver bash'
[09:01:10.184] Terminal shell path: C:\Windows\System32\cmd.exe
[09:01:10.999] > 32739e016167: running
> ]0;C:\Windows\System32\cmd.exe
[09:01:10.999] Got some output, clearing connection timeout
[09:01:11.013] > Acquiring lock on /home/opc/.vscode-server/bin/4849ca9bdf9666755eb463db297b69e5385090e3/vscode-remote-lock.opc.4849ca9bdf9666755eb463db297b69e5385090e3
[09:01:11.020] > Installing to /home/opc/.vscode-server/bin/4849ca9bdf9666755eb463db297b69e5385090e3...
> 32739e016167%%1%%
> Downloading with wget
[09:01:11.313] > wget download failed
> failed: Connection refused. failed: Network is unreachable.
> printenv:
>     SSH_CONNECTION=x.x.x.x 56556 x.x.x.x 22
>     MODULES_RUN_QUARANTINE=LD_LIBRARY_PATH LD_PRELOAD
>     LANG=en_US.UTF-8
>     S_COLORS=auto
>     which_declare=declare -f
>     XDG_SESSION_ID=1456
>     MODULES_CMD=/usr/share/Modules/libexec/modulecmd.tcl
>     USER=opc
>     SELINUX_ROLE_REQUESTED=
>     PWD=/home/opc/.vscode-server/bin/4849ca9bdf9666755eb463db297b69e5385090e3
>     HOME=/home/opc
>     SSH_CLIENT=x.x.x.x 56556 22
>     SELINUX_LEVEL_REQUESTED=
>     LOADEDMODULES=
>     SHELL=/bin/bash
>     SELINUX_USE_CURRENT_RANGE=
>     SHLVL=2
>     MANPATH=:
>     MODULEPATH=/etc/scl/modulefiles:/usr/share/Modules/modulefiles:/etc/modulefiles:/usr/share/modulefiles
>     LOGNAME=opc
>     DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
>     XDG_RUNTIME_DIR=/run/user/1000
>     MODULEPATH_modshare=/usr/share/Modules/modulefiles:2:/etc/modulefiles:2:/usr
> r/share/modulefiles:2
>     PATH=/home/opc/.local/bin:/home/opc/bin:/usr/share/Modules/bin:/usr/local/bi
> in:/usr/bin:/usr/local/sbin:/usr/sbin
>     MODULESHOME=/usr/share/Modules
>     LESSOPEN=||/usr/bin/lesspipe.sh %s
>     BASH_FUNC_which%%=() {  ( alias;
>      eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-fun
> nctions --show-tilde --show-dot $@
>     }
>     BASH_FUNC_module%%=() {  unset _mlshdbg;
>      if [ "${MODULES_SILENT_SHELL_DEBUG:-0}" = '1' ]; then
>      case "$-" in
>      *v*x*)
>      set +vx;
>      _mlshdbg='vx'
>      ;;
>      *v*)
>      set +v;
>      _mlshdbg='v'
>      ;;
>      *x*)
[09:01:11.326] > 
>      set +x;
>      _mlshdbg='x'
>      ;;
>      *)
>      _mlshdbg=''
>      ;;
>      esac;
>      fi;
>      unset _mlre _mlIFS;
>      if [ -n "${IFS+x}" ]; then
>      _mlIFS=$IFS;
>      fi;
>      IFS=' ';
>      for _mlv in ${MODULES_RUN_QUARANTINE:-};
>      do
>      if [ "${_mlv}" = "${_mlv##*[!A-Za-z0-9_]}" -a "${_mlv}" = "${_mlv#[0-9]}" ]
> ]; then
>      if [ -n "`eval 'echo ${'$_mlv'+x}'`" ]; then
>      _mlre="${_mlre:-}${_mlv}_modquar='`eval 'echo ${'$_mlv'}'`' ";
>      fi;
>      _mlrv="MODULES_RUNENV_${_mlv}";
>      _mlre="${_mlre:-}${_mlv}='`eval 'echo ${'$_mlrv':-}'`' ";
>      fi;
>      done;
>      if [ -n "${_mlre:-}" ]; then
>      eval `eval ${_mlre} /usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl
> l bash '"$@"'`;
>      else
>      eval `/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl bash "$@"`;  
>      fi;
>      _mlstatus=$?;
>      if [ -n "${_mlIFS+x}" ]; then
>      IFS=$_mlIFS;
>      else
>      unset IFS;
>      fi;
>      unset _mlre _mlv _mlrv _mlIFS;
>      if [ -n "${_mlshdbg:-}" ]; then
>      set -$_mlshdbg;
>      fi;
>      unset _mlshdbg;
>      return $_mlstatus
>     }
>     BASH_FUNC_switchml%%=() {  typeset swfound=1;
>      if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then
>      typeset swname='main';
>      if [ -e /usr/share/Modules/libexec/modulecmd.tcl ]; then
>      typeset swfound=0;
>      unset MODULES_USE_COMPAT_VERSION;
>      fi;
>      else
>      typeset swname='compatibility';
>      if [ -e /usr/share/Modules/libexec/modulecmd-compat ]; then
>      typeset swfound=0;
>      MODULES_USE_COMPAT_VERSION=1;
>      export MODULES_USE_COMPAT_VERSION;
>      fi;
>      fi;
>      if [ $swfound -eq 0 ]; then
>      echo "Switching to Modules $swname version";
>      source /usr/share/Modules/init/bash;
>      else
>      echo "Cannot switch to Modules $swname version, command not found";        
>      return 1;
>      fi
>     }
>     BASH_FUNC_scl%%=() {  if [ "$1" = "load" -o "$1" = "unload" ]; then
>      eval "module $@";
>      else
>      /usr/bin/scl "$@";
>      fi
>     }
>     BASH_FUNC_ml%%=() {  module ml "$@"
>     }
>     _=/usr/bin/printenv
>     OLDPWD=/home/opc
> Trigger local server download
> 32739e016167:trigger_server_download
> artifact==server-linux-legacy-x64==
> destFolder==/home/opc/.vscode-server/bin/==
> destFolder2==4849ca9bdf9666755eb463db297b69e5385090e3/vscode-server.tar.gz==    
> 32739e016167:trigger_server_download_end
> Waiting for client to transfer server archive...
> Waiting for /home/opc/.vscode-server/bin/4849ca9bdf9666755eb463db297b69e5385090e
> e3/vscode-server.tar.gz.done and vscode-server.tar.gz to exist
> 
[09:01:11.327] Got request to download on client for {"artifact":"server-linux-legacy-x64","destPath":"/home/opc/.vscode-server/bin/4849ca9bdf9666755eb463db297b69e5385090e3/vscode-server.tar.gz"}
[09:01:11.327] server download URL: https://update.code.visualstudio.com/commit:4849ca9bdf9666755eb463db297b69e5385090e3/server-linux-legacy-x64/stable
[09:01:11.327] Downloading VS Code server locally...
[09:01:32.340] Resolver error: Error: VS Code Server (Failed to fetch) をダウンロードできませんでした
    at v.Create (c:\Users\ocs\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.2024090921\out\extension.js:2:501404)
    at c:\Users\ocs\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.2024090921\out\extension.js:2:545104
    at async t.downloadAndCopyToHost (c:\Users\ocs\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.2024090921\out\extension.js:2:544604)
    at async c:\Users\ocs\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.2024090921\out\extension.js:2:615879
    at async t.tryInstall (c:\Users\ocs\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.2024090921\out\extension.js:2:616125)
    at async c:\Users\ocs\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.2024090921\out\extension.js:2:575788
    at async t.withShowDetailsEvent (c:\Users\ocs\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.2024090921\out\extension.js:2:579017)
    at async k (c:\Users\ocs\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.2024090921\out\extension.js:2:572574)
    at async t.resolve (c:\Users\ocs\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.2024090921\out\extension.js:2:576428)
    at async c:\Users\ocs\.vscode\extensions\ms-vscode-remote.remote-ssh-0.115.2024090921\out\extension.js:2:844812
[09:01:32.590] ------
vscode-remote vscode-remote-ssh
1个回答
0
投票

您的问题似乎有些模糊,因为您忽略了您想要实现的目标。但听起来好像您只是尝试使用 VS Code 远程 SSH 扩展通过 ssh 使用在本地计算机上运行的 VS Code 连接到远程主机。如果是这种情况,您可以通过指定主机的操作系统和 VS Code 版本以及您尝试登录的远程主机的操作系统来帮助其他人解决问题。此外,如果您能够描述重现您遇到的问题的步骤,可能会有所帮助。除此之外,首先了解首次使用 VS Code 的远程 SSH 扩展登录远程主机时会发生什么可能会有所帮助。远程 SSH 扩展将使用 ssh 命令在远程主机上安装 VS Code 服务器端组件。只要本地主机或远程主机可以访问互联网,服务器端组件的文件就应该能够成功自动安装。安装服务器端组件后,您应该能够在 .vscode-server 文件夹中找到这些文件。在 Linux 主机上,该文件夹位于 /home// 目录中。在 Windows 上,它应该位于 C:\Users.vscode-server\ 目录下。您应该能够根据这些说明手动安装 VS Code 服务器。如果您遇到任何其他错误,您可以通过将错误输出与此处描述的内容进行比较来检查它是否是由已知版本错误引起的。您只需更新到较新版本的 VS Code 就可以解决该问题。

© www.soinside.com 2019 - 2024. All rights reserved.