I've been trying the "Developer console" in ChromeOS( dev mode), which is entered by Ctrl+Alt+Forward but when switching the keyboard layout with loadkeys cz I got an error saying Couldn't get a file descriptor referring to the console.

  • I get the same when chroot is entered from crosh, but in that case the layout set in ChromeOS is used, which is fine.

I can see that the keyboard code is correct with ls /usr/share/X11/xkb/symbols/

In addition I've found the response of loadkeysis the same in Crosh, only there is the language/layout inherited from the system setup.

Is there any other way to set the keyboard mapping/layout in shell?

| improve this question | | | | |
  • 2
    Are you root? What is the output of ls -l /dev/console ? – Gilles 'SO- stop being evil' Feb 7 '17 at 0:42
  • @Gilles Yes.( Although I thought that wouldn't be needed.) The listing gives a line crw-------. 1 root root 5, 1 Feb 6 14:53 /dev/console – Huge Feb 7 '17 at 10:16
  • fgconsole produces this errormessage when not run from $TERM=linux (tty*) eg. xterm, konsole etc. – user261023 Nov 17 '17 at 11:23
  • note loadkeys loads from /usr/share/kbd/keymaps. you might try setxkbmap instead, though i wonder if that will still work under Freon. – quixotic Dec 19 '17 at 19:29

I don't know about ChromeOS, but I get this same error with loadkeys and setfont on my Arch Linux machine when inside a screen session. The fix is to use an explicit -C option to specify the console:

$ loadkeys -C /dev/console cz

If you don't have write access to the console, a different error will occur:

Couldn't open /dev/console

In this case, any means of providing the correct privileges will do. I just use sudo.

Note that the X11 keyboard layouts are not used by loadkeys, which is for the text console. Instead the files are in /usr/share/kbd/keymaps and have a different format.

The cz layout should still be available, but a customized layout for X11 would need to be ported.

| improve this answer | | | | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.