1

Нужно поднять терминальный сервер для использования chrome. 

Поставил lxde и xrdp с  http://scarygliders.net/x11rdp-o-matic-information/.

+

Добавляем в /etc/X11/Xsession после set -e
## Для корретного определения локали
if [ -r /etc/default/locale ]; then
. /etc/default/locale
export LANG LANGUAGE
fi
## Для корретной работы переключения раскладок клавиатуры по control + shift
setxkbmap -layout «us,ru(winkeys)» -model «pc105″ -option «grp:ctrl_shift_toggle,grp_led:scroll»

Все хорошо. Цепляюсь на 3389 и захожу в lxde, но раскладка только русская и не меняется. Если добавлять все подряд dpkg-reconfigure locales тоже толку нет.

log - [WARN ] local keymap file for 0x0419 found and dosen't match built in keymap, using local keymap file


Подскажите как оживить мультирасладочность.

Конфиги:

cat /etc/X11/Xsession

+ открыть спойлер

#!/bin/sh
#
# /etc/X11/Xsession
#
# global Xsession file -- used by display managers and xinit (startx)

# $Id: Xsession 967 2005-12-27 07:20:55Z dnusinow $

set -e

## Для корретного определения локали
if [ -r /etc/default/locale ]; then
. /etc/default/locale
export LANG LANGUAGE
fi
## Для корретной работы переключения раскладок клавиатуры по control + shift
setxkbmap -layout "us,ru(winkeys)" -model "pc105" -option "grp:ctrl_shift_toggle,grp_led:scroll"

PROGNAME=Xsession

message () {
  # pretty-print messages of arbitrary length; use xmessage if it
  # is available and $DISPLAY is set
  MESSAGE="$PROGNAME: $*"
  echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2
  if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then
    echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
  fi
}

message_nonl () {
  # pretty-print messages of arbitrary length (no trailing newline); use
  # xmessage if it is available and $DISPLAY is set
  MESSAGE="$PROGNAME: $*"
  echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2;
  if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then
    echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
  fi
}

errormsg () {
  # exit script with error
  message "$*"
  exit 1
}

internal_errormsg () {
  # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
  # One big call to message() for the sake of xmessage; if we had two then
  # the user would have dismissed the error we want reported before seeing the
  # request to report it.
  errormsg "$*" \
           "Please report the installed version of the \"x11-common\"" \
           "package and the complete text of this error message to" \
           "<debian-x@lists.debian.org>."
}

# initialize variables for use by all session scripts

OPTIONFILE=/etc/X11/Xsession.options

SYSRESOURCES=/etc/X11/Xresources
USRRESOURCES=$HOME/.Xresources

SYSSESSIONDIR=/etc/X11/Xsession.d
USERXSESSION=$HOME/.xsession
USERXSESSIONRC=$HOME/.xsessionrc
ALTUSERXSESSION=$HOME/.Xsession
ERRFILE=$HOME/.xsession-errors

# attempt to create an error file; abort if we cannot
if (umask 077 && touch "$ERRFILE") 2> /dev/null && [ -w "$ERRFILE" ] &&
  [ ! -L "$ERRFILE" ]; then
  chmod 600 "$ERRFILE"
elif ERRFILE=$(tempfile 2> /dev/null); then
  if ! ln -sf "$ERRFILE" "${TMPDIR:=/tmp}/xsession-$USER"; then
    message "warning: unable to symlink \"$TMPDIR/xsession-$USER\" to" \
             "\"$ERRFILE\"; look for session log/errors in" \
             "\"$TMPDIR/xsession-$USER\"."
  fi
else
  errormsg "unable to create X session log/error file; aborting."
fi

exec >>"$ERRFILE" 2>&1

echo "$PROGNAME: X session started for $LOGNAME at $(date)"

# sanity check; is our session script directory present?
if [ ! -d "$SYSSESSIONDIR" ]; then
  errormsg "no \"$SYSSESSIONDIR\" directory found; aborting."
fi

# Attempt to create a file of non-zero length in /tmp; a full filesystem can
# cause mysterious X session failures.  We do not use touch, :, or test -w
# because they won't actually create a file with contents.  We also let standard
# error from tempfile and echo go to the error file to aid the user in
# determining what went wrong.
WRITE_TEST=$(tempfile)
if ! echo "*" >>"$WRITE_TEST"; then
  message "warning: unable to write to ${WRITE_TEST%/*}; X session may exit" \
          "with an error"
fi
rm -f "$WRITE_TEST"

# use run-parts to source every file in the session directory; we source
# instead of executing so that the variables and functions defined above
# are available to the scripts, and so that they can pass variables to each
# other
SESSIONFILES=$(run-parts --list $SYSSESSIONDIR)
if [ -n "$SESSIONFILES" ]; then
  set +e
  for SESSIONFILE in $SESSIONFILES; do
    . $SESSIONFILE
  done
  set -e
fi

exit 0

# vim:set ai et sts=2 sw=2 tw=80:

cat /etc/xrdp/startwm.sh

+ открыть спойлер

#!/bin/sh
#if [ -r /etc/default/locale ]; then
#  . /etc/default/locale
#  export LANG LANGUAGE
#fi
##. /etc/X11/Xsession
export LANG=ru_RU.UTF-8
. /etc/X11/Xsession
startlxde

cat /etc/xrdp/startwm.sh.sample

+ открыть спойлер

#!/bin/sh

#start the window manager
wm_start()
{
  if [ -r /etc/default/locale ]; then
    . /etc/default/locale
    export LANG LANGUAGE
  fi

  # debian
  if [ -r /etc/X11/Xsession ]; then
    . /etc/X11/Xsession
    exit 0
  fi

  # el
  if [ -r /etc/X11/xinit/Xsession ]; then
    . /etc/X11/xinit/Xsession
    exit 0
  fi

  # suse
  if [ -r /etc/X11/xdm/Xsession ]; then
    . /etc/X11/xdm/Xsession
    exit 0
  fi

  xterm
}

#Execution sequence for interactive login shell
#Following pseudo code explains the sequence of execution of these files.
#execute /etc/profile
#IF ~/.bash_profile exists THEN
#    execute ~/.bash_profile
#ELSE
#    IF ~/.bash_login exist THEN
#        execute ~/.bash_login
#    ELSE
#        IF ~/.profile exist THEN
#            execute ~/.profile
#        END IF
#    END IF
#END IF
pre_start()
{
  if [ -f /etc/profile ]
  then
    . /etc/profile
  fi
  if [ -f ~/.bash_profile ]
  then
    . ~/.bash_profile
  else
    if [ -f ~/.bash_login ]
    then
      . ~/.bash_login
    else
      if [ -f ~/.profile ]
      then
        . ~/.profile
      fi
    fi
  fi
  return 0
}

#When you logout of the interactive shell, following is the
#sequence of execution:
#IF ~/.bash_logout exists THEN
#    execute ~/.bash_logout
#END IF
post_start()
{
  if [ -f ~/.bash_logout ]
  then
    . ~/.bash_logout
  fi
  return 0
}

#. /etc/environment
#export PATH=$PATH
#export LANG=$LANG

# change PATH to be what your environment needs usually what is in
# /etc/environment
#PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
#export PATH=$PATH

# for PATH and LANG from /etc/environment
# pam will auto process the environment file if /etc/pam.d/xrdp-sesman
# includes
# auth       required     pam_env.so readenv=1

pre_start
wm_start
post_start

exit 1

cat /etc/xrdp/sesman.ini

+ открыть спойлер

[Globals]
ListenAddress=127.0.0.1
ListenPort=3350
EnableUserWindowManager=1
UserWindowManager=startwm.sh
DefaultWindowManager=startwm.sh

[Security]
AllowRootLogin=1
MaxLoginRetry=4
TerminalServerUsers=tsusers
TerminalServerAdmins=tsadmins
# When AlwaysGroupCheck = false access will be permitted
# if the group TerminalServerUsers is not defined.
AlwaysGroupCheck = false

[Sessions]

. /etc/X11/Xsession

## X11DisplayOffset - x11 display number offset
# Type: integer
# Default: 10
X11DisplayOffset=10

## MaxSessions - maximum number of connections to an xrdp server
# Type: integer
# Default: 0
MaxSessions=50

## KillDisconnected - kill disconnected sessions
# Type: integer
# Default: 0
# if 1, true, or yes, kill session after 60 seconds
KillDisconnected=0

## IdleTimeLimit - when to disconnect idle sessions
# Type: integer
# Default: 0
# if not zero, the seconds without mouse or keyboard input before disconnect
# not complete yet
IdleTimeLimit=0

## DisconnectedTimeLimit - when to kill idle sessions
# Type: integer
# Default: 0
# if not zero, the seconds before a disconnected session is killed
# min 60 seconds
DisconnectedTimeLimit=0

## Policy - session allocation policy
# Type: enum [ "Default" | "UBD" | "UBI" | "UBC" | "UBDI" | "UBDC" ]
# Default: Xrdp:<User,BitPerPixel> and Xvnc:<User,BitPerPixel,DisplaySize>
# "UBD" session per <User,BitPerPixel,DisplaySize>
# "UBI" session per <User,BitPerPixel,IPAddr>
# "UBC" session per <User,BitPerPixel,Connection>
# "UBDI" session per <User,BitPerPixel,DisplaySize,IPAddr>
# "UBDC" session per <User,BitPerPixel,DisplaySize,Connection>
Policy=Default

[Logging]
LogFile=xrdp-sesman.log
LogLevel=DEBUG
EnableSyslog=1
SyslogLevel=DEBUG

[X11rdp]
param1=-bs
param2=-ac
param3=-nolisten
param4=tcp
param5=-uds

[Xvnc]
param1=-bs
param2=-ac
param3=-nolisten
param4=tcp
param5=-localhost
param6=-dpi
param7=96

[Xorg]
param1=-config
param2=xrdp/xorg.conf
param3=-logfile
param4=/dev/null
param5=-noreset
param6=-ac
param7=-nolisten
param8=tcp

[Chansrv]
# drive redirection, defaults to xrdp_client if not set
FuseMountName=thinclient_drives

[SessionVariables]
PULSE_SCRIPT=/etc/xrdp/pulse/default.pa


cat /etc/xrdp/xrdp.ini

+ открыть спойлер

[globals]
# xrdp.ini file version number
ini_version=1

bitmap_cache=yes
bitmap_compression=yes
port=3389
allow_channels=true
max_bpp=32
fork=yes
# minimum security level allowed for client
# can be 'none', 'low', 'medium', 'high', 'fips'
crypt_level=high
# security layer can be 'tls', 'rdp' or 'negotiate'
# for client compatible layer
security_layer=rdp
# X.509 certificate and private key
# openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365
certificate=
key_file=

# regulate if the listening socket use socket option tcp_nodelay
# no buffering will be performed in the TCP stack
tcp_nodelay=yes

# regulate if the listening socket use socket option keepalive
# if the network connection disappear without close messages the connection will be closed
tcp_keepalive=yes

#tcp_send_buffer_bytes=32768
#tcp_recv_buffer_bytes=32768

#
# colors used by windows in RGB format
#

blue=009cb5
grey=dedede
#black=000000
#dark_grey=808080
#blue=08246b
#dark_blue=08246b
#white=ffffff
#red=ff0000
#green=00ff00
#background=626c72
#autorun=xrdp1
#hidelogwindow=yes

# when true, userid/password *must* be passed on cmd line
# require_credentials=yes

bulk_compression=yes

# You can set the PAM error text in a gateway setup (MAX 256 chars)
#pamerrortxt=change your password according to policy at http://url
new_cursors=yes
allow_multimon=true

# fastpath - can be set to input / output / both / none
use_fastpath=both
#
# configure login screen
#

# Login Screen Window Title
#ls_title=My Login Title

# top level window background color in RGB format
ls_top_window_bg_color=009cb5

# width and height of login screen
ls_width=350
ls_height=430

# login screen background color in RGB format
ls_bg_color=dedede

# optional background image filename (bmp format).
#ls_background_image=

# logo
# full path to bmp-file or file in shared folder
ls_logo_filename=
ls_logo_x_pos=55
ls_logo_y_pos=50

# for positioning labels such as username, password etc
ls_label_x_pos=30
ls_label_width=60

# for positioning text and combo boxes next to above labels
ls_input_x_pos=110
ls_input_width=210

# y pos for first label and combo box
ls_input_y_pos=220

# OK button
ls_btn_ok_x_pos=142
ls_btn_ok_y_pos=370
ls_btn_ok_width=85
ls_btn_ok_height=30

# Cancel button
ls_btn_cancel_x_pos=237
ls_btn_cancel_y_pos=370
ls_btn_cancel_width=85
ls_btn_cancel_height=30

[Logging]
LogFile=xrdp.log
LogLevel=DEBUG
EnableSyslog=1
SyslogLevel=DEBUG
# LogLevel and SysLogLevel could by any of: core, error, warning, info or debug

[channels]
# Channel names not listed here will be blocked by XRDP.
# You can block any channel by setting its value to false.
# IMPORTANT! All channels are not supported in all use
# cases even if you set all values to true.
# You can override these settings on each session type
# These settings are only used if allow_channels=true
rdpdr=true
rdpsnd=true
drdynvc=true
cliprdr=true
rail=true
xrdpvr=true
tcutils=true

# for debugging xrdp, in section xrdp1, change port=-1 to this:
# port=/tmp/.xrdp/xrdp_display_10

# for debugging xrdp, add following line to section xrdp1
# chansrvport=/tmp/.xrdp/xrdp_chansrv_socket_7210

[xrdp1]
name=sesman-X11rdp
lib=libxup.so
username=ask
password=ask
ip=127.0.0.1
port=-1
xserverbpp=24
code=10

# You can override the common channel settings for each session type
#channel.rdpdr=true
#channel.rdpsnd=true
#channel.drdynvc=true
#channel.cliprdr=true
#channel.rail=true
#channel.xrdpvr=true

cat /etc/xrdp/xrdp_keyboard.ini

+ открыть спойлер

#
# RDP Keyboard <-> X11 Keyboard layout map
#
# How this file works:
#   1. load the file and scan each section to find matching "keyboard_type"
#      and "keyboard_subtype" based on the values received from the client.
#      If not found, then jump to default section.
#   2. in the selected section, look for "rdp_layouts" and "layouts_map".
#      Based on the "keylayout" value from the client, find the right x11
#      layout value.
#   3. model/variant are inferred based on the "keyboard_type" and
#      "keyboard_subtype", but they can be overridden.
#

#
# RDP Keyboard Type (http://msdn.microsoft.com/en-us/library/cc240563.aspx)
#
# 0 is not a valid value
#
# 1 - IBM PC/XT or compatible (83-key) keyboard
# 2 - Olivetti "ICO" (102-key) keyboard
# 3 - IBM PC/AT (84-key) or similar keyboard
# 4 - IBM enhanced (101- or 102-key) keyboard
# 5 - Nokia 1050 and similar keyboards
# 6 - Nokia 9140 and similar keyboards
# 7 - Japanese keyboard
#
# RDP Keyboard Subtype is vendor dependent. XRDP defines as follows:
#
# 0 is not a valid value
#
# 1 - Standard
# 2 - FreeRDP JP keyboard
# 3 - Macintosh
# ... - < any vendor dependent subtype >
#
# The list can be augmented.
#


# default
[default]
# keyboard_type and keyboard_subtype is not readed for default section. It
# is only as a place holder to keep consistency. Default model/variant are
# platform dependent, and could be overridden if needed.
keyboard_type=0
keyboard_subtype=0

# user could override variant and model, but generally they should be inferred
# automatically based on keyboard type and subtype
#variant=
#model=

# A list of supported RDP keyboard layouts
rdp_layouts=default_rdp_layouts
# The map from RDP keyboard layout to X11 keyboard layout
layouts_map=default_layouts_map

[default_rdp_layouts]
rdp_layout_us=0x00000409
rdp_layout_ru=0x00000419

# <rdp layout name> = <X11 keyboard layout value>
[default_layouts_map]
rdp_layout_us=us
rdp_layout_ru=ru

# if two sections have the same keyboard_type and keyboard_subtype, then
# the latter could override the former.
[rdp_keyboard_mac]
keyboard_type=4
keyboard_subtype=3
rdp_layouts=default_rdp_layouts
layouts_map=rdp_layouts_map_mac

[rdp_keyboard_jp]
keyboard_type=7
keyboard_subtype=2
rdp_layouts=default_rdp_layouts
layouts_map=default_layouts_map

[rdp_layouts_map_mac]
rdp_layout_us=us
rdp_layout_ru=ru

Живи за свободу и умри за нее...

2

Посмотрите какая конфигурация xkbmap выставляется в rdp сессии:

setxkbmap -print

А после попробуйте в rdp сессии открыть эмулятор терминала и выполнить:

setxkbmap -layout "us,ru" -option "grp:ctrl_shift_toggle"

После чего проверьте переключение по alt_shift.

3

Dmurr пишет:

## Для корретной работы переключения раскладок клавиатуры по control + shift
setxkbmap -layout «us,ru(winkeys)» -model «pc105″ -option «grp:ctrl_shift_toggle,grp_led:scroll»

надеюсь кавычки то заменил на нормальные?

95% процентов проблем находятся между клавиатурой и стулом.

4

kostik87 пишет:

Посмотрите какая конфигурация xkbmap выставляется в rdp сессии:

setxkbmap -print

А после попробуйте в rdp сессии открыть эмулятор терминала и выполнить:

setxkbmap -layout "us,ru" -option "grp:ctrl_shift_toggle"

После чего проверьте переключение по alt_shift.


После исполнения setxkbmap -layout "us,ru" -option "grp:ctrl_shift_toggle" все начинает работать, но записи команды в /etc/X11/Xsession  ничего не дает. 

+ открыть спойлер

#!/bin/sh
#
# /etc/X11/Xsession
#
# global Xsession file -- used by display managers and xinit (startx)

# $Id: Xsession 967 2005-12-27 07:20:55Z dnusinow $

set -e

setxkbmap -layout "us,ru" -option "grp:ctrl_shift_toggle"

PROGNAME=Xsession

message () {
  # pretty-print messages of arbitrary length; use xmessage if it
  # is available and $DISPLAY is set
  MESSAGE="$PROGNAME: $*"
  echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2
  if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then
    echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
  fi
}

message_nonl () {
  # pretty-print messages of arbitrary length (no trailing newline); use
  # xmessage if it is available and $DISPLAY is set
  MESSAGE="$PROGNAME: $*"
  echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2;
  if [ -n "$DISPLAY" ] && which xmessage > /dev/null 2>&1; then
    echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} | xmessage -center -file -
  fi
}

errormsg () {
  # exit script with error
  message "$*"
  exit 1
}

internal_errormsg () {
  # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
  # One big call to message() for the sake of xmessage; if we had two then
  # the user would have dismissed the error we want reported before seeing the
  # request to report it.
  errormsg "$*" \
           "Please report the installed version of the \"x11-common\"" \
           "package and the complete text of this error message to" \
           "<debian-x@lists.debian.org>."
}

# initialize variables for use by all session scripts

OPTIONFILE=/etc/X11/Xsession.options

SYSRESOURCES=/etc/X11/Xresources
USRRESOURCES=$HOME/.Xresources

SYSSESSIONDIR=/etc/X11/Xsession.d
USERXSESSION=$HOME/.xsession
USERXSESSIONRC=$HOME/.xsessionrc
ALTUSERXSESSION=$HOME/.Xsession
ERRFILE=$HOME/.xsession-errors

# attempt to create an error file; abort if we cannot
if (umask 077 && touch "$ERRFILE") 2> /dev/null && [ -w "$ERRFILE" ] &&
  [ ! -L "$ERRFILE" ]; then
  chmod 600 "$ERRFILE"
elif ERRFILE=$(tempfile 2> /dev/null); then
  if ! ln -sf "$ERRFILE" "${TMPDIR:=/tmp}/xsession-$USER"; then
    message "warning: unable to symlink \"$TMPDIR/xsession-$USER\" to" \
             "\"$ERRFILE\"; look for session log/errors in" \
             "\"$TMPDIR/xsession-$USER\"."
  fi
else
  errormsg "unable to create X session log/error file; aborting."
fi

exec >>"$ERRFILE" 2>&1

echo "$PROGNAME: X session started for $LOGNAME at $(date)"

# sanity check; is our session script directory present?
if [ ! -d "$SYSSESSIONDIR" ]; then
  errormsg "no \"$SYSSESSIONDIR\" directory found; aborting."
fi

# Attempt to create a file of non-zero length in /tmp; a full filesystem can
# cause mysterious X session failures.  We do not use touch, :, or test -w
# because they won't actually create a file with contents.  We also let standard
# error from tempfile and echo go to the error file to aid the user in
# determining what went wrong.
WRITE_TEST=$(tempfile)
if ! echo "*" >>"$WRITE_TEST"; then
  message "warning: unable to write to ${WRITE_TEST%/*}; X session may exit" \
          "with an error"
fi
rm -f "$WRITE_TEST"

# use run-parts to source every file in the session directory; we source
# instead of executing so that the variables and functions defined above
# are available to the scripts, and so that they can pass variables to each
# other
SESSIONFILES=$(run-parts --list $SYSSESSIONDIR)
if [ -n "$SESSIONFILES" ]; then
  set +e
  for SESSIONFILE in $SESSIONFILES; do
    . $SESSIONFILE
  done
  set -e
fi

exit 0

# vim:set ai et sts=2 sw=2 tw=80:

Живи за свободу и умри за нее...

5

+  cat /home/user/.xsession

+ открыть спойлер

setxkbmap -layout "us,ru" -option "grp:alt_shift_toggle"
startlxde

А толку нет. Проверять можно при вводе пароля, до входа в lxde.

Живи за свободу и умри за нее...

6

Dmurr пишет:

А толку нет. Проверять можно при вводе пароля, до входа в lxde.

Почитайте вот эти темы:
https://www.linux.org.ru/forum/general/4998284
http://component-parts.blogspot.co.uk/2 … -xrdp.html
http://xrdp.sourceforge.net/documents/keymap/
http://c-nergy.be/blog/?p=3858

Вам придётся создать свой файл с раскладкой для xrdp по аналогии с /etc/xrdp/km-0407.ini и прочими файлами.

Так что, возможно, вам будет проще просто поставить правило, что учётная запись и пароль набираются только английскими символами, цифрами и прочими спецсимволами, но без кириллицы.

7

cat /etc/xdg/lxsession/LXDE/autostart
@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@setxkbmap -layout "us,ru" -option "grp:alt_shift_toggle"

Странно. При подключении только русские. Вбиваю пароль. Захожу в lxde и в трее горит флаг usa, но как только что либо хочу напечатать сразу все переходит на русский и встает колом.

Если руками забить то все работает.

Живи за свободу и умри за нее...

8 (15.10.2014 13:35:34 отредактировано Dmurr)

kostik87 пишет:
Dmurr пишет:

А толку нет. Проверять можно при вводе пароля, до входа в lxde.

Почитайте вот эти темы:
https://www.linux.org.ru/forum/general/4998284
http://component-parts.blogspot.co.uk/2 … -xrdp.html
http://xrdp.sourceforge.net/documents/keymap/
http://c-nergy.be/blog/?p=3858

Вам придётся создать свой файл с раскладкой для xrdp по аналогии с /etc/xrdp/km-0407.ini и прочими файлами.

Так что, возможно, вам будет проще просто поставить правило, что учётная запись и пароль набираются только английскими символами, цифрами и прочими спецсимволами, но без кириллицы.

Вообщем странно, автозагрузка работает. Но потом снова колом встает русский язык.
Зачем делать keymap  если он и так уже лежит?

ls /etc/xrdp/

+ открыть спойлер

km-0407.ini  km-040c.ini  km-0419.ini  km-0816.ini  rsakeys.ini  startwm_default.sh  xrdp.ini        xrdp.sh
km-0409.ini  km-0410.ini  km-041d.ini  pulse        sesman.ini     startwm.sh         xrdp_keyboard.ini

cat /etc/xrdp/xrdp_keyboard.ini

+ открыть спойлер

#
# RDP Keyboard <-> X11 Keyboard layout map
#
# How this file works:
#   1. load the file and scan each section to find matching "keyboard_type"
#      and "keyboard_subtype" based on the values received from the client.
#      If not found, then jump to default section.
#   2. in the selected section, look for "rdp_layouts" and "layouts_map".
#      Based on the "keylayout" value from the client, find the right x11
#      layout value.
#   3. model/variant are inferred based on the "keyboard_type" and
#      "keyboard_subtype", but they can be overridden.
#

#
# RDP Keyboard Type (http://msdn.microsoft.com/en-us/library/cc240563.aspx)
#
# 0 is not a valid value
#
# 1 - IBM PC/XT or compatible (83-key) keyboard
# 2 - Olivetti "ICO" (102-key) keyboard
# 3 - IBM PC/AT (84-key) or similar keyboard
# 4 - IBM enhanced (101- or 102-key) keyboard
# 5 - Nokia 1050 and similar keyboards
# 6 - Nokia 9140 and similar keyboards
# 7 - Japanese keyboard
#
# RDP Keyboard Subtype is vendor dependent. XRDP defines as follows:
#
# 0 is not a valid value
#
# 1 - Standard
# 2 - FreeRDP JP keyboard
# 3 - Macintosh
# ... - < any vendor dependent subtype >
#
# The list can be augmented.
#


# default
[default]
# keyboard_type and keyboard_subtype is not readed for default section. It
# is only as a place holder to keep consistency. Default model/variant are
# platform dependent, and could be overridden if needed.
keyboard_type=0
keyboard_subtype=0

# user could override variant and model, but generally they should be inferred
# automatically based on keyboard type and subtype
#variant=
#model=

# A list of supported RDP keyboard layouts
rdp_layouts=default_rdp_layouts
# The map from RDP keyboard layout to X11 keyboard layout
layouts_map=default_layouts_map

[default_rdp_layouts]
rdp_layout_us=0x00000409
rdp_layout_ru=0x00000419

# <rdp layout name> = <X11 keyboard layout value>
[default_layouts_map]
rdp_layout_us=us
rdp_layout_ru=ru

# if two sections have the same keyboard_type and keyboard_subtype, then
# the latter could override the former.
[rdp_keyboard_mac]
keyboard_type=4
keyboard_subtype=3
rdp_layouts=default_rdp_layouts
layouts_map=rdp_layouts_map_mac

[rdp_keyboard_jp]
keyboard_type=7
keyboard_subtype=2
rdp_layouts=default_rdp_layouts
layouts_map=default_layouts_map

[rdp_layouts_map_mac]
rdp_layout_us=us
rdp_layout_ru=ru

Живи за свободу и умри за нее...

9

Dmurr пишет:

Зачем делать keymap  если он и так уже лежит?

Какая версия xrdp у вас установлена? В стандартной поставьте xrdp-0.6.1 нет русской раскладки.

10

dpkg-query -p xrdp
Package: xrdp
Priority: extra
Section: checkinstall
Installed-Size: 4356
Maintainer: root@srv-owncloud
Architecture: amd64
Version: 0.9.0+master-1
Provides: xrdp
Size: 1063586
Description: RDP server for Linux

Использовал скрипт
http://scarygliders.net/x11rdp-o-matic-information/

Живи за свободу и умри за нее...

11

xrdp -v
logging configuration:
    LogFile:       /var/log/xrdp.log
    LogLevel:      4
    EnableSyslog:  1
    SyslogLevel:   4

xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2004-2014
See http://www.xrdp.org for more information.
Version 0.9.0

Живи за свободу и умри за нее...

12

Рекомендуется подключаться посредством X11rdp, а не Xvnc. Попробуйте.

13

временно в lxde прокатило, но почему при вводе пароля! вводятся ТОЛЬКО цифры, что явно не хорошо для сервера смотрящего в инет (даже при включенном fail2ban например). Хочется хотя бы латиницу при вводе пароля.

cat /etc/xdg/lxsession/LXDE/autostart

+ открыть спойлер

@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@bash /etc/keytab

cat /etc/keytab

+ открыть спойлер

#!/bin/bash

sleep 7
setxkbmap -layout "us,ru" -option "grp:alt_shift_toggle"
google-chrome

Живи за свободу и умри за нее...

14

kostik87 пишет:

Рекомендуется подключаться посредством X11rdp, а не Xvnc. Попробуйте.


dpkg -l | grep xvnc
И тишина.

dpkg -l | grep x11rdp
ii  x11rdp                                0.9.0+master-1                     amd64        X11rdp backend for the xrdp remote access server

Наверное через x11rdp работает.

Живи за свободу и умри за нее...

15

Dmurr пишет:

Наверное через x11rdp работает

При подключении с Windows по RDP к Linux выберите sesman-X11rdp.

Вообще, всё что вы пытаетесь настроить, это даже не дистрибутивный пакет. Вот оно и работает не пойми как.

Если вам нужно настроить терминальный сервер или что-то в этом роде, то попробуйте просто VNC.

16

sesman-X11rdp я его одного оставил в окне входа, чтобы у пользователей не было вариантов.
Так что все через него.

cat /etc/xrdp/xrdp.ini

+ открыть спойлер

[globals]
# xrdp.ini file version number
ini_version=1
bitmap_cache=yes
bitmap_compression=yes
port=3389
allow_channels=true
max_bpp=32
fork=yes
# minimum security level allowed for client
# can be 'none', 'low', 'medium', 'high', 'fips'
crypt_level=high
# security layer can be 'tls', 'rdp' or 'negotiate'
# for client compatible layer
security_layer=rdp
# X.509 certificate and private key
# openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365
certificate=
key_file=
# regulate if the listening socket use socket option tcp_nodelay
# no buffering will be performed in the TCP stack
tcp_nodelay=yes
# regulate if the listening socket use socket option keepalive
# if the network connection disappear without close messages the connection will be closed
tcp_keepalive=yes
#tcp_send_buffer_bytes=32768
#tcp_recv_buffer_bytes=32768
#
# colors used by windows in RGB format
#
blue=009cb5
grey=dedede
#black=000000
#dark_grey=808080
#blue=08246b
#dark_blue=08246b
#white=ffffff
#red=ff0000
#green=00ff00
#background=626c72
#autorun=xrdp1
#hidelogwindow=yes
# when true, userid/password *must* be passed on cmd line
# require_credentials=yes
bulk_compression=yes
# You can set the PAM error text in a gateway setup (MAX 256 chars)
#pamerrortxt=change your password according to policy at http://url
new_cursors=yes
allow_multimon=true
# fastpath - can be set to input / output / both / none
use_fastpath=both
#
# configure login screen
#
# Login Screen Window Title
#ls_title=My Login Title
# top level window background color in RGB format
ls_top_window_bg_color=009cb5
# width and height of login screen
ls_width=350
ls_height=430
# login screen background color in RGB format
ls_bg_color=dedede
# optional background image filename (bmp format).
#ls_background_image=
# logo
# full path to bmp-file or file in shared folder
ls_logo_filename=
ls_logo_x_pos=55
ls_logo_y_pos=50
# for positioning labels such as username, password etc
ls_label_x_pos=30
ls_label_width=60
# for positioning text and combo boxes next to above labels
ls_input_x_pos=110
ls_input_width=210
# y pos for first label and combo box
ls_input_y_pos=220
# OK button
ls_btn_ok_x_pos=142
ls_btn_ok_y_pos=370
ls_btn_ok_width=85
ls_btn_ok_height=30
# Cancel button
ls_btn_cancel_x_pos=237
ls_btn_cancel_y_pos=370
ls_btn_cancel_width=85
ls_btn_cancel_height=30
[Logging]
LogFile=xrdp.log
LogLevel=DEBUG
EnableSyslog=1
SyslogLevel=DEBUG
# LogLevel and SysLogLevel could by any of: core, error, warning, info or debug
[channels]
# Channel names not listed here will be blocked by XRDP.
# You can block any channel by setting its value to false.
# IMPORTANT! All channels are not supported in all use
# cases even if you set all values to true.
# You can override these settings on each session type
# These settings are only used if allow_channels=true
rdpdr=true
rdpsnd=true
drdynvc=true
cliprdr=true
rail=true
xrdpvr=true
tcutils=true
# for debugging xrdp, in section xrdp1, change port=-1 to this:
# port=/tmp/.xrdp/xrdp_display_10
# for debugging xrdp, add following line to section xrdp1
# chansrvport=/tmp/.xrdp/xrdp_chansrv_socket_7210
[xrdp1]
name=sesman-X11rdp
lib=libxup.so
username=ask
password=ask
ip=127.0.0.1
port=-1
xserverbpp=24
code=10
# You can override the common channel settings for each session type
#channel.rdpdr=true
#channel.rdpsnd=true
#channel.drdynvc=true
#channel.cliprdr=true
#channel.rail=true
#channel.xrdpvr=true

Живи за свободу и умри за нее...

17

+ Странность при входе с моего debian 7 я могу вводить логин\пароль только цифры, но при входе с win xp\7 я могу писать и цифрами и буквами ЛАТИНСКИМИ, если захожу с английской раскладки.
С таким никто не сталкивался?

Живи за свободу и умри за нее...

18

Подскажите добрые люди, поставил Centos 7+xrdp, есть раскладка ru, en, но при ее смене руками клавишу не работают постоянно печатает на en, не пойму почему так, помогите ....

19

susl2016 пишет:

при ее смене руками клавишу

Значит не те клавиши жмёте.

20 (13.03.2015 14:31:11 отредактировано susl2016)

stranger пишет:
susl2016 пишет:

при ее смене руками клавишу

Значит не те клавиши жмёте.

Там в правом углу (русская, английская) и я мышкой переключаю языки, но в браузере постоянно на анг печатает, на Centos 6.6 все норм работает

21

susl2016 пишет:

в браузере постоянно на анг печатает

Чё? После переключения мышкой везде печатает на русском и только в браузере на английском?

И причём тут мышка, когда речь о клавишах?

22 (13.03.2015 14:48:17 отредактировано susl2016)

горячии клавиши не работают в xrdp на 7-й, на русском не где не печатает везде на анг, не зависимо от выбранной раскладки
Может надо как то закачать раскладку ?  ak  ak  ak

23 (13.03.2015 15:15:49 отредактировано susl2016)

может мне установить system-config-languge ? Подскажите как мне это сделать .

Проделал это http://www.cyberforum.ru/redhat-fedora- … 80749.html не помогло

24

Поражаюсь, этой проблеме уже 2,5 года, и до сих пор ответа нет. Сам уже сейчас сталкиваюсь в CentOS7+MATE внутри xrdp 0.9.2.  Пытаюсь решить эту проблему через автозагрузку setxkbmap.

Запускаю

xfreerdp 172.0.0.2

Указываю пользователя и пароль.
Открывается рабочая среда MATE.
Вижу только английскую раскладку клавиатуры в гостевой среде.
Через настройки в гостевой среде добавил русскую раскладку и возможность переключения через Alt+Shift. Проверил, хорошо работает.
Завершил работу с этой средой. Запустил еще раз под тем же пользователем. Переключение не работает. Зашел в настройки клавиатуры, всё было сохранено.
Запускаю в терминале пользователя внутри гостевой среды и выполняю команду:

setxkbmap -option 'grp:alt_shift_toggle,grp:switch,grp_led:scroll,compose:menu' -layout 'us,ru'

После переключение работает. Пришла мысль решить проблему путем прописывания в автозагрузку.
Сделал так:
Создал файл
~/.config/autostart/setxkbmap.desktop
со следующим содержанием:

[Desktop Entry]
Type=Application
Exec=./setxkbmap.sh
Hidden=false
X-MATE-Autostart-enabled=true
Name[ru_RU]=Установка русской раскладки
Name=Установка русской раскладки
Comment[ru_RU]=
Comment=

Содержимое файла setxkbmap.sh:

#!/bin/bash

echo 777
setxkbmap -option 'grp:alt_shift_toggle,grp:switch,grp_led:scroll,compose:menu' -layout 'us,ru'
echo 888

Запускаю гостевую среду, проверяю, переключение раскладки не работает. Смотрю лог-файл .xsession-errors:

777
888
Initializing caja-open-terminal extension
Initializing caja-image-converter extension
system-config-printer-applet: failed to start NewPrinterNotification service
system-config-printer-applet: failed to start PrinterDriversInstaller service: org.freedesktop.DBus.Error.AccessDenied: Connection ":1.1344" is not allowed to own the service "com.redhat.PrinterDriversInstaller" due to security policies in the configuration file

Судя по наличию 777 и 888, вроде скрипт корректно запустился, а результата почему-то нет. В чем подвох?

25

На гитхабе давно есть решение, должно помочь
https://github.com/neutrinolabs/xrdp/is … -193591620