4

When I start Xephyr and LXDE session inside:

$ Xephyr :1 -screen 1920x1054 -nolisten tcp -reset -terminate
$ DISPLAY=:1 startlxde

some keys are not working properly, such as Up, PageUp, PageDown. Looking with xev, I see very funny key names:

PageUp:   Hiragana
Up:       Katakana
PageDown: Control_R
Left:     Henkan_Mode
Down:     KP_Enter
Right:    Muhenkan

enter image description here

enter image description here

Obviously, in normal LXDE session (without Xephyr), everything works normally.

One thing that is relevant here:

I am not using udev daemon on my system. (I just needed to add Option "AutoAddDevices" "Off" to /etc/X11/xorg.conf to make X work without udev.

When I turn udev back on, the keys inside Xephyr work OK. But that is not a solution for me.

How can I diagnose and fix this problem (without udev) ?

Martin Vegter
  • 69
  • 66
  • 195
  • 326
  • +1 Had this issue several years ago; Last time I had used Xephyr, the keyboard mapping was working properly when running in VirtualBox emulator. I didn't manage to figure out why. –  Aug 21 '16 at 16:25

3 Answers3

5

You can try to read the keyboard configuration of :0 with setxkbmap and to set it on :1 with xkbcomp:

setxkbmap -display :0 -print | xkbcomp - :1
mviereck
  • 2,377
  • 1
  • 18
  • 18
2

An even shorter version of mviereck's suggestion:

xkbcomp :0 :1
uli42
  • 236
  • 1
  • 6
1

There's an answer to a similar problem on Superuser.

The solution is to start Xnest / Xephyr with -kb.

There's a bug in relation and it still has the status "NEW". Strange, but it may apply, though 7 years old.

Take a look at the other answers in case -kb didn't fix it.

And see this one to get an insight into the -keybd option.

  • the `-kb` option does not exist anymore, and the new `-keybd` does not help either, when used as `Xephyr :1 -screen 1920x1054 -keybd ephyr,,,xkbmodel=pc105,xkblayout=us,xkbrules=evdev,xkboption=ctrl:nocaps -nolisten tcp -reset -terminate`. I suspect, the problem is related to the fact, that `udev` daemon did not "set" up something that `Xephyr` needs. As I said, the keyboard works OK when I boot with `udev` enabled. – Martin Vegter Aug 21 '16 at 20:35
  • How to pass `-kb` in firejail? – somenxavier May 27 '23 at 07:46