Я пытаюсь использовать Multiseat с Ubuntu, но я не могу заставить это работать.
Я прочитал много «как», и большинство из них о создании мультисайтов с некоторыми дистрибутивами с GDM2 или KDM. Но я использую lightdm из Ubuntu.
Так что теперь я пытаюсь сделать этот мультисайт с Xephyr, который я уже использовал для создания мультисайтов с версией Debian 4 Но я не знаю, как позвонить Xephyr в lightdm.conf.
Существует образец установки LightDM для использования мультиместа Xephyr. Это похоже на Andrzej Pietrasiewicz (автор блога копировал/ссылался ниже), создал PPA со всем кодом, отображенным ниже. Путем установки, что PPA, необходимо смочь заставить lightdm установку работать "волшебно".
Примечание: Поскольку я пытался заставить это работать, я еще не успешно выполнился. Однако я могу сказать Вам, что существует определенное число противоречащих параметров в дальнейшем.
Некоторые важные части:
Что-то как этот:
+------------------------------- 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
. Я не видел ничего, что потребует удара. Обратите внимание, что это ссылается на значение по умолчанию 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, таким образом, я не знаю, применялось ли это все еще в 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
попробуйте xrdp, это будет самое простое решение. Я установил vnc4server, а затем установил xrdp. а затем я использовал rdesktop / tsclient / remmina для подключения к машине xrdp с использованием IP-адреса.
Существует замечательный блог , в котором подробно описан процесс создания мультисайта на основе Xephyr. Он также использует Lightdm. Надеюсь, это поможет.