Can't connect to console

I run OpenHAB container like this:

docker run \
        --name openhab \
        --net=host \
        -v /etc/localtime:/etc/localtime:ro \
        -v /etc/timezone:/etc/timezone:ro \
        -v /opt/openhab/conf:/openhab/conf \
        -v /opt/openhab/userdata:/openhab/userdata \
        -v /opt/openhab/addons:/openhab/addons\
        -d \
        -e USER_ID=999 \
        -e GROUP_ID=995 \
        -e "EXTRA_JAVA_OPTS=-Duser.timezone=Europe/Bratislava" \
        --restart=always \
        openhab/openhab:2.4.0-armhf-debian

I connect to console like this:
docker exec -it openhab /openhab/runtime/bin/client

But I always get:

Logging in as openhab
Session is being closed

I’m logged in as “pi” user if it matters. I tried using docker exec -it -u openhab... but didn’t help.

OS version:

Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l

PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian

Docker version:

Client:
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:57:21 2018
 OS/Arch:           linux/arm
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:17:57 2018
  OS/Arch:          linux/arm
  Experimental:     false

I opened GitHub issue for this as well https://github.com/openhab/openhab-docker/issues/223

Try

ssh -p 8101 openhab@localhost

or

docker exec -it openhab /bin/bash
/openhab/runtime/bin/client

I don’t think the client can work unless it is launched from a shell.

@rlkoshak I tried these as well but first one reports…
Connection reset by ::1 port 8101

and second goes…(actually the same as docker exec command)

Logging in as openhab
Session is being closed

All I can say is I’m running on Docker and tried both commands and the worked for me. I too have --net=host for the network configuration.

The only thing I can recommend is to check https://www.openhab.org/docs/administration/console.html#bind-console-to-all-interfaces to see if perhaps the konsole is only listening on localhost. You need to listen on all interfaces, or at least the interface of the host machine.