Docker Community Forums

Share and learn in the Docker community.

Eclipse not using my keyboard layout (Win 10 Docker host, X11, sshd, eclipse)


(Stefanb2) #1

Hi all,

eclipse doesn’t use my Swiss-German keyboar layout. Please may someone help?

As I can’t narrow down the problem to a single component not sure what know-how is needed. Here my setup :
Windows 10 PC with X-Windows-Server Xming
Docker (Dockerfile attached)
Docker using debian or ubuntu in the FROM clause
sshd, jdk1.8.0_77 and eclipse 4.5.2 installed inside the container
Connecting to the container through SSH and X11 forwarding
On the terminal/bash the keyboard works fine
Eclipse starts an X-Widow sucessfully on my Windows-PC
BUT – AND THIS IS MY PROBLEM – In the eclipse editors my keyboard is not accepted (for example: pressing Shift-3 yields # instead of *, shift 4 yields $ instead of ç … and so on)

Where is my problem: Is it X-Windows-related, and Eclipse-issue, a docker problem or a general locale-configuration issue? Please help me to narrow down.

Here my dockerfile:

FROM debian:jessie

FROM ubuntu:14.04
ENV JAVA_INSTALL /usr/bin
ENV JAVA_FILE jdk-8u77-linux-x64.tar.gz
ENV JAVA_HOME $JAVA_INSTALL/jdk1.8.0_77
ENV ECLIPSE_FILE eclipse-SDK-4.5.2-linux-gtk-x86_64.tar.gz
ENV USER_NAME eclipse
ENV USER_PWD $USER_NAME
ENV USER_HOME /home/$USER_NAME
ENV ROOT_PWD screencast
ENV MYDISPLAY 192.168.0.104:0.0
RUN apt-get update && apt-get install -y openssh-server libswt-gtk-3-jni libswt-gtk-3-java

locales

RUN mkdir /var/run/sshd
RUN echo “root:$ROOT_PWD” | chpasswd

Set the locale

RUN locale-gen de_CH.UTF-8

ENV LANG de_CH.UTF-8

ENV LANGUAGE de_CH.UTF-8

ENV LC_ALL de_CH.UTF-8

RUN sed -i “s/.PermitRootLogin./PermitRootLogin no/” /etc/ssh/sshd_config
RUN sed -i “s/.PasswordAuthentication./PasswordAuthentication no/” /etc/ssh/sshd_config
RUN sed -i “s/.UsePAM./UsePAM no/” /etc/ssh/sshd_config
RUN sed -i “s/.AllowUsers./AllowUsers $USER_NAME root/” /etc/ssh/sshd_config
RUN sed -i “s/.UsePrivilegeSeparation./UsePrivilegeSeparation yes/” /etc/ssh/sshd_config
RUN sed -i “s/.StrictModes./StrictModes yes/” /etc/ssh/sshd_config
RUN sed -i “s/.PermitEmptyPasswords./PermitEmptyPasswords no/” /etc/ssh/sshd_config
RUN sed -i “s/.HostbasedAuthentication./HostbasedAuthentication no/” /etc/ssh/sshd_config
RUN sed -i “s/.IgnoreRhosts./IgnoreRhosts yes/” /etc/ssh/sshd_config
RUN sed -i “s/.RSAAuthentication./RSAAuthentication no/” /etc/ssh/sshd_config
RUN sed -i “s/.RhostsRSAAuthentication./RhostsRSAAuthentication no/” /etc/ssh/sshd_config
RUN sed ‘s@session\srequired\spam_loginuid.so@session optional pam_loginuid.so@g’ -i /etc/pam.d/sshd
RUN useradd -d $USER_HOME -m -p $USER_PWD -s /bin/bash $USER_NAME
ADD $JAVA_FILE $JAVA_INSTALL
ADD $ECLIPSE_FILE /opt
RUN echo ‘#!/bin/bash’ >> /usr/local/bin/eclipse
RUN echo 'export MOZILLA_FIVE_HOME="/usr/lib/firefox/" ’ >> /usr/local/bin/eclipse
RUN echo ‘export ECLIPSE_HOME="/opt/eclipse"’ >> /usr/local/bin/eclipse
RUN echo ‘/opt/eclipse/eclipse “$@”’ >> /usr/local/bin/eclipse
RUN chmod 777 /usr/local/bin/eclipse
RUN mkdir $USER_HOME/.ssh
ADD authorized_keys $USER_HOME/.ssh
RUN chown -R $USER_NAME:$USER_NAME $USER_HOME/.ssh
RUN chmod 600 $USER_HOME/.ssh/authorized_keys
RUN echo “export DISPLAY=$MYDISPLAY” >> /etc/profile
RUN echo “export PATH=$JAVA_HOME/bin:$PATH” >> /etc/profile
EXPOSE 22
CMD ["/usr/sbin/sshd", “-D”]


(Jeff Anderson) #2

Docker certainly is not interfering here. Docker has no components related to keyboard layout. Do you get a similar issue running X11 applications in that same Xming instance? My hunch is that the Xming itself may need some configuration since X is the component here that handles keyboard input.


(Stefanb2) #3

Thank you Jeff!

You made my day! Issue resolved.
I had to add the parameters “-xkblayout de -xkbmodel logidinovoedge” to the start of Xming.exe.
The hint to test it with another x-program (xterm) was the right one. I thought I did compare with a terminal, but with putty & bash, which isn’t the same as xterm - too stupid from my side - thanks again.

Thanks, Stefan