I want to set permanent Japanese keyboard layout for X Windows in Kali Linux (Rolling Edition 2016.1, testing with kali-2016.1 Vagrant box).

Setting Japanese keyboard manually through All Settings -> Region and Language -> Input Sources works ok and is persistent. I want to provision the same settings through a script.

For ad-hoc configuration I run:

setxkbmap -layout jp

which works until user logoff. It does change the layout, however it does not add/change Input Source in settings panel.

For persistent configuration I tried the following (with no success):

  • I created directory /etc/X11/xorg.conf.d/ and /etc/X11/xorg.conf.d/00-keyboard.conf with the following content:

    Section "InputClass"
            Identifier "system-keyboard"
            MatchIsKeyboard "on"
            Option "XkbLayout" "jp"
            Option "XkbModel" ""
            Option "XkbVariant" ""
            Option "XkbOptions" ""

    But it has no effect.

  • I tried running:

    localectl --no-convert set-x11-keymap jp

    which supposedly should create 00-keyboard.conf, but although it ends with no error, it does not create the file.

Settings for console work ok (Japanese layout is active when typing username at the logon screen). My /etc/default/keyboard is:


And I have also setting in vconsole.conf:


How can I set persistent keyboard layout from CLI?

  • did you actually mean localectl --no-convert set-x11-keymap jp? – meuh Jun 4 '16 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.