Change keyboard layout

Hello,

I’m new in VyOS and despite it is a Debian based the commands that I used to change the keyboard layout in a Debian machine don’t work in VyOS.

~# dpkg-reconfigure keyboard-configuration

After chosing the different options in the GUI :

~# service keyboard-setup restart

But the keyboard layout didn’t change

~# cat /etc/default/keyboard

XKBMODEL=”pc105″
XKBLAYOUT=”pt”
XKBVARIANT=””
XKBOPTIONS=””

The locale are all in “pt_PT.UTF-8”. No even rebooting the machine the layout changes.
Can you help me please. I’m seaching on Google for a solution since some days ago and until now I didn’t found any that works. It’s very hard to do any kind of laboratory work if the keyboard layout doesn’t match our language.
I’m using VirtualBox and VyOs 1.3.

Thanks a lot.

Having the same problem as well, 1.3-epa1, VirtualBox guest.
localectl status

System Locale: LANG=en_US.UTF-8
   VC Keymap: pt-latin1
   X11 Layout: pt
   X11 Model: pc105
   X11 Options: terminate:ctrl_alt_bksp

The only “fix” is to set up IP addressing on an interface, activate the SSH service and connect by SSH from a correctly configured client.
But that’s a workaround, not a fix.
journalctl -b --no-pager | grep key doesn’t show anything relevant, except

vyos kernel: input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0
vyos kernel: live-config[578]: live-config: debconf keyboard-configuration

debconf keyboard-configuration

Can't exec "keyboard-configuration": No such file or directory at /usr/share/perl/5.28/IPC/Open3.pm line 178.
open2: exec of keyboard-configuration failed: No such file or directory at /usr/share/perl5/Debconf/ConfModule.pm line 59.

Previously tested version was 1.1-8 and it worked there.

Hello tigas

Please try

set console keymap

This is operation mode command. you don’t need configure.

Hello. Thanks for the suggestion.
I tried that command on a fresh installation. It opened the same wizard as dpkg-reconfigure, with the same result (keymap isn’t changed from en-US, even if localectl status and /etc/default/keyboard show correct values)

In an independently compiled version of 1.2, the same command forces a restart of the keyboard-setup.service, after which the new keymap is activated. In the 1.2 version, localectl status and /etc/default/keyboard show the same values as 1.3, but on 1.2 the keymap follows the configuration and in 1.3 it’s always en-US.
~# systemctl restart keyboard-setup doesn’t change anything on 1.3.
~$ systemctl status keyboard-setup in 1.3 shows

Active: inactive (dead)
Condition: start condition failed
     ConditionPathExists=/bin/setupcon was not met

~$ systemctl status keyboard-setup in 1.2 shows

Active: active (exited)

[edit]
/bin/setupcon is missing from 1.3-epa1 but present (AFAICT) in 1.2. I don’t have an official LTS or “nightly” version of 1.2 to test, only an independently compiled version.
[/edit]

Hello,

another try, in configuration mode there is

set system option keyboard-layout 'xy'

but xy has only limited choices.

Ok, that mechanism works.
(conf)# set system option keyboard-layout no changed the layout to “Norway”.
Is it handled differently?
Not a lot of options here, just us,fr,de,fi,no and dk

[edit to add]
Compiled vyos-1.3-rolling and bug is there as well. /bin/setupcon missing, only set system option keyboard-layout 'xy' works

The same issue appears on vyos-1.4-rolling-202110180513, ISO downloaded from official site.

Can’t download an older 1.3 ISO than monthly-202011 to find the regression point; the bug is present there (Build commit ID b35660db9bd641)

Edit to add:
Compiled current state of 1.2 crux (Build commit ID 402d80498683f2) and the bug is NOT present. If there’s some place that has an archive of all the monthlies for 1.3 (instead of just the last 12) I don’t mind searching for the monthly where the bug was introduced. Looks like 2020-11 is the earliest monthly.

Edit to remove mentions to a possibly unrelated commit. AFAICT, this could be an issue with the build scripts, even.

Bug thread opened: 1.3/1.4 "$ set console keymap" not working

– reply to @Viacheslav because I’m a new user and can’t post more messages on this thread –
Hi. Thank you for the advice.
My previous experience with VyOS was all with 1.1.8, where, AFAICT, the only way of changing the default keymap was to drop to a raw bash shell and set it from there with dpkg-reconfigure.
Since you’ve done a lot of work between 1.1.8 and 1.3-epa, I was trying 1.3-epa and did not know about the $ set console keymap command that seems to have been introduced in 1.2
However, that command just calls dpkg-reconfigure keyboard-configuration and restarts the keyboard-setup service. That works perfectly on 1.2, which I later found out; but not on 1.3 or 1.4
I am trying to use a VyOS built-in command - but it doesn’t work (in 1.3 and 1.4).

As I understand you tried some “raw” commands which not included in CLI.
If you want some additional layout - just create a task at phabricator

This still doesn’t work, why is this not an issue ?

Somewhat related but I added swedish keyboard layout through T5336:

https://vyos.dev/T5336