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

Support ssh to IBM i #520

Open
worksofliam opened this issue May 30, 2019 · 8 comments
Open

Support ssh to IBM i #520

worksofliam opened this issue May 30, 2019 · 8 comments
Labels
feature-request Request for new features or functionality ssh Issue in vscode-remote SSH

Comments

@worksofliam
Copy link

  • VSCode Version: Insiders 1.35.0
  • Local OS Version: macOS Mojave 10.14.5
  • Remote OS Version: IBM i 7.3
  • Remote Extension/Connection Type: SSH

Steps to Reproduce:

  1. Connect to remote system
  2. Remote system is IBM i

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

image

The system is not unreachable. I am using SSH FS anyway, but was hoping to utilise this to make use of the git client working on the remote server.

@worksofliam
Copy link
Author

Possibly related to #19

@mjbvz mjbvz added the ssh Issue in vscode-remote SSH label May 30, 2019
@mjbvz mjbvz changed the title Cannot connect to IBM i Support ssh to IBM i May 30, 2019
@mjbvz mjbvz added the feature-request Request for new features or functionality label May 30, 2019
@mjbvz
Copy link

mjbvz commented May 30, 2019

I don't think this is related to #19. As the error notes, only Linux x86_64 ssh hosts are supported at the moment

I've marked this as a feature request to support connecting to IBM i machines

@lars18th
Copy link

It will be desirable to support any POSIX SSH server in any platform/architecture.

For example, in my daily use of VSCode Remote SSH (in testing at time) I compile manually with make, and I debug with gdbserver :<IP-PORT> ./my-program_g .... So, the requirments to use this great extension could be reduced to:

SERVER REQUIREMENTS:

  • POSIX environment
  • SSH server
  • BASH shell
  • GCC compiler
  • MAKE tool
  • GDB debugger

I hope someday this will be true. 🍷

@ThePrez
Copy link

ThePrez commented Aug 6, 2019

Can anybody identify where the source code for this would be? I'd love to help make this happen and can send a PR, but unfortunately, I'm having trouble finding the correct repository to even begin looking at this. Any insight is appreciated.

@tb-mtg
Copy link

tb-mtg commented Apr 7, 2021

Any update on this request?

@jkyeung
Copy link

jkyeung commented Apr 9, 2021

Looking at the picture here, it would seem that the remote system has to be able to run a "VS Code Server", whatever that entails. I would not be at all surprised if getting such a thing to run on IBM i is nontrivial.

@priceaj
Copy link

priceaj commented Apr 9, 2021

Looking at it the server runs on node which is supported on IBMi

I have used the instructions here to extract the linux bundle and put in on the public IBMi hosted at pub400.com.

Node is installed on the IBMi

$ node --version
v12.22.1

However the version of node bundled with the extension does not work

The server.sh script does not work as it calls ./node

./server.sh: ./node: cannot execute

However

node ./out/vs/server/main.js --host 127.0.0.1

seems to work partially, but with errors:

Extension host agent listening on 8000

[10:03:11] Extension host agent started.
Error: Could not load module /home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/node_modules/spdlog/build/Release/spdlog.node.
The module has an invalid magic number.
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at bindings (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/node_modules/bindings/bindings.js:112:48)
at Object. (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/node_modules/spdlog/index.js:3:35)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at t (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:5:101)
at r.load (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:4:1656)
at r.load (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:3:10262)
at l (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:5:10314)
at Object.errorback (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:5:10435)
at r.triggerErrorback (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:3:10626)
at /home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:3:10332
at r.load (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:4:1673)
at r.load (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:3:10262)
at l (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:5:10314)
at r._loadModule (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:5:10444)
at r._resolve (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:6:452)
at r.defineModule (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:5:6145)
at r._relativeRequire (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:5:6831)
at n (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/loader.js:5:9420)
at I.w (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/server/remoteExtensionHostAgent.js:80:51249)
at new Promise ()
at I (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/server/remoteExtensionHostAgent.js:80:51229)
at L._createSpdLogLogger (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/server/remoteExtensionHostAgent.js:80:52162)
at new L (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/server/remoteExtensionHostAgent.js:80:51978)
at /home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/server/remoteExtensionHostAgent.js:148:126
at new se (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/server/remoteExtensionHostAgent.js:117:1609)
at Le (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/server/remoteExtensionHostAgent.js:132:342)
at Object.n [as createServer] (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/server/remoteExtensionHostAgent.js:148:1378)
at /home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/server/main.js:1:782
at async Server. (/home/XXX/.vscode-server/bin/c185983a683d14c396952dd432459097bc7f757f/out/vs/server/main.js:12:99) {
phase: 'loading',
moduleId: 'spdlog',
neededBy: [ '===anonymous3===' ]
}
[10:03:11] [File Watcher (node.js)] Failed to watch /home/XXX/.vscode-remote/data/Machine for changes using fs.watch() (Error: ENOSYS: function not implemented, watch '/home/XXX/.vscode-remote/data/Machine')
[10:03:11] [File Watcher (node.js)] Failed to watch /home/XXX/.vscode-remote/extensions for changes using fs.watch() (Error: ENOSYS: function not implemented, watch '/home/XXX/.vscode-remote/extensions')
[10:03:17] No ptyHost heartbeat after 6 seconds
[10:03:21] [Error: ENOENT: no such file or directory, scandir '/home/XXX/.vscode-remote/data/logs'] {
errno: -2,
code: 'ENOENT',
syscall: 'scandir',
path: '/home/XXX/.vscode-remote/data/logs'
}

However even with that the installer still has errors:

[11:06:45.796] Log Level: 2
[11:06:45.807] [email protected]
[11:06:45.807] win32 x64
[11:06:45.809] SSH Resolver called for "ssh-remote+pub400.com", attempt 1
[11:06:45.810] "remote.SSH.useLocalServer": false
[11:06:45.810] "remote.SSH.showLoginTerminal": false
[11:06:45.811] "remote.SSH.remotePlatform": {}
[11:06:45.811] "remote.SSH.sshPath": undefined
[11:06:45.811] "remote.SSH.sshConfigurationFile": undefined
[11:06:45.811] "remote.SSH.useFlock": true
[11:06:45.812] "remote.SSH.lockfilesInTmp": false
[11:06:45.812] "remote.SSH.localServerDownload": auto
[11:06:45.812] "remote.SSH.remoteServerListenOnSocket": false
[11:06:45.813] "remote.SSH.showLoginTerminal": false
[11:06:45.813] "remote.SSH.defaultExtensions": []
[11:06:45.813] SSH Resolver called for host: pub400.com
[11:06:45.814] Setting up SSH remote "pub400.com"
[11:06:45.847] Using commit id "c185983a683d14c396952dd432459097bc7f757f" and quality "stable" for server
[11:06:45.858] Install and start server if needed
[11:06:54.739] Checking ssh with "ssh -V"
[11:06:54.750] Got error from ssh: spawn ssh ENOENT
[11:06:54.750] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[11:06:54.752] Got error from ssh: spawn C:\WINDOWS\System32\OpenSSH\ssh.exe ENOENT
[11:06:54.752] Checking ssh with "C:\Program Files\Git\usr\bin\ssh.exe -V"
[11:06:54.855] > OpenSSH_8.5p1, OpenSSL 1.1.1k 25 Mar 2021

[11:06:54.862] Running script with connection command: "C:\Program Files\Git\usr\bin\ssh.exe" -T -D 56481 "pub400.com" bash
[11:06:54.867] Terminal shell path: C:\WINDOWS\System32\cmd.exe
[11:06:56.167] > �]0;C:\WINDOWS\System32\cmd.exe�
[11:06:56.167] Got some output, clearing connection timeout
[11:06:56.170] > [email protected]'s password:
[11:06:56.171] Showing password prompt
[11:06:58.226] Got password response
[11:06:58.226] "install" wrote data to terminal: "****************"
[11:06:58.254] >
[11:06:58.789] > 29b9ca06a4dc: running
[11:06:59.267] > grep: illegal option -- a

usage: grep [-r] [-R] [-H] [-L] [-E|-F] [-c|-l|-q] [-insvxbhwyu] [-p[parasep]] -
e pattern_list...
[-f pattern_file...] [file...]
usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwyu] [-p[parasep]] [-e pattern_list...]
-f pattern_file... [file...]
usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwyu] [-p[parasep]] pattern_list [file...
]
[11:06:59.801] > grep: illegal option -- a
usage: grep [-r] [-R] [-H] [-L] [-E|-F] [-c|-l|-q] [-insvxbhwyu] [-p[parasep]] -
e pattern_list...
[-f pattern_file...] [file...]
usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwyu] [-p[parasep]] [-e pattern_list...]
-f pattern_file... [file...]
usage: grep [-E|-F] [-c|-l|-q] [-insvxbhwyu] [-p[parasep]] pattern_list [file...
]
[11:07:00.257] > Unsupported platform: OS400
29b9ca06a4dc: start
exitCode==35==
listeningOn====
osReleaseId==OS400==
arch====
tmpDir==/tmp==
platform====
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
[11:07:00.260] >
serverStartTime====
29b9ca06a4dc: end
[11:07:00.261] Received install output:
exitCode==35==
listeningOn====
osReleaseId==OS400==
arch====
tmpDir==/tmp==
platform====
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====

[11:07:00.264] Failed to parse remote port from server output
[11:07:00.272] Resolver error: Error:
at Function.Create (c:\Users\XXX.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:1:64328)
at Object.t.handleInstallOutput (c:\Users\XXX.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:1:63022)
at q (c:\Users\XXX.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:1:296373)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async c:\Users\XXX.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:1:294221
at async Object.t.withShowDetailsEvent (c:\Users\XXX.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:1:407055)
at async Object.t.resolve (c:\Users\XXX.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:1:297912)
at async c:\Users\XXX.vscode\extensions\ms-vscode-remote.remote-ssh-0.65.1\out\extension.js:127:110485
[11:07:00.286] ------

[11:07:00.800] "install" terminal command done
[11:07:00.801] Install terminal quit with output:

although these seem to be down to the script detecting the OS version deliberately throwing an error

does anyone know if the extension and server code is open source? I'm sure the community could add support given time

@jkyeung
Copy link

jkyeung commented Apr 13, 2021

Node is installed on the IBMi

However the version of node bundled with the extension does not work

Right. Arbitrary versions of node are not going to work on IBM i. The quirks of the platform are such that, at least for now, a lot of key software has to be ported by people who know IBM i well enough. The installed version is one provided by IBM.

The server.sh script does not work as it calls ./node

./server.sh: ./node: cannot execute

However

node ./out/vs/server/main.js --host 127.0.0.1

seems to work partially, but with errors:

It may well be that more tweaking has to be done by people in the know (which doesn't include me), but one thing to note is that many Unix-like utilities on IBM i come in two flavors. The older flavor predates IBM's recent expansion of open source available on the platform, and is usually the one that will be used if you haven't configured your shell. The newer stuff is much closer to what you would find on mainstream Unix or Linux distributions. This newer stuff all lives in /QOpenSys/pkgs/bin, which isn't in PATH by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

7 participants