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
- tags
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:
| Scope | Configuration | Command | Effect |
|---|---|---|---|
| Virtual consoles, initramfs, LUKS prompt | /etc/vconsole.conf (KEYMAP=) | localectl set-keymap | TTY only — not the greeter |
| Graphical system-wide (greeter included) | /etc/X11/xorg.conf.d/00-keyboard.conf | localectl set-x11-keymap | Greeter, X11 sessions, Wayland compositors |
| Your session | dconf / desktop settings, per user | GNOME/KDE settings UI | Your 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:
localectl status System Locale: LANG=fr_BE.UTF-8 VC Keymap: fr X11 Layout: us X11 Model: pc105VC 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:
cat /etc/X11/xorg.conf.d/00-keyboard.confIdentify the display manager, as the fallback procedure differs:
systemctl status display-manager --no-pager | head -3List valid layout and variant codes:
localectl list-x11-keymap-layouts | grep -E "^(fr|be)$"localectl list-x11-keymap-variants frlocalectl list-x11-keymap-models | grep -i macSolution
Prerequisites and warnings
sudorights, and thexkeyboard-configpackage installed (it ships the layout datalocalectlvalidates 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-keymapis deliberately disabled and returns Setting X11 and console keymaps is not supported in Debian — use the/etc/default/keyboard+setupconroute instead. - Keep a fallback way in (second admin account or SSH from another machine) in case you mistype the layout code.
Steps
-
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-convertis important: without it,localectlalso rewrites the console keymap in/etc/vconsole.confby 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:
Keyboard Command French AZERTY (PC) sudo localectl --no-convert set-x11-keymap fr pc105French AZERTY (Apple) sudo localectl --no-convert set-x11-keymap fr pc105 macBelgian AZERTY sudo localectl --no-convert set-x11-keymap be pc105US International sudo localectl --no-convert set-x11-keymap us pc105 intl -
Check what was written.
Terminal window cat /etc/X11/xorg.conf.d/00-keyboard.confSection "InputClass"Identifier "system-keyboard"MatchIsKeyboard "on"Option "XkbLayout" "fr"Option "XkbModel" "pc105"Option "XkbVariant" "mac"EndSectionIf
localectlrefused to run, write this file by hand — the effect is identical, sincelocalectlis only a front-end to it. -
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 frsudo dracut --forceOn distributions using mkinitcpio (Arch) rather than dracut:
Terminal window sudo mkinitcpio -P -
Reboot.
Terminal window sudo reboot
Verify
At the greeter, type the password into a visible field first to confirm the characters.
After logging in:
localectl statusExpect X11 Layout: fr and X11 Variant: mac. Under an X11 or XWayland session you can
also inspect the live keymap:
setxkbmap -queryUnder a pure Wayland GNOME session:
gsettings get org.gnome.desktop.input-sources sourcesNote 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
sudo localectl --no-convert set-x11-keymap us pc105sudo rebootOr remove the file entirely to fall back to the compiled default:
sudo rm /etc/X11/xorg.conf.d/00-keyboard.confsudo rebootIf 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:
sudo tee /etc/sddm.conf.d/keyboard.conf > /dev/null <<'EOF'[General]InputMethod=Numlock=onEOFFor a hard override under an X11 greeter, use a display setup script pointing at
setxkbmap fr mac.
LightDM.
sudo tee /etc/lightdm/lightdm.conf.d/50-keyboard.conf > /dev/null <<'EOF'[Seat:*]display-setup-script=/usr/bin/setxkbmap fr macEOFOffering a layout picker in the greeter. Comma-separated layouts produce a selector in the GDM top bar:
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:
sudo localectl --no-convert set-x11-keymap fr pc105 mac altwin:swap_alt_winSources
- 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)