首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在不自动安装VSCode服务器的情况下使用远程SSH连接到主机?

如何在不自动安装VSCode服务器的情况下使用远程SSH连接到主机?
EN

Stack Overflow用户
提问于 2020-12-11 02:21:22
回答 2查看 3.6K关注 0票数 0

我正在使用运行Toradex Embedded Linux BSP 2.8的模块上系统,并且我正在尝试启用远程调试Python应用程序。为此,我使用带有远程SSH扩展的VSCode。问题是它尝试在主机上安装VSCode服务器失败。这是VSCode的输出:

代码语言:javascript
运行
复制
[20:19:37.760] Log Level: 2
[20:19:37.766] remote-ssh-nightly@2020.11.38340
[20:19:37.767] win32 x64
[20:19:37.770] SSH Resolver called for "ssh-remote+192.168.1.123", attempt 1
[20:19:37.771] "remote.SSH.useLocalServer": false
[20:19:37.772] "remote.SSH.showLoginTerminal": false
[20:19:37.772] "remote.SSH.remotePlatform": {}
[20:19:37.772] "remote.SSH.sshPath": undefined
[20:19:37.773] "remote.SSH.sshConfigurationFile": undefined
[20:19:37.773] "remote.SSH.useFlock": true
[20:19:37.773] "remote.SSH.lockfilesInTmp": false
[20:19:37.775] "remote.SSH.localServerDownload": auto
[20:19:37.776] "remote.SSH.remoteServerListenOnSocket": false
[20:19:37.776] "remote.SSH.showLoginTerminal": false
[20:19:37.776] "remote.SSH.maxReconnectionAttempts": 9007199254740991
[20:19:37.779] SSH Resolver called for host: 192.168.1.123
[20:19:37.779] Setting up SSH remote "192.168.1.123"
[20:19:37.843] Using commit id "e5a624b788d92b8d34d1392e4c4d9789406efe8f" and quality "stable" for server
[20:19:37.857] Install and start server if needed
[20:19:43.883] Checking ssh with "ssh -V"
[20:19:43.974] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5

[20:19:43.987] Running script with connection command: ssh -T -D 61045 192.168.1.123 bash
[20:19:43.991] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[20:19:44.570] > d00250925a8b: running
> ]0;C:\WINDOWS\System32\cmd.exe
[20:19:44.570] Got some output, clearing connection timeout
[20:19:44.673] > Acquiring lock on /home/root/.vscode-server/bin/e5a624b788d92b8d34d1392e4c4d9789
> 406efe8f/vscode-remote-lock.root.e5a624b788d92b8d34d1392e4c4d9789406efe8f       
[20:19:44.712] > Installing to /home/root/.vscode-server/bin/e5a624b788d92b8d34d1392e4c4d9789406e
> fe8f...
> main: line 52: 1607624384%N/1000000: division by 0 (error token is "N/1000000") 
> d00250925a8b%%1%%
[20:19:44.730] > Downloading with wget
[20:19:54.206] > Download complete
[20:19:54.231] > main: line 52: 1607624394%N/1000000: division by 0 (error token is "N/1000000")
> main: line 60: - : syntax error: operand expected (error token is "- ")        
[20:19:54.236] > main: line 52: 1607624394%N/1000000: division by 0 (error token is "N/1000000")
> d00250925a8b%%2%%
> tar --version:
> tar: unrecognized option '--version'
[20:19:54.253] > BusyBox v1.24.1 (2020-06-10 16:36:39 UTC) multi-call binary.
> 
> Usage: tar -[cxtZzJjahmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR] [FILE]...
[20:20:00.456] > main: line 52: 1607624400%N/1000000: division by 0 (error token is "N/1000000")
> main: line 60: - : syntax error: operand expected (error token is "- ")
> ERROR: tar exited with non-0 exit code: 0
> Trigger local server download
> d00250925a8b:trigger_server_download
> platform==linux==
> vscodeArch==armhf==
> destFolder==/home/root/.vscode-server/bin/e5a624b788d92b8d34d1392e4c4d9789406efe
> 8f==
> d00250925a8b:trigger_server_download_end
> Waiting for client to transfer server archive...
[20:20:00.457] Got request to download on client for {"platform":"linux","arch":"armhf","destFolder":"/home/root/.vscode-server/bin/e5a624b788d92b8d34d1392e4c4d9789406efe8f"}
[20:20:00.458] Downloading VS Code server locally...
[20:20:00.463] > 
> Waiting for /home/root/.vscode-server/bin/e5a624b788d92b8d34d1392e4c4d9789406efe
> 8f/vscode-scp-done.flag and vscode-server.tar.gz to exist
[20:20:00.481] > 
> 
[20:20:09.513] Downloaded VS Code server to c:\Users\Cristi\AppData\Local\Temp\11e04d86-6ef3-4156-b828-f18fc94d5574
[20:20:09.517] Renamed VS Code server to c:\Users\Cristi\AppData\Local\Temp\vscode_server_1607624409513\vscode-server.tar.gz
[20:20:09.521] Checking ssh with "ssh -V"
[20:20:09.606] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5

[20:20:09.619] Testing scp with "scp"
[20:20:09.766] scp exited with code: 1
[20:20:09.767] Got stderr from scp: usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program] source ... target
[20:20:09.768] Copying file to remote with scp vscode-server.tar.gz vscode-scp-done.flag 192.168.1.123:/home/root/.vscode-server/bin/e5a624b788d92b8d34d1392e4c4d9789406efe8f
[20:20:09.768] Using cwd: file:///c%3A/Users/Cristi/AppData/Local/Temp/vscode_server_1607624409513
[20:20:09.768] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[20:20:10.350] > vscode-server.tar.gz                            0%    0     0.0KB/s   --:-- ETA]0;C:\WINDOWS\System32\cmd.exe
[20:20:11.364] > vscode-server.tar.gz                           47%   12MB  12.3MB/s   00:01 ETA
[20:20:12.373] > vscode-server.tar.gz                           90%   24MB  12.2MB/s   00:00 ETA
[20:20:12.761] > vscode-server.tar.gz                          100%   26MB  10.9MB/s   00:02    
[20:20:12.780] > 
> vscode-scp-done.flag                          100%    9     4.4KB/s   00:00    
[20:20:13.090] "Copy server to host" terminal command done
[20:20:15.484] > Found flag and server on host
[20:20:15.501] > main: line 52: 1607624415%N/1000000: division by 0 (error token is "N/1000000")
> d00250925a8b%%2%%
> tar --version:
> tar: unrecognized option '--version'
[20:20:15.507] > 
> BusyBox v1.24.1 (2020-06-10 16:36:39 UTC) multi-call binary.
> 
> Usage: tar -[cxtZzJjahmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR] [FILE]...  
[20:20:15.514] > 
[20:20:21.739] > main: line 52: 1607624421%N/1000000: division by 0 (error token is "N/1000000")
> ERROR: tar exited with non-0 exit code: 0
> Already attempted local download, failing
> d00250925a8b: start
> exitCode==37==
> listeningOn====
> osReleaseId==angstrom==
[20:20:21.747] > 
> arch==armv7l==
> tmpDir==/run/user/0==
> platform==linux==
> unpackResult==error==
> didLocalDownload==1==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> d00250925a8b: end
[20:20:21.749] Received install output: 
exitCode==37==
listeningOn====
osReleaseId==angstrom==
arch==armv7l==
tmpDir==/run/user/0==
platform==linux==
unpackResult==error==
didLocalDownload==1==
downloadTime====
installTime====
extInstallTime====
serverStartTime====

[20:20:21.763] Resolver error: Error: Failed to install the VS Code Server
    at Function.ServerInstallError (c:\Users\Cristi\.vscode\extensions\ms-vscode-remote.remote-ssh-nightly-2020.11.38340\out\extension.js:1:95433)
    at c:\Users\Cristi\.vscode\extensions\ms-vscode-remote.remote-ssh-nightly-2020.11.38340\out\extension.js:1:93971
    at Object.t.handleInstallOutput (c:\Users\Cristi\.vscode\extensions\ms-vscode-remote.remote-ssh-nightly-2020.11.38340\out\extension.js:1:94151)
    at I (c:\Users\Cristi\.vscode\extensions\ms-vscode-remote.remote-ssh-nightly-2020.11.38340\out\extension.js:127:107038)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
    at async c:\Users\Cristi\.vscode\extensions\ms-vscode-remote.remote-ssh-nightly-2020.11.38340\out\extension.js:127:104953
    at async Object.t.withShowDetailsEvent (c:\Users\Cristi\.vscode\extensions\ms-vscode-remote.remote-ssh-nightly-2020.11.38340\out\extension.js:127:110290)
    at async Object.t.resolve (c:\Users\Cristi\.vscode\extensions\ms-vscode-remote.remote-ssh-nightly-2020.11.38340\out\extension.js:127:108354)
    at async c:\Users\Cristi\.vscode\extensions\ms-vscode-remote.remote-ssh-nightly-2020.11.38340\out\extension.js:127:129588
[20:20:21.766] > 
> main: line 60: - : syntax error: operand expected (error token is "- ")
[20:20:21.766] > 
[20:20:21.769] ------




[20:20:22.736] "install" terminal command done
[20:20:22.736] Install terminal quit with output: main: line 60: - : syntax error: operand expected (error token is "- ")

我已经尝试解压tar.gz文件并手动执行server.sh文件。它显示服务器正在侦听端口8000:

代码语言:javascript
运行
复制
IP Address: 192.168.1.123
Extension host agent listening on 8000


[17:54:03] Extension host agent started.

但是当我连接到远程SSH时,它会重新尝试安装VSCode服务器,尽管它正在运行。

你建议我应该怎么做才能让它工作?

EN

回答 2

Stack Overflow用户

发布于 2020-12-16 01:54:12

昨天在运行vscode重启系统后,我开始遇到同样的问题。

我尝试将远程SSH扩展回滚到前三个版本,但没有做任何更改。SSH>右键单击'Remote -‘>’安装另一个版本...‘

我发现this issue在vscode-remote github上有不同的错误,但更新到vscode 1.52.0和Remote-SSH 0.62.0的症状是相同的。解决方案是降级到vscode 1.51.1和Remote-SSH0.61.0

Remote-SSH 0.61.0不适用于我,但0.56.0适用。

票数 2
EN

Stack Overflow用户

发布于 2020-12-15 17:00:47

我的VS代码刚刚更新到2020年11月和远程SSH扩展,现在我也得到了这个错误。我的目标系统和您的一样,都是基于BusyBox的(也许这与此有关)。我使用这个设置已经有一年左右了。这不是正常行为。

编辑:这个技巧在同一时间起作用了。我的主文件夹在BusyBox目标系统和主glibc PC之间共享。通过对glibc PC执行SSH,安装VS Code服务器成功了。从那时起,我可以通过SSH连接到我的busybox目标并拥有更新的VS Code服务器。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65240154

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档