Serial Over Lan in the webui
Deepak Kodihalli
dkodihal at linux.vnet.ibm.com
Fri Apr 13 19:58:36 AEST 2018
Hi,
I'm investigating https://github.com/openbmc/openbmc/issues/2736, which
is about enabling the SOL functionality in the webui
(https://github.com/openbmc/phosphor-webui).
What the webui currently has is an embedded terminal emulator
(hterm.js), although there's no ssh connection that's established to the
host. Basically the SOL doesn't work in the UI.
Also there seems to be two ways in which you can run the UI in general -
by downloading the webui code, building and running it via a Node server
(using the node package manager, or npm), or having the REST server on
the BMC serve up the webui code (html, javascript etc) when someone
points their browser to https://<BMC>.
Based on my investigation, it might not be possible to get the SOL
working in the UI via the latter scenario. This is because it doesn't
seem to be possible to implement an ssh client with client-side html and
javascript that a browser can run by itself, and that's because
javascript running in the browser doesn't have raw tcp/ip socket support.
How a "web" ssh client is typically implemented is by using some kind of
server-side scripting framework, something like Node. For eg I was able
to get the SOL in the webui working (when I run it via Node of course)
by implementing a Node server based on ssh2.js, which acts as a proxy
server. I used socket.io.js to have the terminal and this proxy server
communicate, the proxy server uses ssh2.js to implement an ssh client to
connect to the sshd running on the bmc. The key here though is ssh2.js
can't be executed by a browser (no raw tcp sockets), it requires network
APIs provided by Node's (or some other server-side technology) runtime.
So the question is how do we solve this when the webui code is served by
the BMC? Is anyone aware of a pure client-side javascript based ssh
client? If not, we'd have to run Node or something equivalent on the
BMC, or have the REST server act as a proxy server between the terminal
writing to a socket that the rest server can intercept and convert to
ssh packets. Any other thoughts on how this can be achieved?
Thanks,
Deepak
More information about the openbmc
mailing list