Ask Your Question

Change default system keyboard layout for virtual console.

asked 2013-09-05 14:07:13 -0600

Neophox gravatar image

updated 2013-09-05 14:56:58 -0600

I'm using the LXDE spin of Fedora 19, and I'm running into difficulties changing my keyboard layout. During the F19 installation process, I specified the default US keyboard. I'm actually using a Japanese keyboard, and I'd like to change the defaults. So far, I've changed the default layout in my X session, as well as any terminals spawned from it. However, if I go to a virtual terminal using ctrl+alt+F2 or so, I'm still using the US default. The F19 docs only describe how to modify the X session's defaults, and google searching hasn't given me too much information. Is there a config file I can modify, or a command I can throw into a bash profile?

Edit: Some more searching sent me to /etc/vconsole.conf and /etc/default/grub, both of which I've set to "jp106" with no change.

Edit: It looks like using setxkbmap -layout jp will change the x keyboard layout to japanese. Using jp, rather than jp106 still doesn't make a difference in the config files, though.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-09-05 15:39:00 -0600

updated 2013-09-06 00:38:03 -0600

localectl will do this. The man page will give you the syntax, but here are some examples.

  • list keymaps: localectl list-keymaps

  • change console keymap: localectl set-keymap jp106

  • change x11 keymap: localectl set-x11-keymap jp

The set-x11-keymap options are much more flexible, see the manpage for instructions on listing the available parameters.

edit flag offensive delete link more


No dice. Well, sort of dice. localectl set-keymap jp has everything working in my X session. Virtual consoles still use the us keymap. Maybe give me the exact syntax I should be using? I may have missed a section in the man page.

Neophox gravatar imageNeophox ( 2013-09-05 16:41:14 -0600 )edit

Sure, i've updated the answer with more details. I haven't experimented, but you might have to log out and start a new session - or even reboot - to see the changes.

randomuser gravatar imagerandomuser ( 2013-09-06 00:38:59 -0600 )edit

Success. After using the above commands, I still wasn't able to use the new keymap in virtual consoles. A few more steps were needed, as per . I'm not certain how much was necessary, but I changed the default keymap (cp /lib/kbd/keymaps/i386/qwerty/ /lib/kbd/keymaps/i386/qwerty/, loaded the new keymap (loadkeys -d), then did something I don't understand (dracut -f)

Neophox gravatar imageNeophox ( 2013-09-06 15:19:53 -0600 )edit

Interesting, and it looks like the problem is getting some attention. dracut is used to generate the initramfs - the filesystem image used to bring up the system during boot. TTYs are handled early on in the boot process, so apparently the change needs to happen there.

randomuser gravatar imagerandomuser ( 2013-09-06 16:07:27 -0600 )edit

answered 2014-02-03 16:53:00 -0600

lsatenstein gravatar image

As of Fedora 20, I am very discouraged with keymapping. My one and only keyboard layout is ca for Canadian French.

Gnome tweak-tool did not allow me to put the euro symbol to a key. With help, I found and modified /usr/share/X11/xkb/symbols/ca
Now the console keymap is OK, but the virtual terminal is not. It uses the ca as released before the mods.

To where do I have to copy the above map, so that the virtual console (ttyn) reflects what the gnome console shows.?

I am answering a question with a question. Sorry,

What do I have

edit flag offensive delete link more


It seems to me that there are two images for keyboards, the console image and the x11 image. I modified the console image, but how to modifiy the x11 image. Where is the latter stored?

lsatenstein gravatar imagelsatenstein ( 2014-02-03 17:01:43 -0600 )edit

Question Tools


Asked: 2013-09-05 14:07:13 -0600

Seen: 10,366 times

Last updated: Feb 03 '14