Vscode-remote-release: Windows Server SSH Remoting Fails if Server has Win32_OpenSSH 7.9 or newer installed

Created on 4 Mar 2020  路  26Comments  路  Source: microsoft/vscode-remote-release

  • VSCode Version: Insiders
  • Local OS Version: Windows Insider
  • Remote OS Version: Windows Server 2016
  • Remote Extension/Connection Type: SSH/Docker/WSL: SSH

Steps to Reproduce:

  1. Install Windows OpenSSH 8.0 or 8.1 on remote host server
  2. Attempt remote connection
  3. Connection fails with:
[17:55:01.210] stderr> OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2
[17:55:02.159] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:ubsZl1Q9SjOlzifmMqGd/w8m95rTpUtsSeRL2FJgMh4
[17:55:03.703] stderr> Authenticated to 0.tcp.ngrok.io ([3.19.114.185]:19084).
[17:55:04.411] stderr> shell request failed on channel 2
[17:55:04.423] > local-server> ssh child died, shutting down
[17:55:04.433] Local server exit: 0
[17:55:04.434] Received install output: OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:ubsZl1Q9SjOlzifmMqGd/w8m95rTpUtsSeRL2FJgMh4
Authenticated to 0.tcp.ngrok.io ([3.19.114.185]:19084).
shell request failed on channel 2

[17:55:04.434] Stopped parsing output early. Remaining text: OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2debug1: Server host key: ecdsa-sha2-nistp256 SHA256:ubsZl1Q9SjOlzifmMqGd/w8m95rTpUtsSeRL2FJgMh4Authenticated to 0.tcp.ngrok.io ([3.19.114.185]:19084).shell request failed on channel 2
[17:55:04.435] Failed to parse remote port from server output
[17:55:04.436] Resolver error: 
[17:55:04.438] ------
  1. Install 7.7.2.0p1-Beta OpenSSH version on server
  2. Reconnect -- Server Now Works

It is noted the regression is probably in 7.9 here:
https://github.com/microsoft/vscode-remote-release/issues/25#issuecomment-577778011

And whatever code is used to parse out the remote port from the server output needs to detect this newer format in Windows OpenSSH and parse that newer format instead.


Does this issue occur when you try this locally?: N/A
Does this issue occur when you try this locally and all extensions are disabled?: N/A

Related Info: #25
@bagajjal @manojampalam @TylerLeonhardt @roblourens

bug ssh upstream windows

Most helpful comment

For anyone else finding this issue, a workaround is to set the following

"remote.SSH.useLocalServer": false,
"remote.SSH.windowsRemotes": ["<your remote's hostname>"]

All 26 comments

That's right - the fix will be in the next major windows update. No need to ping the whole team. I have assumed that most people are not installing newer versions of OpenSSH manually so I have not tried to work around it. I'm curious why you installed v8 at first instead of installing the default build through windows?

@roblourens Just because those were additional that Tyler flagged for visibility in the previous issue, that's all.

As to the version, we use the Kerberos GSSAPI functionality extensively which requires 7.9, and win32_openssh is easy to deploy with chocolatey :)

Is the problem a downstream issue in windows?

Is there a reason just an update to the extension can't fix the issue?
EDIT: Nevermind you answered that in your reply, obviously there are higher priorities. Not a big deal, we can downgrade to the boxes we do remote development on, it's easy enough with chocolatey.

Thanks for your hard work.

Thanks for trying it, and for your tweet! I will leave this issue open for now to judge whether this ends up being a common scenario. The upstream issue is https://github.com/PowerShell/Win32-OpenSSH/issues/1545 (fixed internally but not in a release yet)

Thanks! Once that gets released I'll try it and if so the remediation will be to just deploy the latest openssh version out-of-band from an OS release if you need 7.9+ features.

For anyone else finding this issue, a workaround is to set the following

"remote.SSH.useLocalServer": false,
"remote.SSH.windowsRemotes": ["<your remote's hostname>"]

@roblourens At least for me when disabling useLocalServer (already had server in windowsRemotes), it completely hangs here and never continues. This is true for both less and greater than 7.9

vscode-server already installed. Skipping download...
vscode-server with efd7548df65de8e775015b67863190e6bd4934fc is already running.
47e446dbd685: start
agentPort==26378==
osReleaseId==windows==
osVersion==6.3.9600==
arch==x64==
platform==windows==
47e446dbd685: end
Install script is 3640, watching sshd parent 9400

Can you share the log? That looks like output from the connection in the terminal which should never terminate.

@roblourens which log specifically? Do you have a bug report guide?

The Remote-SSH output channel - I think you had the output from there above

image

And basically what I'm saying is, it's ok if that terminal doesn't quit but vscode should connect (you should be able to open files and so on, and the progress spinner in the lower left corner should go away)

Got it, thanks. I have a pressing item I need to address but I'll do some full testing and report back.

7.7p1 on Server
8.1 on VSCode (Insider) client Windows 10 Insider Slow Ring
UseLocalServer=true works fine

UseLocalServer=false has this for SSH log and it just hangs at the prompt:
image

EDIT: Should also note am accessing this server via a port-forwarded ngrok tunnel

[16:29:27.181] Log Level: 1
[16:29:27.191] [email protected]
[16:29:27.191] win32 x64
[16:29:27.195] SSH Resolver called for "ssh-remote+probe", attempt 1
[16:29:27.195] SSH Resolver called for host: probe
[16:29:27.195] Setting up SSH remote "probe"
[16:29:27.223] Using commit id "efd7548df65de8e775015b67863190e6bd4934fc" and quality "insider" for server
[16:29:27.225] Install and start server if needed
[16:29:27.234] Checking ssh with "ssh -V"
[16:29:27.321] > OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2
[16:29:27.322] Remote command length: 7464/8192 characters
[16:29:27.323] Running script with connection command: ssh -T -o ClearAllForwardings=true probe powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive -Command "$e=[Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('CmVjaG8gImYwZTI5MDQ4Yjg4NjogcnVubmluZyIKJFByb2dyZXNzUHJlZmVyZW5jZSA9ICdTaWxlbnRseUNvbnRpbnVlJwokY29tbWl0SWQgPSAnZWZkNzU0OGRmNjVkZThlNzc1MDE1YjY3ODYzMTkwZTZiZDQ5MzRmYycKCiR2c2NvZGVBcmNoID0gaWYgKCgkZW52OlBST0NFU1NPUl9BUkNISVRFQ1RVUkUgLWVxICdBTUQ2NCcpIC1vciAoJGVudjpQUk9DRVNTT1JfQVJDSElURUNUVVJFIC1lcSAnSUE2NCcpKSB7ICd4NjQnIH0gZWxzZSB7ICdpYTMyJyB9Cgokc2VydmVyUm9vdCA9IChKb2luLVBhdGggKFJlc29sdmUtUGF0aCB+KSAnLnZzY29kZS1zZXJ2ZXItaW5zaWRlcnMnKQokZW52OlZTQ09ERV9BR0VOVF9GT0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3aW5WZXJzaW9uID0gKEdldC1DaW1JbnN0YW5jZSBXaW4zMl9PcGVyYXRpbmdTeXN0ZW0pLlZlcnNpb24KfSBjYXRjaCB7CmVjaG8gIkZhaWxlZCB0byBmaW5kIFdpbmRvd3MgdmVyc2lvbiAtICQoJF8uVG9TdHJpbmcoKSkiCiR3aW5WZXJzaW9uID0gInVua25vd24iCn0KCmVjaG8gImYwZTI5MDQ4Yjg4Njogc3RhcnQiCgplY2hvICJhZ2VudFBvcnQ9PSRwb3J0PT0iCmVjaG8gIm9zUmVsZWFzZUlkPT13aW5kb3dzPT0iCmVjaG8gIm9zVmVyc2lvbj09JHdpblZlcnNpb249PSIKZWNobyAiYXJjaD09JHZzY29kZUFyY2g9PSIKZWNobyAicGxhdGZvcm09PXdpbmRvd3M9PSIKZWNobyAiZjBlMjkwNDhiODg2OiBlbmQiCgoKCmVjaG8gIkluc3RhbGwgc2NyaXB0IGlzICRwaWQsIHdhdGNoaW5nIHNzaGQgcGFyZW50ICRzc2hkUElEIgp3aGlsZSAoJFRydWUpIHsKZXhpdElmTmVlZGVkClN0YXJ0LVNsZWVwIDMwCn0K')))); powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive -EncodedCommand $e"
[16:29:27.326] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[16:29:27.471] "install" terminal received data: "]0;C:\WINDOWS\System32\cmd.exe[?25h"
[16:29:27.472] Got some output, clearing connection timeout
[16:29:27.916] "install" terminal received data: "


















[?25h"
[16:29:31.542] "install" terminal received data: "#< CLIXML"
[16:29:31.566] "install" terminal received data: "f0e29048b886: running"
[16:29:31.814] "install" terminal received data: "Acquiring lock on C:\Users\Allied-Adm
in\.vscode-server-insiders\bin\efd754
8df65de8e775015b67863190e6bd4934fc\vs
code-remote-lock.efd7548df65de8e77501
5b67863190e6bd4934fc"
[16:29:31.850] "install" terminal received data: "Looking for existing server in C:\Use
rs\Allied-Admin\.vscode-server-inside
rs\bin\efd7548df65de8e775015b67863190
e6bd4934fc
vscode-server already installed. Skip
ping download...
vscode-server with efd7548df65de8e775
015b67863190e6bd4934fc is already run
ning."
[16:29:31.874] "install" terminal received data: "f0e29048b886: start   
agentPort==8644==     
osReleaseId==windows==
osVersion==6.3.9600==
arch==x64==
platform==windows==
f0e29048b886: end
"
[16:29:31.875] Received install output:    
agentPort==8644==     
osReleaseId==windows==
osVersion==6.3.9600==
arch==x64==
platform==windows==

[16:29:31.876] Remote server is listening on port 8644
[16:29:31.876] Parsed server configuration: {"agentPort":8644,"osReleaseId":"windows","arch":"x64","platform":"windows"}
[16:29:31.882] Remote command length: 204/8192 characters
[16:29:31.883] Running script with connection command: ssh -T -L 127.0.0.1:14599:127.0.0.1:8644 probe powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive -Command "$e=[Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('ZWNobyBTU0hfQVVUSF9TT0NLPSRTU0hfQVVUSF9TT0NLICYmIGVjaG8gLWUgJ0Nvbm5lY3RlZCB0byBTU0ggSG9zdCAtIFBsZWFzZSBkbyBub3QgY2xvc2UgdGhpcyB0ZXJtaW5hbCcgJiYgd2hpbGUgdHJ1ZTsgZG8gc2xlZXAgMTgwOyBlY2hvIC1uICcgJzsgZG9uZQ==')))); powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive -EncodedCommand $e"
[16:29:31.884] Spawning tunnel with: ssh -T -L 127.0.0.1:14599:127.0.0.1:8644 probe powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive -Command "$e=[Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('ZWNobyBTU0hfQVVUSF9TT0NLPSRTU0hfQVVUSF9TT0NLICYmIGVjaG8gLWUgJ0Nvbm5lY3RlZCB0byBTU0ggSG9zdCAtIFBsZWFzZSBkbyBub3QgY2xvc2UgdGhpcyB0ZXJtaW5hbCcgJiYgd2hpbGUgdHJ1ZTsgZG8gc2xlZXAgMTgwOyBlY2hvIC1uICcgJzsgZG9uZQ==')))); powershell -ExecutionPolicy Unrestricted -NoLogo -NoProfile -NonInteractive -EncodedCommand $e"
[16:29:31.884] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[16:29:31.921] "install" terminal received data: "
Install script is 7764, watching sshd"
[16:29:31.937] "install" terminal received data: "
 parent 8164"
[16:29:32.004] "SSH Tunnel" terminal received data: "]0;C:\WINDOWS\System32\cmd.exe[?25h"
[16:29:32.430] "SSH Tunnel" terminal received data: "


















[?25h"
[16:29:32.904] "install" terminal received data: "5b67863190e6bd4934fc
Looking for existing server in C:\Use
rs\Allied-Admin\.vscode-server-inside
rs\bin\efd7548df65de8e775015b67863190
e6bd4934fc
vscode-server already installed. Skip
ping download...
vscode-server with efd7548df65de8e775
015b67863190e6bd4934fc is already run
ning.
f0e29048b886: start
agentPort==8644==
osReleaseId==windows==
osVersion==6.3.9600==
arch==x64==
platform==windows==
f0e29048b886: end
Install script is 7764, watching sshd
 parent 8164
[?25h"
[16:29:32.913] "SSH Tunnel" terminal received data: "


















[?25h"
[16:29:36.034] "SSH Tunnel" terminal received data: "#< CLIXML"
[16:29:36.042] "SSH Tunnel" terminal received data: "<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">At line:1 char:35_x000D__x000A_</S><S S="
Error">+ echo SSH_AUTH_SOCK=$SSH_AUTH_SOCK &amp;&amp; echo -e 'Connected to SSH Host - ..._x000D__x000A_</S><S S="Error">+
                       ~~_x000D__x000A_</S><S S="Error">The token '&amp;&amp;' is not a valid statement separator in this version._x00
0D__x000A_</S><S S="Error">At line:1 char:106_x000D__x000A_</S><S S="Error">+ ... Connected to SSH Host - Please do not close this ter
minal' &amp;&amp; while t ..._x000D__x000A_</S><S S="Error">+                                                                ~~_x000D_
_x000A_</S><S S="Error">The token '&amp;&amp;' is not a valid statement separator in this version._x000D__x000A_</S><S S="Error">At li
ne:1 char:123_x000D__x000A_</S><S S="Error">+ ... H Host - Please do not close this terminal' &amp;&amp; while true; do sleep 1 ..._x0
00D__x000A_</S><S S="Error">+                                                                  ~_x000D__x000A_</S><S S="Error">Missing
 statement body in do loop._x000D__x000A_</S><S S="Error">    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecord
Ex _x000D__x000A_</S><S S="Error">   ception_x000D__x000A_</S><S S="Error">    + FullyQualifiedErrorId : InvalidEndOfLine_x000D__x000A
_</S><S S="Error"> _x000D__x000A_</S></Objs>"
[16:29:36.479] "SSH Tunnel" terminal command done
[16:29:36.480] SSH tunnel command completed unexpectedly
[16:29:36.540] "install" terminal received data: "5b67863190e6bd4934fc
Looking for existing server in C:\Users\Allied-Admin\.vscode-server-insiders\bin\efd7548df65de8e775015b67863190e6bd4934fc
vscode-server already installed. Skipping download...
vscode-server with efd7548df65de8e775015b67863190e6bd4934fc is already running.
f0e29048b886: start
agentPort==8644==
osReleaseId==windows==
osVersion==6.3.9600==
arch==x64==
platform==windows==
f0e29048b886: end
Install script is 7764, watching sshd parent 8164







[?25h"

Do you have remote.SSH.enableDynamicForwarding disabled? Too many settings... if not can you share the ssh settings you have set?

Is this issue in Windows itself or the version of ssh shipped with windows?

Do to #2512 I installed the SSH nightly extension. I have since set the extension settings back to default. On my host I have openssh installed from Windows optional feature and ssh installed from git. The VS Code SSH extension is once again finding ssh.exe which is installed with git. Using ssh installed with git appears to be the preferred approach #2512 Comment.

I'm trying to connect to a Windows 8 machine running OpenSSH_for_Windows_8.0p1, LibreSSL 2.6.5.


log

[09:29:23.764] Log Level: 2
[09:29:23.771] [email protected]
[09:29:23.771] win32 x64
[09:29:23.773] SSH Resolver called for "ssh-remote+sl92", attempt 1
[09:29:23.773] SSH Resolver called for host: sl92
[09:29:23.773] Setting up SSH remote "sl92"
[09:29:23.776] Acquiring local install lock: C:\Users\MY_USERNAME\AppData\Local\Temp\vscode-remote-ssh-sl92-install.lock
[09:29:23.790] Looking for existing server data file at c:\Users\MY_USERNAME\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-ssh-nightly\vscode-ssh-host-sl92-fe22a9645b44368865c0ba92e2fb881ff1afce94-2020.3.25802\data.json
[09:29:23.791] Using commit id "fe22a9645b44368865c0ba92e2fb881ff1afce94" and quality "stable" for server
[09:29:23.793] Install and start server if needed
[09:29:23.816] Checking ssh with "ssh -V"
[09:29:23.902] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[09:29:23.902] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[09:29:23.943] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[09:29:23.943] Checking ssh with "C:\Program Files\Git\usr\bin\ssh.exe -V"
[09:29:24.961] > OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019
[09:29:24.964] Using SSH config file "C:\Users\MY_USERNAME\.ssh\config"
[09:29:24.964] askpass server listening on \\.\pipe\vscode-ssh-askpass-788f48975985de322806231b1d86341d8f6519f3-sock
[09:29:24.965] Spawning local server with {"ipcHandlePath":"\\\\.\\pipe\\vscode-ssh-askpass-dfd1c8c1c0c6c3cc3bfd417b6d848a2dc78e5196-sock","sshCommand":"C:\\Program Files\\Git\\usr\\bin\\ssh.exe","sshArgs":["-v","-T","-D","64423","-F","C:\\Users\\MY_USERNAME\\.ssh\\config","sl92"],"dataFilePath":"c:\\Users\\MY_USERNAME\\AppData\\Roaming\\Code\\User\\globalStorage\\ms-vscode-remote.remote-ssh-nightly\\vscode-ssh-host-sl92-fe22a9645b44368865c0ba92e2fb881ff1afce94-2020.3.25802\\data.json"}
[09:29:24.965] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"c:\\Users\\MY_USERNAME\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-nightly-2020.3.25802\\out\\local-server\\askpass.bat","VSCODE_SSH_ASKPASS_NODE":"C:\\Program Files\\Microsoft VS Code\\Code.exe","VSCODE_SSH_ASKPASS_MAIN":"c:\\Users\\MY_USERNAME\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-nightly-2020.3.25802\\out\\askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"\\\\.\\pipe\\vscode-ssh-askpass-788f48975985de322806231b1d86341d8f6519f3-sock"}
[09:29:24.973] Spawned 14060
[09:29:25.059] > local-server> Spawned ssh: 18248
[09:29:25.109] stderr> OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019
[09:29:25.232] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:kUZusHekV+ojgPCkz/zGjmYEVntjNHw4sBTy5GlRfzI
[09:29:25.372] Got askpass request: {"request":"The authenticity of host 'sl92 (172.16.20.132)' can't be established."}
[09:29:25.373] Detected first line fingerprint confirmation message
[09:29:25.373] Showing fingerprint confirmation dialog
[09:29:25.374] Listening for interwindow password on \\.\pipe\vscode-ssh-askpass-7460cb6c2b4d3cc1c61c6a48a8632127999cbf24-sock
[09:29:25.374] Writing password prompt to globalState
[09:29:27.170] Got fingerprint response: yes
[09:29:27.170] Interactor gave response: yes
[09:29:27.170] Cleaning up other-window auth server
[09:29:27.198] stderr> Failed to add the host to the list of known hosts (/h/.ssh/known_hosts).
[09:29:27.410] Got askpass request: {"request":"engineer@sl92's password: "}
[09:29:27.410] Showing password prompt
[09:29:27.412] Listening for interwindow password on \\.\pipe\vscode-ssh-askpass-1f1b2eae9875f7c1f2d32bbdbfa78097d9a423c6-sock
[09:29:27.412] Writing password prompt to globalState
[09:29:29.293] Got password response
[09:29:29.293] Interactor gave response: ****
[09:29:29.293] Cleaning up other-window auth server
[09:29:29.332] stderr> Authenticated to sl92 ([172.16.20.132]:22).
[09:29:29.451] stderr> shell request failed on channel 2
[09:29:29.455] > local-server> ssh child died, shutting down
[09:29:29.462] Local server exit: 0
[09:29:29.463] Received install output: OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:kUZusHekV+ojgPCkz/zGjmYEVntjNHw4sBTy5GlRfzI
Failed to add the host to the list of known hosts (/h/.ssh/known_hosts).
Authenticated to sl92 ([172.16.20.132]:22).
shell request failed on channel 2

[09:29:29.463] Stopped parsing output early. Remaining text: OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019debug1: Server host key: ecdsa-sha2-nistp256 SHA256:kUZusHekV+ojgPCkz/zGjmYEVntjNHw4sBTy5GlRfzIFailed to add the host to the list of known hosts (/h/.ssh/known_hosts).Authenticated to sl92 ([172.16.20.132]:22).shell request failed on channel 2
[09:29:29.463] Failed to parse remote port from server output
[09:29:29.464] Resolver error: 
[09:29:29.466] ------

@soul4soul that looks like an older version of the nightly ssh extension

@roblourens as far as I can see this is still a problem

debug1: Server host key: ecdsa-sha2-nistp256 SHA256:yYWMXXuJSdNDQ/lhxr/l72WDtqZGE+f53B660KXhkjs
Authenticated to xxx.xxx ([xxx.xxx.217.178]:10001).
shell request failed on channel 2

[16:29:14.800] Stopped parsing output early. Remaining text: OpenSSH_for_Windows_8.1p1, LibreSSL 2.9.2debug1: Server host key: ecdsa-sha2-nistp256 SHA256:yYxxxxx/lhxr/l72WDtqZGE+f53B660KXhkjsAuthenticated to xxx.link ([xxx.xxx.217.178]:10001).shell request failed on channel 2
[16:29:14.801] Failed to parse remote port from server output

Can you share the full log and the ssh settings you have? There have been a bunch of changes since March.

You may need

"remote.SSH.useLocalServer": false,
"remote.SSH.remotePlatform": {
        "<host name>": "windows"
},

if you have overridden these but the defaults should work

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@roblourens Just an FYI that it still definitely has issues with 8 and 8.1. Are you unable to reproduce?

I don't think https://github.com/PowerShell/Win32-OpenSSH/issues/1545 is expected to be fixed in 8.1. Can't tell you why the release pace is so slow.

From what I remember, "remote.SSH.useLocalServer": false is enough to work around this, is that true?

@roblourens as of my latest tests it can "work" but it is very flaky and still gets stuck on server install/connect script for random reasons and I get a lot of disconnections and reload prompts, whereas 7.7 "just works".

The problem I'm aware of would break it entirely, not make it flaky, so that's interesting. Could you share a log showing any new failures besides the shell request failed on channel 2 one?

@roblourens I'm in a bit of a crunch at the moment but I will spin up a fresh VM and test it to reproduce when I have availability.

Same situation, I will also test some more when I am able.

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

Was this page helpful?
0 / 5 - 0 ratings