問題描述
電腦關(guān)機(jī)打開后,使用VSCode連接服務(wù)器,在輸入完密碼之后右下角一直沒有加載完畢,一直報:
無法安裝VS Code服務(wù)器
Windows終端可以ssh到服務(wù)器上;VSCode連接時報錯,之前連接過。
具體報錯信息
[08:47:41.235] Log Level: 1
[08:47:41.244] remote-ssh@0.62.0
[08:47:41.244] win32 x64
[08:47:41.246] SSH Resolver called for "ssh-remote+mrevowgp1.westus2.cloudapp.azure.com", attempt 1
[08:47:41.246] "remote.SSH.useLocalServer": false
[08:47:41.247] "remote.SSH.showLoginTerminal": false
[08:47:41.247] "remote.SSH.remotePlatform": {"mrevowcpu2.centralus.cloudapp.azure.com":"linux"}
[08:47:41.247] "remote.SSH.sshPath": undefined
[08:47:41.247] "remote.SSH.sshConfigurationFile": undefined
[08:47:41.247] "remote.SSH.useFlock": true
[08:47:41.248] "remote.SSH.lockfilesInTmp": false
[08:47:41.248] "remote.SSH.localServerDownload": auto
[08:47:41.248] "remote.SSH.remoteServerListenOnSocket": false
[08:47:41.248] "remote.SSH.showLoginTerminal": false
[08:47:41.248] "remote.SSH.maxReconnectionAttempts": 9007199254740991
[08:47:41.248] SSH Resolver called for host: mrevowgp1.westus2.cloudapp.azure.com
[08:47:41.249] Setting up SSH remote "mrevowgp1.westus2.cloudapp.azure.com"
[08:47:41.279] Using commit id "ea3859d4ba2f3e577a159bc91e3074c5d85c0523" and quality "stable" for server
[08:47:41.285] Install and start server if needed
[08:47:45.967] Checking ssh with "ssh -V"
[08:47:46.028] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[08:47:46.034] Running script with connection command: ssh -T -D 57263 "mrevowgp1.westus2.cloudapp.azure.com" bash
[08:47:46.037] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[08:47:47.021] "install" terminal received data: "?[2J?[m?[H93ea2fea3716: running
?]0;C:\WINDOWS\System32\cmd.exe??[?25h"
[08:47:47.022] Got some output, clearing connection timeout
[08:47:47.061] "install" terminal received data: "Acquiring lock on /home/mrevow/.vscode-server/bin/ea3859d4ba2f3e577a159bc91e3074
c5d85c0523/vscode-remote-lock.mrevow.ea3859d4ba2f3e577a159bc91e3074c5d85c0523
Found existing installation at /home/mrevow/.vscode-server/bin/ea3859d4ba2f3e577
a159bc91e3074c5d85c0523...?[K
Checking /home/mrevow/.vscode-server/.ea3859d4ba2f3e577a159bc91e3074c5d85c0523.l
og and /home/mrevow/.vscode-server/.ea3859d4ba2f3e577a159bc91e3074c5d85c0523.pid
for a running server?[K
Looking for server with pid: 4605?[K"
[08:47:47.076] "install" terminal received data: "Found running server...?[K
?[K
*?[K
* Reminder: You may only use this software with Visual Studio family products,
* as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
*?[K
?[K
Server did not start successfully. Full server log at /home/mrevow/.vscode-serve
r/.ea3859d4ba2f3e577a159bc91e3074c5d85c0523.log >>>?[K
<<< End of server log?[K
93ea2fea3716: start?[K
exitCode==32==?[K
listeningOn====?[K
osReleaseId==ubuntu==?[K
arch==x86_64==?[K
tmpDir==/run/user/1000==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
93ea2fea3716: end"
[08:47:47.076] Received install output:
exitCode==32==
listeningOn====
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/1000==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====
[08:47:47.084] Resolver error: Error: The VS Code Server failed to start
at Function.ServerInstallError (c:\Users\mrevow\.vscode\extensions\ms-vscode-remote.remote-ssh-0.62.0\out\extension.js:1:64207)
at c:\Users\mrevow\.vscode\extensions\ms-vscode-remote.remote-ssh-0.62.0\out\extension.js:1:62459
at Object.t.handleInstallOutput (c:\Users\mrevow\.vscode\extensions\ms-vscode-remote.remote-ssh-0.62.0\out\extension.js:1:63061)
at I (c:\Users\mrevow\.vscode\extensions\ms-vscode-remote.remote-ssh-0.62.0\out\extension.js:1:311112)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async c:\Users\mrevow\.vscode\extensions\ms-vscode-remote.remote-ssh-0.62.0\out\extension.js:1:309029
at async Object.t.withShowDetailsEvent (c:\Users\mrevow\.vscode\extensions\ms-vscode-remote.remote-ssh-0.62.0\out\extension.js:1:403706)
at async Object.t.resolve (c:\Users\mrevow\.vscode\extensions\ms-vscode-remote.remote-ssh-0.62.0\out\extension.js:1:312426)
at async c:\Users\mrevow\.vscode\extensions\ms-vscode-remote.remote-ssh-0.62.0\out\extension.js:127:110280
[08:47:47.087] TELEMETRY: {"eventName":"resolver","properties":{"outcome":"failure","reason":"ExitCode","exitCodeLabel":"ServerFailedToStart","osReleaseId":"ubuntu","arch":"x86_64","askedPw":"0","askedPassphrase":"0","asked2fa":"0","askedHostKey":"0","remoteInConfigFile":"1","gotUnrecognizedPrompt":"0","dynamicForwarding":"1","localServer":"0"},"measures":{"resolveAttempts":1,"exitCode":32,"retries":1,"timing.totalResolveTime":5832,"timing.preSshTime":4790,"timing.establishSshTime":986,"timing.scriptTime":1040}}
[08:47:47.089] ------
[08:47:47.799] "install" terminal command done
[08:47:47.799] Install terminal quit with output:
解決方法
前期準(zhǔn)備
:在做后邊的操作之前一定要記得關(guān)閉遠(yuǎn)程
,報錯的時候會彈出彈窗或者按ESC
,選擇關(guān)閉遠(yuǎn)程
即可。
一,關(guān)閉VS Code與遠(yuǎn)程服務(wù)器的連接(不能實(shí)現(xiàn),故這一步可省略)
在VS Code中
ctrl+shift+p
后,在彈出框中輸入Remote-SSH:kill VS Code Server on Host
,重新打開對應(yīng)的遠(yuǎn)端服務(wù)器即可。
選擇后右下角會彈出提示框:
在****上終止VS Code服務(wù)器
。我們可以打開日志
查看一下:
這樣說明,我們目前沒有辦法斷掉連接,也可以搜一下怎么在VS Code中刪除服務(wù)器文件。
> [20:09:53.053] > kill: 用法:kill [-s 信號聲明 | -n 信號編號 | -信號聲明] 進(jìn)程號 | 任務(wù)聲明 ... 或
> kill -l [信號聲明]
[20:09:53.115] > rm: 無法刪除"/home/....../.vscode-server/bin/8b617bd08fd9e
> 3fc94d14adb8d358b56e3f72314/.nfs000000000171d4d900000f95": 設(shè)備或資源忙
> rm: 無法刪除"/home/....../.vscode-server/bin/8b617bd08fd9e
> 3fc94d14adb8d358b56e3f72314/.nfs000000000176c16300000f10": 設(shè)備或資源忙
[20:09:53.131] > rm: 無法刪除"/home/....../.vscode-server/bin/ee2b180d582a7
> f601fa6ecfdad8d9fd269ab1884/.nfs0000000000bb1e4800000baf": 設(shè)備或資源忙
> rm: 無法刪除"/home/....../.vscode-server/bin/abd2f3db4bdb2
> 8f9e95536dfa84d8479f1eb312d/.nfs00000000017615b40000115e": 設(shè)備或資源忙
[20:09:54.401] "Uninstall VS Code Server" terminal command done
二、在服務(wù)器端刪除.vscode-sever
1.服務(wù)器端刪除.vscode-sever,路徑一般是
/home/$(usrname)/.vscode-sever
。(無需這一步刪除,這個是因為查看了很多嘗試的方法)
2.在本地電腦可以通過刪除
C:\Users\$(username)\.ssh
路徑下known_hosts和config文件里面服務(wù)器的相關(guān)。
三、清楚插件里面的緩存
Remote-SSH插件里面的緩存還在,使用快捷鍵:
Ctrl
+,
在搜索框中搜索remote.SSH.remotePlatform
清除遠(yuǎn)端服務(wù)器配置
四、本地重啟vscode 重新連接即可
注意
上面的解決方法沒有所謂的順序,可以隨意組合,也有可能一種就可以解決問題。
小tips
關(guān)于插件正在加載,并且始終無法加載成功(一直處于加載狀態(tài)),重啟VSC、禁用插件、甚至重裝VSC都無法解決問題。該問題不定期出現(xiàn)!
給出解決方案:
只需在VSC JSON設(shè)置文件(settings.json 文件)中加入以下代碼
"telemetry.enableTelemetry": false
重啟VSC,即可解決。
打開settings.json文件的方法
1.ctrl
+ shift
+ p
調(diào)出搜索框
2. 選擇你想要設(shè)置的文件
Open Workspace Settings 也會打開UI設(shè)置界面;
Open User Settings (JSON) 會打開用戶設(shè)置 settings.json 文件;
Open Workspace Settings (JSON) 會打開工作區(qū)設(shè)置 settings.json 文件
vscode存在兩種設(shè)置 settings.json 的方式
User Settings 用戶設(shè)置: 用戶級設(shè)置,該用戶打開的所有vscode共用這個設(shè)置
Workspace Settings 工作區(qū)設(shè)置: 目錄下.vscode 隱藏文件夾,設(shè)置文件為.vscode/settings.json,作用于當(dāng)前工作區(qū)或項目,優(yōu)先級高于用戶設(shè)置
調(diào)整vscode工具欄、菜單欄字體大小
文章來源:http://www.zghlxwxcb.cn/news/detail-755322.html
輸入Zoom level
即是調(diào)整菜單欄的整體字體大小文章來源地址http://www.zghlxwxcb.cn/news/detail-755322.html
到了這里,關(guān)于VSCode使用Remote-SSH連接服務(wù)器時報錯:Resolver error: Error: The VS Code Server failed to start的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!