Hello!
I test installation xrdp 0.9.0 last version on ubuntu 12.04 32bit (also i test xrdp 0.8.0)
Client is Windows 8.
I use "us,ru" keyboard layout on both computer.
When i connect first time to server with xrdp keyboard layout works perfect.
I check it command setxkbmap
locadmin@locadmin-VirtualBox:~$ setxkbmap -print -verbose 10
Setting verbose level to 10
locale is C
Applied rules from base:
rules: base
model: pc105
layout: us,ru
variant: ,
options: grp:alt_shift_toggle,grp:toggle
Trying to build keymap using the following components:
keycodes: xfree86+aliases(qwerty)
types: complete
compat: complete
symbols: pc+us+inet(pc105)+ru:2+group(toggle)+group(alt_shift_toggle)
geometry: pc(pc105)
xkb_keymap {
xkb_keycodes { include "xfree86+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+inet(pc105)+ru:2+group(toggle)+group(alt_shift_toggle)" };
xkb_geometry { include "pc(pc105)" };
};
But when i disconnect from session and connect to a server again i cannot change layout - it only "us".
I check it command setxkbmap:
locadmin@locadmin-VirtualBox:~$ setxkbmap -print -verbose 10
Setting verbose level to 10
locale is C
Applied rules from base:
rules: base
model: pc105
layout: us
Trying to build keymap using the following components:
keycodes: xfree86+aliases(qwerty)
types: complete
compat: complete
symbols: pc+us+inet(pc105)
geometry: pc(pc105)
xkb_keymap {
xkb_keycodes { include "xfree86+aliases(qwerty)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols { include "pc+us+inet(pc105)" };
xkb_geometry { include "pc(pc105)" };
};
How can i fix this?
PS. I specially test my old production server on ubuntu 12.04 32bit with version xrdp 0.6.0 - it work correctly.
Addition to the previous text: i use X11rdp backend.
have you tried compiling from git ?
Yes. I compiled it from master branch
Two thing,
do you reproduce the issue with xorgxrdp?
run xrdp-sesman in foreground xrdp-sesman -ns and see log carefully around recconection. applying keylayout will be logged.
Like this. This is x11rdp case.
[20160308-10:55:16] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 8
process_version_msg: version 0 0 0 1
process_screen_size_msg: set width 1920 height 1200 bpp 16
process_screen_size_msg: g_shmemid 327680 g_shmemptr 0x80a400000
process_message_channel_setup: chan name 'rdpdr' id 0 flags 00000000
process_message_channel_setup: chan name 'rdpsnd' id 1 flags 00000000
process_message_channel_setup: chan name 'cliprdr' id 2 flags 00000000
process_message_channel_setup: chan name 'drdynvc' id 3 flags 00000000
xrdp-chansrv [1408203185]: sound_init:
rdpup_process_msg: got client info bytes 5312
jpeg support 0
offscreen support 1
offscreen size 5242880
offscreen entries 100
client can not do offscreen to offscreen blits
client can do new(color) cursor
client can not do multimon
rdpLoadLayout: keylayout 0xe0200411 variant display 10 <= THIS
rdpChangeKeyboardControl:
rdpChangeKeyboardControl:
I reproduce the issue.
Before reconnect to session layot was change good.
After reconnect it is only EN layout and I cannot change it.
Log in console:
[20160308-10:27:05] [INFO ] A connection received from: 127.0.0.1 port 35414
[20160308-10:27:06] [INFO ] ++ reconnected session: username locadmin, display :10.0, session_pid 2255, ip 192.168.43.6:54961 - socket: 12
rdpClientConGotConnection:
rdpClientConGotConnection: g_sck_accept ok new_sck 13
rdpClientConGotConnection: adding only clientCon
[20160308-10:27:06] [INFO ] An established connection closed to endpoint: 127.0.0.1:35414 - socket: 9
rdpClientConProcessMsgVersion: version 0 0 0 1
rdpClientConProcessScreenSizeMsg: set width 1920 height 1080 bpp 24
rdpClientConProcessScreenSizeMsg: shmemid 1966101 shmemptr 0xb1e5e000
rdpClientConProcessMsgClientInput: invalidate x 0 y 0 cx 1920 cy 1080
[20160308-10:27:06] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 9
process_message_channel_setup: chan name 'rdpdr' id 0 flags 00000000
process_message_channel_setup: chan name 'rdpsnd' id 1 flags 00000000
process_message_channel_setup: chan name 'cliprdr' id 2 flags 00000000
rdpClientConProcessMsgClientInfo:
process_message_channel_setup: chan name 'drdynvc' id 3 flags 00000000
got client info bytes 5392
jpeg support 0
offscreen support 1
offscreen size 7864320
offscreen entries 100
client can not do offscreen to offscreen blits
client can do new(color) cursor
client can not do multimon
rdpRRSetRdpOutputs: numCrtcs 1
rdpRRSetRdpOutputs: numOutputs 1
rdpLoadLayout: keylayout 0x00000409 variant display 10
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetInfo:
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
xrdp-chansrv [1413713201]: child_signal_handler:
xrdp-chansrv [1413713202]: child_signal_handler: child pid 2752
xrdp-chansrv [1413713202]: child_signal_handler: child pid -1
xrdp-chansrv [1413713202]: sound_init:
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpInDeferredUpdateCallback:
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
rdpRRGetPanning: 0x8221c1f8
xrdp-chansrv [1413713575]: sound_process_output_format:
xrdp-chansrv [1413713575]: wFormatTag 1
xrdp-chansrv [1413713575]: nChannels 2
xrdp-chansrv [1413713575]: nSamplesPerSec 44100
xrdp-chansrv [1413713575]: nAvgBytesPerSec 176400
xrdp-chansrv [1413713575]: nBlockAlign 4
xrdp-chansrv [1413713575]: wBitsPerSample 16
xrdp-chansrv [1413713575]: cbSize 0
xrdp-chansrv [1413713575]: sound_process_output_format:
xrdp-chansrv [1413713575]: wFormatTag 1
xrdp-chansrv [1413713576]: nChannels 2
xrdp-chansrv [1413713576]: nSamplesPerSec 22050
xrdp-chansrv [1413713576]: nAvgBytesPerSec 88200
xrdp-chansrv [1413713576]: nBlockAlign 4
xrdp-chansrv [1413713576]: wBitsPerSample 16
xrdp-chansrv [1413713576]: cbSize 0
xrdp-chansrv [1413713677]: drdynvc_process_capability_response: DVC version 3 selected
xrdp-chansrv [1413713677]: sound_process_training: round trip time 100
xrdp-chansrv [1413713680]: scard_init:
chansrv:smartcard_pcsc [1413713680]: scard_pcsc_init:
Temprorary i FIX layot with modify file xrdp\xorgxrdp\xrdpkeyb\rdpKeyboard.c and rebuild it:
static int
rdpLoadLayout(rdpKeyboard *keyboard, struct xrdp_client_info *client_info)
{
XkbRMLVOSet set;
int keylayout = client_info->keylayout;
LLOGLN(0, ("rdpLoadLayout: keylayout 0x%8.8x variant %s display %s",
keylayout, client_info->variant, display));
memset(&set, 0, sizeof(set));
set.rules = "base";
// BEGIN-FIX
// set.model = "pc104";
// set.layout = "us";
// set.variant = "";
// set.options = "";
set.model = "pc105";
set.layout = "us,ru";
set.variant = "";
set.options = "grp:ctrl_shift_toggle";
//
// if (strlen(client_info->model) > 0)
// {
// set.model = client_info->model;
// }
// if (strlen(client_info->variant) > 0)
// {
// set.variant = client_info->variant;
// }
// if (strlen(client_info->layout) > 0)
// {
// set.layout = client_info->layout;
// }
// if (strlen(client_info->options) > 0)
// {
// set.options = client_info->options;
// }
// END-FIX
reload_xkb(keyboard->device, &set);
reload_xkb(inputInfo.keyboard, &set);
return 0;
}
// BEGIN-FIX
//set.model = "pc104";
//set.layout = "us";
//set.variant = "";
//set.options = "";
set.model = "pc105";
set.layout = "us,ru";
set.variant = "";
set.options = "grp:ctrl_shift_toggle";
// END-FIX
After this change keyboard layout work perfectly. I try it on Xubuntu 14.04 and Ubuntu 15.10.
As I understand it , the problem is that the client come empty adjustment and as a result apply the settings that have been set by default : ie only EN layout .
As I understand it , the problem is that the client come empty adjustment and as a result apply the settings that have been set by default : ie only EN layout .
I think so, too.
rdpLoadLayout: keylayout 0x00000409 variant display 10
Your log says client has the US layout. Russian should be 0x00000419.
https://technet.microsoft.com/en-us/library/cc766503%28WS.10%29.aspx
Judging from your log, second or later connections are correct and first connection is somehow going wrong. It shouldn't be "us,ru". When client give xrdp server 0x00000409 layout, server keylayout always should be "us".
Again, let's see which keylayout is given from the client. Now you don't have to run xrdp-sesman in foreground. Just do tail -f /var/log/xrdp.log. You'll see the log like this.
[20160308-10:54:59] [WARN ] local keymap file for 0xe0200411 found and doesn't match built in keymap, using local keymap file
I think you should specify keyboard layout in client. This is a FreeRDP example.
$ xfreerdp /v:server.example.com /kbd:0x00000419
or
$ xfreerdp /v:server.example.com /kbd:Russian
Additionally, if you want to use "us,ru" layout even if "0x00000409" is given from the client, you don't need to fix the source code. Editing config files is enough.
Edit xrdp_keyboard.ini like this. This will override "us" by "us,ru".
--- xrdp_keyboard.ini.orig 2016-03-08 13:49:27.488775742 +0900
+++ xrdp_keyboard.ini 2016-03-08 13:51:24.972745599 +0900
@@ -74,7 +74,7 @@
# <rdp layout name> = <X11 keyboard layout value>
[default_layouts_map]
-rdp_layout_us=us
+rdp_layout_us=us,ru
rdp_layout_de=de
rdp_layout_fr=fr
rdp_layout_it=it
If you want to use "us,ru" instead of "ru" in case you specify Russian in client, like this.
--- xrdp_keyboard.ini.orig 2016-03-08 13:49:27.488775742 +0900
+++ xrdp_keyboard.ini 2016-03-08 13:52:33.092750998 +0900
@@ -82,7 +82,7 @@
rdp_layout_jp2=jp
rdp_layout_jp3=jp
rdp_layout_jp4=jp
-rdp_layout_ru=ru
+rdp_layout_ru=us,ru
rdp_layout_se=se
rdp_layout_ch=ch
rdp_layout_pt=pt
metalefty,
I tried to edit the file xrdp_keyboard.ini before, but in my case it did not work for some reason. It was the first thing I tried to correct the situation . That's why I went so far as to correct the source code - only in this case the result was correct .
I tried again using change xrdp_keyboard.ini - no result. As before, only the English keyboard layout.
Hmm, xrdp_keyboard.ini works for me.
I tried to disconnect & reconnect 3 different client keyboard types (us -> jp -> ru).
Server keyboard changes "us,ru" -> "jp" -> "ru". This is exactly I expected.
Server session type is xorgxrdp. xrdp= cdb967c, xorgxrdp=a0add6c.

By the way, what about #issuecomment-193607180?
Thanks a lot for your instructions!
https://github.com/neutrinolabs/xrdp/issues/337#issuecomment-193591620
It was helpful! I use this in my script that builds xrdp to automate the process of patching:
kb_model="pc105"
kb_layout="us,ru"
kb_options="grp:alt_shift_toggle,grp_led:scroll"
sed -ri.bak "s/(set.model)[^;]+/\1 = \"$kb_model\"/;s/(set.layout)[^;]+/\1 = \"$kb_layout\"/;s/(set.options)[^;]+/\1 = \"$kb_options\"/" xorgxrdp/xrdpkeyb/rdpKeyboard.c
How to add option "grp:alt_shift_toggle,grp_led:scroll" in xrdp_keyboard.ini?
on CentOS 7.4 problem persists
Please add keyboard layout switch on login screen
Hi, I al so facing this same problem. On first login the keyboard is OK (which in my case, is Spanish Latin, or es-ar). On reconnect to existing session, then the keyboards is US.
Any ideas of how to fix this? The only way that works is to close the session.
PD: in my case, I am accessing from Windows 10 to Ubuntu 18.04.
Thanks in advance.
Simple solution
As metalefty said
Add in /etc/xrdp/xrdp_keyboard.ini
-rdp_layout_us=us
+rdp_layout_us=us,ru
and reconnect
Same applies for es layout?
I had a similar problem: Ubuntu server running xrdp and Win10 client with japaneese layout. Every time I reconnected to a session, only japaneese layout was available.
[20201006-20:07:53] [INFO ] Cannot find keymap file /etc/xrdp/km-e0010411.ini
[20201006-20:07:53] [INFO ] Loading keymap file /etc/xrdp/km-00000411.ini
[20201006-20:07:53] [WARN ] local keymap file for 0xe0010411 found and doesn't m atch built in keymap, using local keymap file
Managed to solve the problem (following metalefty's instructions) by changing "rdp_layout_jp=jp" to "rdp_layout_jp=us,ru" in xrdp_keyboard.ini. It works now, although the solution seems somewhat strange to me.
Most helpful comment
I reproduce the issue.
Before reconnect to session layot was change good.
After reconnect it is only EN layout and I cannot change it.
Log in console:
Temprorary i FIX layot with modify file xrdp\xorgxrdp\xrdpkeyb\rdpKeyboard.c and rebuild it:
After this change keyboard layout work perfectly. I try it on Xubuntu 14.04 and Ubuntu 15.10.
As I understand it , the problem is that the client come empty adjustment and as a result apply the settings that have been set by default : ie only EN layout .