Skip to content

fix(system): use the US keymap in VMs - #165

Merged
TechDufus merged 2 commits into
mainfrom
fix/vm-us-keymap
Nov 30, 2026
Merged

TechDufus merged 2 commits into
mainfrom
fix/vm-us-keymap

Conversation

@TechDufus

Copy link
Copy Markdown
Owner

Why

A virtual machine is typed on through its hypervisor console. QEMU started with -k en-us (Proxmox's default) sends each typed character as its US QWERTY key, so a guest set to Dvorak remaps every key a second time. On my remote Omarchy VM that made the disk-unlock prompt reject the right password.

The guest's layout only matters on that console: gliff sends the client's own keymap and SSH sends characters.

What changes

  • modules/system/bootstrap.sh: when systemd-detect-virt --vm reports a virtual machine, set the console keymap and X11 layout to plain us (still caps:none). Bare metal keeps Dvorak.
  • modules/system/tests/test_keymap.sh: runs the shipped bootstrap against stubbed sudo, localectl and systemd-detect-virt for a VM and bare metal, each from both layouts, including that a converged machine gets no localectl call.
  • check:system-keymap task, and a step in the system-sudoers CI job. It stays out of test:* because bootstrap refuses root, which the Arch CI container runs as.
  • docs/fork.md and the README validation section.

Not in this PR

localectl only writes /etc/vconsole.conf. The disk-unlock prompt reads the copy inside the boot image, so it changes at the next image rebuild (a kernel update, or by hand). On a VM, Hyprland's own layout becomes US too, since Omarchy reads it from the same file.

Verified

  • bash modules/system/tests/test_keymap.sh passes on Omarchy (bare metal).
  • bash modules/system/tests/test_sudoers.sh still passes.
  • Not yet applied on the VM.

A VM is typed on through its hypervisor console. QEMU with -k en-us
sends each character as its US QWERTY key, so a Dvorak guest remaps
every key a second time and the disk-unlock prompt rejects the
password. gliff and SSH carry the client's own layout.

bootstrap now sets us/us with caps:none when systemd-detect-virt
reports a VM and keeps Dvorak elsewhere. The unlock prompt follows at
the next boot-image rebuild.
@TechDufus
TechDufus merged commit f076544 into main Nov 30, 2026
12 of 14 checks passed
@TechDufus
TechDufus deleted the fix/vm-us-keymap branch November 30, 2026 20:02
TechDufus added a commit that referenced this pull request Nov 30, 2026
Reverts #166 and #165. The VM they were written for is gone, so nothing uses the virtual-machine branch of the keymap step. bootstrap sets Dvorak on every Linux machine again; test_keymap.sh, the check:system-keymap task, its CI step and its docs are removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant