Login screen keyboard layout stays QWERTY on systemd distributions (Fedora, RHEL, Arch, openSUSE)

Published 18 July 2026

date
env
linux Fedora 42+, RHEL/CentOS Stream 9+, Arch Linux, openSUSE Tumbleweed — any distribution where systemd-localed is not patched out macos N/A

Symptom

Your desktop session uses the correct keyboard layout — you set it in GNOME Settings, KDE System Settings or via setxkbmap — but the display manager greeter is still QWERTY. Passwords containing a, q, z, w, m or digits are rejected, and you have to type blind by mentally transposing the layout.

The same symptom appears at the LUKS passphrase prompt and on TTY consoles, but those are governed by a third setting (localectl set-keymap), which is a frequent source of confusion.

Root cause

Three distinct keyboard scopes coexist on a systemd system:

ScopeConfigurationCommandEffect
Virtual consoles, initramfs, LUKS prompt/etc/vconsole.conf (KEYMAP=)localectl set-keymapTTY only — not the greeter
Graphical system-wide (greeter included)/etc/X11/xorg.conf.d/00-keyboard.conflocalectl set-x11-keymapGreeter, X11 sessions, Wayland compositors
Your sessiondconf / desktop settings, per userGNOME/KDE settings UIYour session only

The greeter never runs as your user — GDM runs as the gdm system user with its own dconf profile, SDDM as sddm. Neither can see your per-user configuration, so both fall back to the graphical system-wide setting.

The non-obvious part: even on a pure Wayland greeter, the file that gets read is the X11 keymap file. Wayland compositors handle input through libinput and derive their keymap through xkbcommon, which still parses /etc/X11/xorg.conf.d/00-keyboard.conf. This is why the widespread advice “you’re on Wayland, X11 config is irrelevant” is wrong here, and why so many people set localectl set-keymap (console) and conclude the fix does not work.

Diagnosis

Inspect all three scopes at once:

Terminal window
localectl status
System Locale: LANG=fr_BE.UTF-8
VC Keymap: fr
X11 Layout: us
X11 Model: pc105

VC Keymap: fr with X11 Layout: us is the exact signature of this problem: the console was configured, the graphical stack was not.

Check whether the target file exists:

Terminal window
cat /etc/X11/xorg.conf.d/00-keyboard.conf

Identify the display manager, as the fallback procedure differs:

Terminal window
systemctl status display-manager --no-pager | head -3

List valid layout and variant codes:

Terminal window
localectl list-x11-keymap-layouts | grep -E "^(fr|be)$"
localectl list-x11-keymap-variants fr
localectl list-x11-keymap-models | grep -i mac

Solution

Prerequisites and warnings

  • sudo rights, and the xkeyboard-config package installed (it ships the layout data localectl validates against; without it the command fails with Failed to read x11 keyboard layout data).
  • This procedure does not apply to Debian or Ubuntu. There, localectl set-x11-keymap is deliberately disabled and returns Setting X11 and console keymaps is not supported in Debian — use the /etc/default/keyboard + setupcon route instead.
  • Keep a fallback way in (second admin account or SSH from another machine) in case you mistype the layout code.

Steps

  1. Set the graphical system-wide keymap.

    The argument order is layout model variant options. For a French AZERTY Apple keyboard:

    Terminal window
    sudo localectl --no-convert set-x11-keymap fr pc105 mac

    --no-convert is important: without it, localectl also rewrites the console keymap in /etc/vconsole.conf by converting the X11 layout, which can silently break a TTY or LUKS setup you had already tuned. Drop the flag only if you deliberately want both scopes aligned.

    Common values:

    KeyboardCommand
    French AZERTY (PC)sudo localectl --no-convert set-x11-keymap fr pc105
    French AZERTY (Apple)sudo localectl --no-convert set-x11-keymap fr pc105 mac
    Belgian AZERTYsudo localectl --no-convert set-x11-keymap be pc105
    US Internationalsudo localectl --no-convert set-x11-keymap us pc105 intl
  2. Check what was written.

    Terminal window
    cat /etc/X11/xorg.conf.d/00-keyboard.conf
    Section "InputClass"
    Identifier "system-keyboard"
    MatchIsKeyboard "on"
    Option "XkbLayout" "fr"
    Option "XkbModel" "pc105"
    Option "XkbVariant" "mac"
    EndSection

    If localectl refused to run, write this file by hand — the effect is identical, since localectl is only a front-end to it.

  3. Optionally align the console keymap.

    Only if you also want the TTYs and the LUKS prompt in the same layout:

    Terminal window
    sudo localectl set-keymap fr
    sudo dracut --force

    On distributions using mkinitcpio (Arch) rather than dracut:

    Terminal window
    sudo mkinitcpio -P
  4. Reboot.

    Terminal window
    sudo reboot

Verify

At the greeter, type the password into a visible field first to confirm the characters.

After logging in:

Terminal window
localectl status

Expect X11 Layout: fr and X11 Variant: mac. Under an X11 or XWayland session you can also inspect the live keymap:

Terminal window
setxkbmap -query

Under a pure Wayland GNOME session:

Terminal window
gsettings get org.gnome.desktop.input-sources sources

Note that the session value can legitimately differ from the system value — the session overrides it. What matters for this how-to is what localectl status reports.

Rollback

Terminal window
sudo localectl --no-convert set-x11-keymap us pc105
sudo reboot

Or remove the file entirely to fall back to the compiled default:

Terminal window
sudo rm /etc/X11/xorg.conf.d/00-keyboard.conf
sudo reboot

If you are locked out of the greeter, switch to a TTY with Ctrl+Alt+F3 (its layout is independent, so it may still be usable), or use a root shell from the GRUB recovery entry.

Alternatives

GNOME/GDM overrides the setting after an update. GNOME Shell theming and some GDM settings are known not to survive upgrades. The 00-keyboard.conf route is the stable one precisely because it lives outside GNOME; if something else keeps resetting the layout, check for a competing file in /etc/X11/xorg.conf.d/ — files are read in lexical order and the last matching InputClass wins.

SDDM (KDE Plasma). SDDM reads the same file, but if it is ignored, force it in the greeter’s own configuration:

Terminal window
sudo tee /etc/sddm.conf.d/keyboard.conf > /dev/null <<'EOF'
[General]
InputMethod=
Numlock=on
EOF

For a hard override under an X11 greeter, use a display setup script pointing at setxkbmap fr mac.

LightDM.

Terminal window
sudo tee /etc/lightdm/lightdm.conf.d/50-keyboard.conf > /dev/null <<'EOF'
[Seat:*]
display-setup-script=/usr/bin/setxkbmap fr mac
EOF

Offering a layout picker in the greeter. Comma-separated layouts produce a selector in the GDM top bar:

Terminal window
sudo localectl --no-convert set-x11-keymap fr,us pc105 mac,

Apple keyboard oddities. The mac variant is calibrated for built-in Apple keyboards. On an external Apple keyboard, or inside a virtual machine where the hypervisor already translates scancodes, plain fr sometimes matches the engraving better. Test both. Related option worth knowing, to swap the Command/Alt behaviour:

Terminal window
sudo localectl --no-convert set-x11-keymap fr pc105 mac altwin:swap_alt_win

Sources

  • systemd — localectl(1) manual page
  • ArchWiki — GDM, section Keyboard layout
  • ArchWiki — Xorg/Keyboard configuration
  • GNOME System Administration Guide — Display multiple keyboard layouts on the login screen
  • Ctrl blog — How to change keyboard layout on the GNOME and Plasma login screens (documents that Wayland greeters still read the X11 keymap)