Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH to Termux not working. #3769

Closed
Vinchethescript opened this issue Sep 29, 2020 · 9 comments
Closed

SSH to Termux not working. #3769

Vinchethescript opened this issue Sep 29, 2020 · 9 comments
Labels
ssh Issue in vscode-remote SSH

Comments

@Vinchethescript
Copy link

Vinchethescript commented Sep 29, 2020

  • VSCode Version: Latest, installed from Arch's official repositories.
  • Local OS Version: Arch Linux x86_x64, kernel 5.8.3arch1-1.
  • Remote OS Version: Android 8.0 Termux.
  • Remote Extension/Connection Type: SSH.

Steps to Reproduce:

  1. Install Termux from Play Store.
  2. Install openssh package from pkg and run sshd.
  3. Try to connect via VSCode to your phone's IP.

Does this issue occur when you try this locally?: No.
Does this issue occur when you try this locally and all extensions are disabled?: No.

When this happens, I get this window:
Error window

Output:
(Full log file here)

[19:46:59.741] Log Level: 2
[19:46:59.758] remote-ssh-nightly@2020.9.41220
[19:46:59.771] linux x64
[19:46:59.837] SSH Resolver called for "ssh-remote+termux", attempt 1
[19:46:59.838] SSH Resolver called for host: termux
[19:46:59.838] Setting up SSH remote "termux"
[19:46:59.889] Acquiring local install lock: /tmp/vscode-remote-ssh-termux-install.lock
[19:47:00.430] Looking for existing server data file at /home/vincysuper07/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh-nightly/vscode-ssh-host-termux-cd9ea6488829f560dc949a8b2fb789f3cdc05f5d-2020.9.41220/data.json
[19:47:00.433] Using commit id "cd9ea6488829f560dc949a8b2fb789f3cdc05f5d" and quality "stable" for server
[19:47:00.437] Install and start server if needed
[19:47:00.452] Checking ssh with "ssh -V"
[19:47:00.488] > OpenSSH_8.3p1, OpenSSL 1.1.1g  21 Apr 2020

[19:47:00.502] askpass server listening on /run/user/1000/vscode-ssh-askpass-ef4cd26a86b55293d6021b5ac4c58c181222b7cb.sock
[19:47:00.503] Spawning local server with {"ipcHandlePath":"/run/user/1000/vscode-ssh-askpass-e93d62bae4a73b520b3556c2e91d400250d65bc7.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","36421","-o","ConnectTimeout=15","termux"],"dataFilePath":"/home/vincysuper07/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh-nightly/vscode-ssh-host-termux-cd9ea6488829f560dc949a8b2fb789f3cdc05f5d-2020.9.41220/data.json"}
[19:47:00.503] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/usr/share/code/code","VSCODE_SSH_ASKPASS_MAIN":"/home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/run/user/1000/vscode-ssh-askpass-ef4cd26a86b55293d6021b5ac4c58c181222b7cb.sock"}
[19:47:00.644] Spawned 14777
[19:47:00.983] > local-server> Spawned ssh: 14785
[19:47:00.995] stderr> OpenSSH_8.3p1, OpenSSL 1.1.1g  21 Apr 2020
[19:47:01.636] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:PBpxaq+39w5AHXZimu8QdknNMJeeoVq5IY3Aan5R+6A
[19:47:02.482] Got askpass request: {"request":"vincysuper07@termux's password:"}
[19:47:02.498] Showing password prompt
[19:47:02.501] Listening for interwindow password on /run/user/1000/vscode-ssh-askpass-b28a01b73a8e24decbab14dd6e2f09fcf4bf36c2.sock
[19:47:02.501] Writing password prompt to globalState
[19:47:08.510] Got password response
[19:47:08.518] Interactor gave response: *******
[19:47:08.520] Cleaning up other-window auth server
[19:47:09.228] stderr> Authenticated to termux ([192.168.1.8]:2222).
[19:47:09.298] > e (Yes, this is my MOTD.)
[19:47:09.397] > ready: 595058a859a3
[19:47:09.430] > Linux 3.18.91-14843133-QB29764553 #1 SMP PREEMPT Tue Mar 10 14:31:46 KST 2020
[19:47:09.433] Platform: linux
[19:47:09.547] > 595058a859a3: running
[19:47:09.707] > Warning: Can't find libstdc++.so or ldconfig, can't verify libstdc++ version
[19:47:09.746] > Missing GLIBC >= 2.17!
> Found version 
> 595058a859a3$$1$$
[19:47:09.761] > Acquiring lock on /data/data/com.termux/files/home/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d/vscode-remote-lock.u0_a208.cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
[19:47:09.805] > Found existing installation at /data/data/com.termux/files/home/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d...
[19:47:09.811] > Checking /data/data/com.termux/files/home/.vscode-server/.cd9ea6488829f560dc949a8b2fb789f3cdc05f5d.log and /data/data/com.termux/files/home/.vscode-server/.cd9ea6488829f560dc949a8b2fb789f3cdc05f5d.pid for a running server
[19:47:09.828] > Looking for server with pid: 22479
[19:47:09.911] > Starting server with command... /data/data/com.termux/files/home/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d/server.sh --host=127.0.0.1 --enable-remote-auto-shutdown  --port=0 &> "/data/data/com.termux/files/home/.vscode-server/.cd9ea6488829f560dc949a8b2fb789f3cdc05f5d.log" < /dev/null
> printenv:
[19:47:09.935] >     SHELL=/data/data/com.termux/files/usr/bin/zsh
>     PREFIX=/data/data/com.termux/files/usr
>     PWD=/data/data/com.termux/files/home
>     LOGNAME=u0_a208
>     EXTERNAL_STORAGE=/sdcard
>     LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
>     HOME=/data/data/com.termux/files/home
>     LANG=en_US.UTF-8
>     TMPDIR=/data/data/com.termux/files/usr/tmp
>     VSCODE_AGENT_FOLDER=/data/data/com.termux/files/home/.vscode-server
>     SSH_CONNECTION=192.168.1.9 49048 192.168.1.8 2222
>     ANDROID_DATA=/data
>     USER=u0_a208
>     SHLVL=1
>     ANDROID_ROOT=/system
>     BOOTCLASSPATH=/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/legacy-test.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/apache-xml.jar:/system/framework/org.apache.http.legacy.boot.jar:/system/framework/smartbondingservice.jar:/system/framework/sprengine.jar:/system/framework/android.hidl.base-V1.0-java.jar:/system/framework/android.hidl.manager-V1.0-java.jar:/system/framework/timakeystore.jar:/system/framework/fipstimakeystore.jar:/system/framework/ucmopensslenginehelper.jar:/system/framework/esecomm.jar:/system/framework/SemAudioThumbnail.jar:/system/framework/knoxsdk.jar:/system/framework/sec_edm.jar:/system/framework/sagearpolicymanager.jar:/system/framework/sec_sdp_sdk.jar:/system/framework/sec_sdp_hidden_sdk.jar:/system/framework/knoxvpnuidtag.jar
>     SSH_CLIENT=192.168.1.9 49048 2222
>     PATH=/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets
>     OLDPWD=/data/data/com.termux/files/home
>     _=/data/data/com.termux/files/usr/bin/printenv
[19:47:09.939] > Spawned remote server: 23819
[19:47:09.980] > Waiting for server log...
[19:47:10.543] > Waiting for server log...
[19:47:11.101] > Waiting for server log...
[19:47:11.654] > Waiting for server log...
[19:47:12.220] > Waiting for server log...
[19:47:12.777] > Waiting for server log...
[19:47:13.337] > Waiting for server log...
[19:47:13.910] > Waiting for server log...
[19:47:14.470] > Waiting for server log...
[19:47:15.023] > Waiting for server log...
[19:47:15.612] > Waiting for server log...
[19:47:16.205] > Waiting for server log...
[19:47:16.841] > Waiting for server log...
[19:47:17.356] > Waiting for server log...
[19:47:17.881] >  
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>  
[19:47:17.948] > Server did not start successfully. Full server log at /data/data/com.termux/files/home/.vscode-server/.cd9ea6488829f560dc949a8b2fb789f3cdc05f5d.log >>>
[19:47:17.964] > /data/data/com.termux/files/home/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d/server.sh: 12: /data/data/com.termux/files/home/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d/node: not found
[19:47:17.967] > <<< End of server log
> 595058a859a3: start
> exitCode==32==
> sshAuthSock====
> listeningOn====
> osReleaseId==Linux==
> arch==aarch64==
> webUiAccessToken====
> tmpDir==/tmp==
> platform==linux==
> 595058a859a3: end
[19:47:17.969] Received install output: 
exitCode==32==
sshAuthSock====
listeningOn====
osReleaseId==Linux==
arch==aarch64==
webUiAccessToken====
tmpDir==/tmp==
platform==linux==

[19:47:17.986] Terminating local server
[19:47:18.061] Resolver error: Error: The VS Code Server failed to start
	at Function.ServerInstallError (/home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/extension.js:1:94355)
	at /home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/extension.js:1:92571
	at Object.t.handleInstallOutput (/home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/extension.js:1:93073)
	at Object.t.tryInstallWithLocalServer (/home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/extension.js:127:102430)
	at processTicksAndRejections (internal/process/task_queues.js:85:5)
	at async /home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/extension.js:127:104510
	at async Object.t.withShowDetailsEvent (/home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/extension.js:127:110096)
	at async /home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/extension.js:127:101003
	at async R (/home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/extension.js:127:97793)
	at async Object.t.resolveWithLocalServer (/home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/extension.js:127:100652)
	at async Object.t.resolve (/home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/extension.js:127:108038)
	at async /home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/extension.js:127:143767

@github-actions github-actions bot added the ssh Issue in vscode-remote SSH label Sep 29, 2020
@Vinchethescript
Copy link
Author

Right now I just realized that the problem was that the nodejs package wasn't installed in Termux. Since I can't check right now, I'll keep this issue open if VSCode still doesn't work.

@Vinchethescript
Copy link
Author

Vinchethescript commented Sep 30, 2020

So, I installed the nodejs package in Termux. Now, on VSCode, I get these errors:

I can't open any file or start terminal, but it connects to Termux.
This is what I get on the output:

[09:49:31.367] Log Level: 2
[09:49:31.386] remote-ssh-nightly@2020.9.41220
[09:49:31.387] linux x64
[09:49:31.432] SSH Resolver called for "ssh-remote+termux", attempt 1
[09:49:31.433] SSH Resolver called for host: termux
[09:49:31.433] Setting up SSH remote "termux"
[09:49:31.468] Acquiring local install lock: /tmp/vscode-remote-ssh-termux-install.lock
[09:49:31.737] Looking for existing server data file at /home/vincysuper07/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh-nightly/vscode-ssh-host-termux-cd9ea6488829f560dc949a8b2fb789f3cdc05f5d-2020.9.41220/data.json
[09:49:31.754] Using commit id "cd9ea6488829f560dc949a8b2fb789f3cdc05f5d" and quality "stable" for server
[09:49:31.761] Install and start server if needed
[09:49:31.794] Checking ssh with "ssh -V"
[09:49:31.914] > OpenSSH_8.3p1, OpenSSL 1.1.1g  21 Apr 2020

[09:49:31.939] askpass server listening on /run/user/1000/vscode-ssh-askpass-953a2e2918fe32e8526d206d73da429123d95e7d.sock
[09:49:31.946] Spawning local server with {"ipcHandlePath":"/run/user/1000/vscode-ssh-askpass-d559f4276bb4555b9d79c2c0d73f7cedd4fa035a.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","42183","-o","ConnectTimeout=15","termux"],"dataFilePath":"/home/vincysuper07/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh-nightly/vscode-ssh-host-termux-cd9ea6488829f560dc949a8b2fb789f3cdc05f5d-2020.9.41220/data.json"}
[09:49:31.947] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/usr/share/code/code","VSCODE_SSH_ASKPASS_MAIN":"/home/vincysuper07/.vscode/extensions/ms-vscode-remote.remote-ssh-nightly-2020.9.41220/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/run/user/1000/vscode-ssh-askpass-953a2e2918fe32e8526d206d73da429123d95e7d.sock"}
[09:49:31.986] Spawned 18847
[09:49:32.416] > local-server> Spawned ssh: 18855
[09:49:32.427] stderr> OpenSSH_8.3p1, OpenSSL 1.1.1g  21 Apr 2020
[09:49:32.551] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:PBpxaq+39w5AHXZimu8QdknNMJeeoVq5IY3Aan5R+6A
[09:49:32.926] Got askpass request: {"request":"vincysuper07@termux's password:"}
[09:49:32.932] Showing password prompt
[09:49:32.935] Listening for interwindow password on /run/user/1000/vscode-ssh-askpass-f948ab2c21ce078b31716c17ace7b061211d7c91.sock
[09:49:32.935] Writing password prompt to globalState
[09:49:37.787] Got password response
[09:49:37.788] Interactor gave response: *******
[09:49:37.790] Cleaning up other-window auth server
[09:49:38.049] stderr> Authenticated to termux ([192.168.1.8]:2222).
[09:49:38.334] > e
[09:49:38.409] > ready: 440e04282643
[09:49:38.449] > Linux 3.18.91-14843133-QB29764553 #1 SMP PREEMPT Tue Mar 10 14:31:46 KST 2020
[09:49:38.450] Platform: linux
[09:49:38.625] > 440e04282643: running
[09:49:38.842] > Warning: Can't find libstdc++.so or ldconfig, can't verify libstdc++ version
[09:49:38.845] > Missing GLIBC >= 2.17!
> Found version 
> 440e04282643$$1$$
> Acquiring lock on /data/data/com.termux/files/home/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d/vscode-remote-lock.u0_a208.cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
[09:49:38.882] > Found existing installation at /data/data/com.termux/files/home/.vscode-server/bin/cd9ea6488829f560dc949a8b2fb789f3cdc05f5d...
[09:49:38.884] > Checking /data/data/com.termux/files/home/.vscode-server/.cd9ea6488829f560dc949a8b2fb789f3cdc05f5d.log and /data/data/com.termux/files/home/.vscode-server/.cd9ea6488829f560dc949a8b2fb789f3cdc05f5d.pid for a running server
[09:49:38.901] > Looking for server with pid: 27166
[09:49:39.006] > Found running server...
>  
[09:49:39.007] > *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>  
[09:49:39.126] > Checking server status on port 55037 with wget
[09:49:39.174] > 440e04282643: start
> sshAuthSock====
> listeningOn==55037==
[09:49:39.177] > osReleaseId==Linux==
> arch==aarch64==
> webUiAccessToken====
> tmpDir==/tmp==
> platform==linux==
> 440e04282643: end
[09:49:39.178] Received install output: 
sshAuthSock====
listeningOn==55037==osReleaseId==Linux==
arch==aarch64==
webUiAccessToken====
tmpDir==/tmp==
platform==linux==

[09:49:39.181] Remote server is listening on 55037
[09:49:39.182] Parsed server configuration: {"remoteListeningOn":{"port":55037},"osReleaseId":"Linux","arch":"aarch64","webUiAccessToken":"","sshAuthSock":"","tmpDir":"/tmp","platform":"linux"}
[09:49:39.182] ** Note: Support for architecture "aarch64" is in preview **
[09:49:39.191] Persisting server connection details to /home/vincysuper07/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh-nightly/vscode-ssh-host-termux-cd9ea6488829f560dc949a8b2fb789f3cdc05f5d-2020.9.41220/data.json
[09:49:39.197] Starting forwarding server. localPort 45967 -> socksPort 42183 -> remotePort 55037
[09:49:39.199] Forwarding server listening on 45967
[09:49:39.200] Waiting for ssh tunnel to be ready
[09:49:39.203] [Forwarding server 45967] Got connection 0
[09:49:39.219] Tunneled 55037 to local port 45967
[09:49:39.219] Resolved "ssh-remote+termux" to "127.0.0.1:45967"
[09:49:39.265] ------




[09:49:39.466] [Forwarding server 45967] Got connection 1
[09:49:39.467] [Forwarding server 45967] Got connection 2

@Vinchethescript
Copy link
Author

I have recently switched to Pop!_OS, and it still doesn't work...

@bamurtaugh
Copy link
Member

Based on the warning you're seeing: The remote host may not meet VS Code Server's prerequites for glibc and libstdc++, the extension is essentially warning you that it needs certain versions of glibc and libstdc++, and it looks like you don't have those versions available.

This link explains more and has some tips on getting those installed for different distros.

@Vinchethescript
Copy link
Author

I tried checking that page as you told me, but there isn't anything about Termux. Isn't there an alternative way (e.g. compiling the libraries)?

@bamurtaugh
Copy link
Member

Digging into this a bit further, it actually looks like Termux support is an outstanding feature request: #1338. The user in that thread faced similar issues with the server being unable to start and Node.

@Vinchethescript
Copy link
Author

Vinchethescript commented Oct 29, 2020

Oh, in that case, I would also suggest to add Termux support, because it looks like there isn't Termux/AArch64 support on Remote. A good thing would be adding a separated option dedicated for Termux, so that the Linux one will not be edited for Termux's support.

@bamurtaugh
Copy link
Member

Thanks for the feedback here @Vincysuper07. Since I believe the request here is covered by 1338, I'll go ahead and close this thread (please feel free to comment/upvote in that thread too), but please let me know if you have any other questions or feedback, and I'd be happy to chat further!

@Vinchethescript
Copy link
Author

@bamurtaugh, another thing: Googling about how to compile the requirements on Termux, I found out that Termux does not support glibc. I didn't look for libstdc++, but I know that glibc is not supported.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

2 participants