简体   繁体   English

与服务器建立远程 ssh 连接后,vscode-server 似乎没有完成安装

[英]After Establishing a Remote-ssh connection to the server, it appears the vscode-server does not finish the installation

I am using the Remote-ssh extension with VS Code (Insiders) to connect to an AWS Linux server.我正在使用带有 VS Code(Insiders)的 Remote-ssh 扩展来连接到 AWS Linux 服务器。 This connection is authenticated with a SSH key stored on my local machine.此连接使用存储在我的本地计算机上的 SSH 密钥进行身份验证。 After I connect, a terminal titled "install" is opened and the following is the output:连接后,会打开一个名为“install”的终端,下面是output:

685ad2d6d150: running
Acquiring lock on /home/ubuntu/.vscode-server-insiders/bin/45aafeb326d0d3d56cbc9e2932f87e368dbf652d/vscode-remote-lock.ubuntu.45aafeb326d0d3d56cbc9e2932f87e368dbf652d
Found existing installation at /home/ubuntu/.vscode-server-insiders/bin/45aafeb326d0d3d56cbc9e2932f87e368dbf652d...
Checking /home/ubuntu/.vscode-server-insiders/.45aafeb326d0d3d56cbc9e2932f87e368dbf652d.log and /home/ubuntu/.vscode-server-insiders/.45aafeb326d0d3d56cbc9e2932f87e368dbf652d.pid for a running server
Looking for server with pid: 79962
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)
*

Checking server status on port 45093 with wget
685ad2d6d150: start
SSH_AUTH_SOCK====
DISPLAY====
webUiAccessToken====
listeningOn==45093==
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
connectionToken==86be68cd-ee77-49dc-ae26-5c1521022c2c==
685ad2d6d150: end

(this print is after the initial install and reconnecting to the server, but the output is about the same) (此打印是在初始安装并重新连接到服务器之后,但 output 大致相同)

Afterwards the "install" terminal remains open.之后“安装”终端保持打开状态。 If I close it, then it seems my connection is interrupted and trying to open a file, or another Bash terminal reopens the install terminal.如果我关闭它,那么我的连接似乎被中断并试图打开一个文件,或者另一个 Bash 终端重新打开安装终端。

If I open a direct connection to the user directory, I get the following warning:如果我打开到用户目录的直接连接,我会收到以下警告:

警告图标的屏幕截图

扩展想要对终端的环境做如下改动

If I open a connection from within a git repository directory I don't get that warning.如果我从 git 存储库目录中打开连接,我不会收到该警告。

My question is, is the vscode-server-insiders "install" finished?我的问题是,vscode-server-insiders “安装”完成了吗? Is the "install" terminal supposed to remain open the entire time? “安装”终端是否应该一直保持打开状态? If I close the "install" terminal, is it supposed to break the connection and reopen?如果我关闭“安装”终端,是否应该断开连接并重新打开? Is the warning that shows up because I am not in a git repository directory?出现警告是因为我不在 git 存储库目录中吗? Should I be getting that warning?我应该得到那个警告吗? Or is this all the normal process of remotely connecting via ssh with VS Code?或者这是通过 ssh 与 VS Code 远程连接的所有正常过程?

Sorry, I have Googled, but have not seen anything referencing that this is the regular behavior of using the Remote-ssh extension.抱歉,我已经用 Google 搜索过,但没有看到任何关于这是使用 Remote-ssh 扩展的常规行为的信息。 I feel like if the vscode-server-insiders installation was completed that the "install" output in the terminal should go away.我觉得如果 vscode-server-insiders 安装完成,终端中的“安装”output 应该 go 离开。 But it seems to hang after the connectionToken==86be68cd-ee77-49dc-ae26-5c1521022c2c==4134564d6c5d: end output.但是在connectionToken==86be68cd-ee77-49dc-ae26-5c1521022c2c==4134564d6c5d: end output之后似乎挂了。 Just trying to figure out if this is indeed what is supposed to happen.只是想弄清楚这是否确实应该发生。

UPDATE 1: As mentioned by @VonC, it appears that the install process is indeed hanging.更新 1:正如@VonC 所述,安装过程似乎确实挂起。 I had already looked at the Troubleshooting hanging or failing connections documentation and added "remote.SSH.showLoginTerminal": true, "remote.SSH.useLocalServer": false to my settings file, but it doesn't seem to make a difference.我已经查看了故障排除挂起或失败的连接文档,并在我的设置文件中添加了"remote.SSH.showLoginTerminal": true, "remote.SSH.useLocalServer": false ,但这似乎没有什么不同。 Nothing shows up in the output log for the Remote-ssh extension. Remote-ssh 扩展的 output 日志中没有显示任何内容。 There are a lot of pty errors in the developer's console, but nothing else that looks like it could be making the install process hang.开发人员的控制台中有很多 pty 错误,但看起来没有其他可能导致安装过程挂起。 So, does anyone have any clues as to why the install process is hanging?那么,有没有人知道为什么安装过程会挂起?

UPDATE 2: Setting remote.SSH.showLoginTerminal to false doesn't show the "install" terminal at all.更新 2:remote.SSH.showLoginTerminal设置为 false 根本不显示“安装”终端。 But is this hiding the terminal and the issue, or is this actually solving the issue?但这是隐藏终端和问题,还是实际上解决了问题? It appears that the "Checking server status..." step was what was hanging in the process, but I could still use a bash terminal and open files.看来“检查服务器状态...”步骤是在这个过程中挂起的,但我仍然可以使用 bash 终端并打开文件。 I can also still do all that with remote.SSH.showLoginTerminal set to false.我仍然可以通过将remote.SSH.showLoginTerminal设置为 false 来完成所有这些操作。 I am using a ssh key and I am not using a password to login.我使用的是 ssh 密钥,但我没有使用密码登录。 I guess now I am more curious as to what is really going on here and making sure that there are no problems that are just being hidden by this setting.我想现在我对这里到底发生了什么更加好奇,并确保没有任何问题只是被这个设置所隐藏。

The " Extensions want to make changes " part does not seem linked to microsoft/vscode-remote-release , but is more a VSCode warning , as shown in microsoft/vscode issue 108940 , still opened in issue 96699 . Extensions want to make changes ”部分似乎与microsoft/vscode-remote-release ,而更像是一个VSCode 警告,如microsoft/vscode问题 108940 所示,仍然在问题 96699中打开。

Closing the install terminal does not terminate the session, but check settings, as seen in the " Troubleshooting hanging or failing connections ": something like " remote.SSH.showLoginTerminal " could have bearing on what you see.关闭安装终端不会终止 session,但会检查设置,如“ 解决挂起或失败连接”中所示:类似“ remote.SSH.showLoginTerminal ”的内容可能与您所看到的有关。

The OP Charles Williams confirms having set "remote.SSH.showLoginTerminal" to false, which seems to resolve (or hide?) the issue. OP Charles Williams确认已将“remote.SSH.showLoginTerminal”设置为 false,这似乎可以解决(或隐藏?)问题。

I set remote.SSH.showLoginTerminal: false in the VS Code settings and it either hides these warnings or it gets rid of them.我在 VS Code 设置中设置了remote.SSH.showLoginTerminal: false ,它要么隐藏这些警告,要么摆脱它们。 I am not sure.我不知道。 So, while I don't know why these warnings occurred, or if this setting really "fixed" it, I am going to say this is solved because nothing is blocking my use of the SSH Remote features of VS Code, and I am no longer getting annoying warnings.所以,虽然我不知道为什么会出现这些警告,或者这个设置是否真的“修复”了它,但我想说这已经解决了,因为没有什么能阻止我使用 VS Code 的 SSH 远程功能,我不更长的时间得到恼人的警告。

I met the same problem as yours.我遇到了和你一样的问题。 At last, I found this problem happened because I used both MobaXterm and vscode to connect the remote host at the same time.最后发现这个问题是因为我同时使用了MobaXterm和vscode来连接远程主机。 When I closed MobaXterm ssh connection, the problem in vscode was solved.当我关闭 MobaXterm ssh 连接后,vscode 中的问题就解决了。

Allowing the editor to install random undocumented code onto every remote server you access is very odd.允许编辑器在您访问的每台远程服务器上安装随机未记录的代码是非常奇怪的。

I've spent a fair amount of time going through the current (Aug 2022) VS Code 3rd-party extensions to find a less-invasive alternative, and the most straightforward seems to be "ftp-simple" which uses the common technique of using (s)ftp as the file-io method to the remote server allowing you to browse the file system, open file, edit, save pretty much as you would do on the local file system.我花了相当多的时间浏览当前(2022 年 8 月)VS Code 3rd-party 扩展来寻找侵入性较小的替代方案,最直接的似乎是使用常用技术的“ftp-simple” (s)ftp 作为远程服务器的文件 io 方法,允许您浏览文件系统、打开文件、编辑、保存,就像在本地文件系统上一样。

Some other VS Code 3rd-party (s)ftp extensions use the heavyweight 'synchronize workspace' model where your client copies the entire directory tree below your 'remote folder' assuming it's a 'project', and then keeps that local copy in sync with the server.其他一些 VS Code 3rd-party (s)ftp 扩展使用重量级的“同步工作区”model,您的客户端将整个目录树复制到您的“远程文件夹”下,假设它是一个“项目”,然后保持本地副本与服务器。 This works ok for developers working on small projects (although frankly Git would be better) but doesn't fit the sysadmin ad-hoc file edits I might need to do.这对于从事小型项目的开发人员来说很好(尽管坦率地说 Git 会更好),但不适合我可能需要做的系统管理员临时文件编辑。 Another hiccup is some extensions allow you to edit a remote FILE, but don't integrate browsing the remote file system, so you have to specify the complete filename for the file you want to edit.另一个问题是某些扩展允许您编辑远程文件,但不集成浏览远程文件系统,因此您必须为要编辑的文件指定完整的文件名。

SFTP is a good fit for remote file editting because the editor file i/o is basically 'browse filesystem', 'read entire file', 'save entire file' which maps to sftp fine, and the clear delineation between the editting and the file read/write makes the remote access less vulnerable to connection issues. SFTP 非常适合远程文件编辑,因为编辑器文件 i/o 基本上是“浏览文件系统”、“读取整个文件”、“保存整个文件”,映射到 sftp 很好,以及编辑和文件之间的清晰划分读/写使远程访问不易受到连接问题的影响。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM