Skip to content

Instantly share code, notes, and snippets.

@udnp
Last active March 10, 2021 10:22
Show Gist options
  • Save udnp/7d5697093cc94b473d53fdb4f8cdf41b to your computer and use it in GitHub Desktop.
Save udnp/7d5697093cc94b473d53fdb4f8cdf41b to your computer and use it in GitHub Desktop.
xrdp で再ログインすると US キーボードのレイアウトが reset される問題の DIY hack/Hack against the issue that keyboard layout is always reset on login through xrdp.

xrdp で再ログインすると US キーボードのレイアウトが JIS に必ず reset される問題の DIY hack

環境

ゲスト

Ubuntu 20.04 LTS + xrdp 0.9.12

ホスト

Windows 10 Pro 20H2 の Hyper-V

クライアント

Windows 10 Pro 20H2 の vmconnect で拡張接続

原因

xrdp で再ログインすると keyboard の layout が jp になっている

$ setxkbmap -query
rules:      base
model:      pc104
layout:     jp

解決方法

/etc/xrdp/reconnectwm.sh の設定に次を追記する。

sleep 2s
setxkbmap -layout "us,us"

次の内容を参考にした.

keyboard layout - Run a command at the start of XRDP session - Ask Ubuntu
https://askubuntu.com/questions/985206/run-a-command-at-the-start-of-xrdp-session

参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment