Ubuntu Linux上で一時的にWindowsを使いたい時に、よくVagrant(libvirt Provider)を使っています。
仮想マシンへの接続にはRemminaでRDPを使っています。
この時、仮想マシン側でCapsLockの挙動がおかしくてとても困っていたのですが、解消できたのでメモ。
ちなみにUbuntu Linux上ではCtrlキーとCapsLockキーを入れ替えています。
Ubuntu Linux 18.04 LTSで、CtrlキーとCapsLockキーを入れ替える - CLOVER🍀
環境
今回の環境はこちら。
$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 24.04.3 LTS Release: 24.04 Codename: noble $ uname -srvmpio Linux 6.8.0-86-generic #87-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 18:03:36 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux $ remmina --version remmina-Message: 12:33:43.990: Remmina does not log all output statements. Turn on more verbose output by using "G_MESSAGES_DEBUG=remmina" as an environment variable. More info available on the Remmina wiki at: https://gitlab.com/Remmina/Remmina/-/wikis/Usage/Remmina-debugging org.remmina.Remmina - 1.4.35 (git n/a)
使用しているWindows 11のBoxはこちらです。
RemminaのRDPの設定でCtrlキーとCapsLockキーを入れ替える
結論を言うと、Remminaの「設定」 → 「RDP」の「Keyborad scancode remapping」でCtrlキーとCapsLockキーを入れ替えることで
解消しました。

設定している値はこちら。
0x1d=0x3a,0x3a=0x1d
こちらがヒントになりました。
Added RDP general option to remap scancodes (!2304) · Merge requests · Remmina / Remmina · GitLab
キーのscancode調べ方ですが、こういうページを見るか
United States-International - Scancodes - Keyboard Layout Info
United States-International - Virtual Keys - Keyboard Layout Info
showkey --scancodesで。
Ubuntu Manpage: showkey - examine the codes sent by the keyboard
こちらを使うと、押したキーのscancodeがわかります。
以下が使用例で、左Ctrlキー(0x1d)、CapsLockキー(0x3a)の順に押しています。
$ sudo showkey --scancodes kb mode was ?UNKNOWN? [ if you are trying this under X, it might not work since the X server is also reading /dev/console ] press any key (program terminates 10s after last keypress)... 0x9c 0x1d 0x9d 0x3a 0xba
これを入れ替えたのがこちらの設定です。
0x1d=0x3a,0x3a=0x1d