Xepyr로 Multiseat을 어떻게 만들 수 있나요?

Xepyr로 Multiseat을 어떻게 만들 수 있나요?

Ubuntu에서 다중 시트를 사용하려고 하는데 이 작업을 수행할 수 없습니다.

나는 "방법"을 많이 읽었으며 그 중 대부분은 GDM2 또는 KDM을 사용하여 배포판을 사용하여 다중 좌석을 수행하는 것에 관한 것입니다. 하지만 저는 우분투의 lightdm을 사용하고 있습니다.

그래서 이제 저는 이미 Debian 4 버전에서 다중 시트를 만드는 데 사용했던 Xephyr를 사용하여 이 다중 시트를 만들려고 합니다. 하지만 lightdm.conf에서 Xepyr를 호출하는 방법을 모르겠습니다.

답변1

Xepyr를 사용하는 다중 좌석용 LightDM 설정 샘플이 있습니다. Andrzej Pietrasiewicz(아래 복사/참조된 블로그 작성자)가PPA아래에 모든 코드가 표시됩니다. 해당 PPA를 설치하면 lightdm 설치가 "마법처럼" 작동하도록 할 수 있습니다.

메모:나는 그것을 작동시키려고 노력해 왔지만 아직 성공하지 못했습니다. 그러나 다음 내용에는 일정 수의 모순되는 매개변수가 있음을 말씀드릴 수 있습니다.

몇 가지 중요한 부분:

  1. "하드웨어 서버"를 정의하는 [Seat:0] 항목입니다. 그러면 X 서버가 시작됩니다. 디스플레이를 나타냅니다:0
  2. 좌석을 확보하기 위해 시작해야 할 작업을 정확하게 정의하는 xserver-command 항목입니다. Xepyr는 Display :1 및 Display :2로 시작됩니다. 따라서 실제로 사용자는 Display :1 및 :2에 로그인하지만 :0에는 로그인하지 않습니다.

그런 것 :

+------------------------------- Display :0 -----------------------------+
|  X server                                                              |
|                                                                        |
|  +--------- Display :1 ----------+  +--------- Display :2 ----------+  |
|  |  Xephyr 1                     |  |  Xephyr 2                     |  |
|  |  User A                       |  |  User B                       |  |
|  |                               |  |                               |  |
|  |                               |  |                               |  |
|  |                               |  |                               |  |
|  +-------------------------------+  +-------------------------------+  |
|                                                                        |
+------------------------------------------------------------------------+

xorg.conf 파일:

# File: /etc/X11/xorg.conf

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "ServerFlags"
    # start even without the mouse
    Option "AllowMouseOpenFail" "yes"
    # disable VT switching
    #Option "DontVTSwitch" "yes"
    # Ctrl+Alt+Backspace disable
    #Option "DontZap" "yes"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Philips 170B4"
    HorizSync       30.0 - 82.0
    VertRefresh     56.0 - 76.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 8400 GS"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "1"
    Option         "TwinViewXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "CRT: nvidia-auto-select +0+1080, DFP: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

원천:http://beforeafterx.blogspot.com/2011/02/multiseat-setup-xorgconf.html

lightdm.conf의 스크립트:

# File: /etc/lightdm/lightdm.conf
[LightDM]
greeter-user=root
user-authority-in-system-dir=false
common-vt=true

[SeatDefaults]
xserver-allow-tcp=false
greeter-hide-users=true
user-session=lightdm-xsession
session-wrapper=/etc/X11/Xsession

[Seat:0]
xserver-command=X -br -dpms -s 0 -novtswitch
greeter-session=xinerama

[Seat:1]
xserver-command=/etc/multiseat/scripts/Xephyr-seat-1
greeter-session=multiseat-greeter-1

[Seat:2]
xserver-command=/etc/multiseat/scripts/Xephyr-seat-2
greeter-session=multiseat-greeter-2

원천:http://beforeafterx.blogspot.com/2012/08/multiseat-setup-lightdmconf.html

다중 좌석 스크립트는 해당 좌석에 사용할 마우스와 키보드를 설명하는 매개변수를 사용하여 Xephyr를 시작합니다. 나는 그 정보를 찾아 여기에 제공하기 위해 최선을 다할 것입니다.

#!/bin/bash
# File: /etc/multiseat/scripts/Xephyr-seat1, Xephyr-seat2, ..., Xephyr-seatN
#
# $1 - display number of this Xephyr

. /etc/multiseat/scripts/helper-functions

trap "" usr1

XEPHYR=/root/Xephyr-new
export DISPLAY=:0
export XAUTHORITY=/var/run/lightdm/root/:0

SEAT=1

SIZE=`get_conf $SEAT SIZE`
KEYBOARD=`get_conf $SEAT KEYBOARD`
LAYOUT=`get_conf $SEAT LAYOUT`
MOUSE=`get_conf $SEAT MOUSE`
DPI=`get_conf $SEAT DPI`

exec $XEPHYR -retro -screen ${SIZE} -keybd evdev,,device=/dev/input/${KEYBOARD},xkbrules=evdev,xkbmodel=evdev,xkblayout=${LAYOUT} -mouse evdev,,device=/dev/input/${MOUSE} -dpi ${DPI} $1

원천:http://beforeafterx.blogspot.com/2012/08/multiseat-configuration-xephyr-seat-1.html

lightdm에서 참조되는 더 큰 것은 별도의 쉘 스크립트이기도 합니다. /bin/sh대신 참조를 권장합니다 /bin/bash. 나는 bash가 필요한 것을 보지 못했습니다. 마지막에는 기본 lightdm-gtk-greeter를 참조합니다.

#!/bin/bash
# File: /etc/multiseat/scripts/multiseat-greeter-1, ..., multiseat-greeter-n
#
# multiseat wrapper around ligthdm greeter in order to position a Xephyr instance
#
. /etc/multiseat/scripts/helper-functions

PRIMARY=`get_conf 0 PRIMARY`
SEAT=1

if [ $SEAT != $PRIMARY ]; then
    XEP=`XAUTHORITY=/var/run/lightdm/root/:0 xwininfo -root -children -display :0 | grep "Xephyr on :$SEAT" --max-count=1`;
    XEPHYR_WIN_ID=`echo ${XEP} | cut -d' ' -f1`;
    DISPLACEMENT=`get_conf $SEAT DISPLACEMENT`
    DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 wmctrl 2>&1 -v -i -r ${XEPHYR_WIN_ID} -e 0,0,${DISPLACEMENT},-1,-1;
fi

XAUTHORITY=/var/run/lightdm/root/:$SEAT
DISPLAY=:$SEAT
exec /usr/sbin/lightdm-gtk-greeter

일부 함수는 다음 스크립트에서 정의될 수 있습니다. 왠지 아직 보지 못한 또 다른 다중 좌석 스크립트가 포함되어 있습니다 ...

# File: /etc/multiscript/scripts/helper-functions

. /etc/default/multiseat

#
# private implementation of get_sect
#
# get given section's contents from the given config file
#
# $1 filename
# $2 section number
#
__get_sect()
{
    cat $1 | awk -v sect=$2 '
    BEGIN {
        SECT="^\\[" sect "\\]"
        NEXT_SECT="^\\[" (sect + 1) "\\]"
    }
    $0 ~ SECT, $0 ~ NEXT_SECT {
        if ($0 ~ SECT)
            next;
        if ($0 ~ NEXT_SECT)
            next;
        if (substr($1, 1, 1) == "#")
            next;
        print
    }
    '
}

#
# private implementation of get_conf
#
# get given key's contents from the given section
# from the given config file
#
# does not work for tables in the config file
#
# $1 filename
# $2 section name
# $3 key name
#
__get_conf()
{
    __get_sect $1 $2 | awk -F"=" -v key=$3 '
    BEGIN {
        KEY=key
    }
    $1==KEY {
        print substr($0, index($0, "=") + 1)
    }
    '
}

#
# private implementation of get_num_seats
#
# get number of seats from the default config file
#
# $1 filename
#
__get_num_seats()
{
    cat $1 | awk '
    BEGIN {
        count=0
    }
    /^\[[0-9]*\]/ {count++}
    END {
        print count - 1
    }
    '
}

#
# get given section's contents from the default config file
#
# $1 section name
#
get_sect()
{
    __get_sect $CONFIG $1
}

#
# private implementation of get_table
#
# $1 filename
# $2 section number
# $3 table name
# $4 size/entry switch [-size => size, <number> for entry]
#
__get_table()
{
    SIZE=0;
    ENTRY=-1

    if [ $4 == "-size" ];
    then
        SIZE=1;
    else
        ENTRY=$4
    fi

    RESULT=`__get_sect $1 $2 | awk -v table=$3 -v get_size=$SIZE -v entry=$ENTRY '
    BEGIN {
        print BEGIn
        TABLE=table "\\\=" "\\\("
        GET_SIZE=get_size
        ENTRY=entry
        size=0
    }
    $0 ~ TABLE, /^\)/ {
        if ($0 ~ TABLE)
            next;
        if ($0 ~ /^\)/)
            next;
        if (substr($1, 1, 1) == "#")
            next;
        if (get_size == 0 && size == entry){
                print
                exit
        }
        size++;
    }
    END {
        if (get_size)
            print size;
    }
    '`
    RESULT=`echo $RESULT | sed 's/^[ \t]*//g'`

    echo $RESULT
}

#
# get given key's contents from the given section
# from the default config file
#
# does not work for tables in the config file
#
# $1 section name
# $2 key name
#
get_conf()
{
    __get_conf $CONFIG $1 $2
}

#
# get number of seats from the default config file
#
get_num_seats()
{
    __get_num_seats $CONFIG
}

#
# get size of a given table in the given section of the config file or
# get specified entry of the table
#
# $1 section number
# $2 table name
# $3 size/entry switch [-size => size, <number> for entry]
#
get_table()
{
    __get_table $CONFIG $1 $2 $3
}

가짜 인사 스크립트는 잠자는 사람입니다. 완전히 종료되어 종료될 때까지 잠자기 상태로 유지됩니다. 분명히 이것은 필수는 아닙니다. 댓글에 따르면 -noreset이렇게 기다리지 않아도 되는 옵션이면 충분하다고 합니다. 나중에 직접 테스트한 후 보고하겠습니다.

#!/bin/bash
# File: /etc/multiseat/scripts/fake-greeter

pid_set=0

kill_sleep()
{
    if [ $pid_set -ne 0 ];
    then
        kill -15 $pid
    fi
    exit 0
}

trap 'kill_sleep' TERM

while true;
do
    sleep 1000 &

    pid=$!
    pid_set=1

    wait $pid
done

같은 블로그에서는 udev에 문제가 있으며 다중 시트가 제대로 작동하도록 다시 재설정해야 한다고 말합니다. 이는 2012년 8월의 일이므로 2014년에도 여전히 적용될지는 알 수 없습니다.

#!/bin/sh
# File: /etc/init.d/multiseat
### BEGIN INIT INFO
# Provides:          multiseat
# Required-Start:    bootlogs
# Required-Stop:
# Default-Start:     1 2 3 4 5
# Default-Stop:
# Short-Description: Trigger udev rules
# Description:       For some reason the rules for multiseat config need to be
#                    fired once more and later than at the very beginning.
### END INIT INFO

/sbin/udevadm trigger

시스템에서 이 스크립트를 올바르게 설정하려면 다음 명령을 실행하십시오.

sudo update-rc.d multiseat defaults

이번에도 이 스크립트가 필요한지 여부는 알 수 없습니다. 제공되는 스크립트를 정리하는 것만으로도X 전 후.

원천:http://beforeafterx.blogspot.com/2012/08/multiseat-setup-initdmultiseat.html

답변2

xrdp를 사용해보십시오. 가장 쉬운 솔루션이 될 것입니다. vnc4server를 설치한 다음 xrdp를 설치했습니다. 그런 다음 rdesktop / tsclient / remmina를 사용하여 IP 주소를 사용하여 xrdp 시스템을 연결했습니다.

답변3

이있다멋진 블로그Xephyr 기반 다중 좌석 설정을 얻는 과정을 자세히 설명합니다. 그는 또한 Lightdm을 사용하고 있습니다. 도움이 되길 바랍니다.

관련 정보