Skip to content

Choose the VM keyboard layout and carry the host's timezone into prepared images - #120

Merged
MickLesk merged 1 commit into
mainfrom
feat/vm-keyboard-timezone
Oct 8, 2026
Merged

MickLesk merged 1 commit into
mainfrom
feat/vm-keyboard-timezone

Conversation

@MickLesk

@MickLesk MickLesk commented Oct 8, 2026

Copy link
Copy Markdown
Member

The Y/Z swap in noVNC happens when the VM's keyboard layout (qm --keyboard, inherited from the datacenter) and the guest's layout differ.

  • vm_prompt_keyboard offers Proxmox's layout codes in advanced settings; the default is VM_KEYBOARD, else the datacenter's keyboard: setting, else en-us.
  • vm_mark_created sets the layout on the VM (qm set --keyboard), so installer ISOs get the Proxmox side at least.
  • vm_prepare_cloud_image writes the matching console keymap into the image (/etc/default/keyboard, /etc/vconsole.conf) and sets the timezone: VM_TIMEZONE, else the host's zone.
  • Incus: vm_prompt_keyboard is a no-op, the console layout is the client's there.

Tests: a new case in tests/vm-helpers.sh (42 pass); the generated keymap command was run against a Debian 13 container and produces XKBLAYOUT="de" / KEYMAP=de-latin1, and ch + variant fr / fr_CH-latin1 for fr-ch.

DevScripts: every VM script calls vm_prompt_keyboard in advanced settings; that commit follows once this is on main.

…ared images

The Y/Z swap in noVNC comes from the VM's keyboard layout not matching the guest's. vm_prompt_keyboard offers Proxmox's layouts in advanced settings; VM_KEYBOARD or the datacenter setting is the default. The layout is set on the VM with qm set --keyboard and, for images prepared with virt-customize, written as the guest's console keymap. Those images also get the host's timezone, or VM_TIMEZONE.
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Try this branch

The engine and the scripts resolve independently, so a production script can
be run against the engine from this PR by setting one variable:

COMMUNITY_SCRIPTS_CORE_URL=https://raw.githubusercontent.com/community-scripts/core/feat/vm-keyboard-timezone \
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/debian.sh)"

Swap ct/debian.sh for whatever exercises the change.

This PR touches both backends. Worth running on a Proxmox VE and an Incus host.

Run a script from a fork as well
curl -fsSL https://raw.githubusercontent.com/community-scripts/core/feat/vm-keyboard-timezone/tools/run.sh |
  bash -s -- https://raw.githubusercontent.com/YOU/DevScripts/your-branch ct/debian.sh \
             https://raw.githubusercontent.com/community-scripts/core/feat/vm-keyboard-timezone

Note that run.sh is reached through a pipe, so the script it starts inherits
an exhausted stdin. Whiptail is fine — it opens /dev/tty — but a plain read
would see EOF. The single-variable form above does not have that problem.

Useful flags while testing

dev_mode=net logs every engine fetch with status and duration, which is the
quickest way to confirm the branch is really being used. dev_mode=keep stops a
failed build from deleting the container along with the evidence.

@MickLesk
MickLesk merged commit b54e059 into main Oct 8, 2026
4 checks passed
@github-actions
github-actions Bot deleted the feat/vm-keyboard-timezone branch October 8, 2026 08:39
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