如何仅使用一张物理显卡设置多座位?

Aly*_*Aly 17 multiseat drivers 16.04

我有一台运行 16.04 的 Ubuntu 计算机,而且我只有一张显卡。

眼镜

我的兄弟和我经常为谁可以使用它而争吵,所以我试图帮大家一个忙并安装多座位。

  • 我会seat0,在电脑背面有 VGA 端口、鼠标、键盘和耳机插孔。

  • 他会seat1带着 DVI-D 端口、鼠标、键盘和电脑正面的耳机插孔。

  • 我们将共享 Wi-Fi 加密狗以连接到互联网。

我完全不知道如何做到这一点。我要创建什么文件,它们去哪里,我在里面放什么?格式正确的答案(不是在线指南)会很好。

的输出lspci

00:00.0 Host bridge: Intel Corporation 4th Gen Core Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d5)
00:1c.1 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #2 (rev d5)
00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d5)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation C220 Series Chipset Family H81 Express LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)
01:00.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
01:00.1 System peripheral: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:01.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:05.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:07.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
02:09.0 PCI bridge: PLX Technology, Inc. PEX 8609 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch with DMA (rev ba)
03:00.0 USB controller: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller
04:00.0 USB controller: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller
05:00.0 USB controller: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller
06:00.0 USB controller: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller
08:00.0 USB controller: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller
09:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
Run Code Online (Sandbox Code Playgroud)

的输出ls /dev/input/by-path/

pci-0000:00:14.0-usb-0:1:1.2-event-kbd
pci-0000:00:14.0-usb-0:2:1.0-event-kbd
pci-0000:00:14.0-usb-0:7:1.0-event-mouse
pci-0000:00:14.0-usb-0:1:1.2-event-mouse
pci-0000:00:14.0-usb-0:3.1:1.0-event-mouse
pci-0000:00:14.0-usb-0:7:1.0-mouse
pci-0000:00:14.0-usb-0:1:1.2-mouse
pci-0000:00:14.0-usb-0:3.1:1.0-mouse
platform-eeepc-wmi-event
Run Code Online (Sandbox Code Playgroud)

The*_*rer 8

所以这是一个旧指南,但它可能仍然有效。多座位单卡

在我开始带来说明之前的一些注意事项:

  • gdm它希望您进行的所有配置甚至可能都不是必需的。如果您有 GNOME,那么您已经拥有gdm(以及更新的版本)。Unity 使用lightdm,看起来它可能不起作用。您应该安装gdm并使用它来尝试本指南。

  • 只是另一个警告:旧指南。它可能不起作用,它可能会破坏 Ubuntu,它可能会炸毁你的机器(当然不是真的)。请小心并备份东西。

现在为指南

维基建议使用以下方法禁用启动画面。我不知道程序是否仍然有效。

此设置可能会出现很多问题,并且启动期间花哨的闪屏也无济于事。为了禁用它(可能是暂时的),请编辑 /etc/default/grub 并将 GRUB_CMDLINE_LINUX_DEFAULT 分配从quiet splash 更改为 nomodeset noplymouth。然后运行 ​​sudo update-grub。

下一部分,关于“扩展桌面”的部分也可以跳过。只需插入两台显示器并在您的显示器设置中将它们设置为“扩展模式”。

现在,对于一些配置。

首先,在/etc/gdm/gdm.conf 中,在[servers] 部分中找到一行以0=.... 开头的行(行首没有#)。在它前面放一个#。

这应该是可能的,没有太多麻烦。

然后编辑 /etc/gdm/gdm.conf-custom。找到 [security] 部分并添加一行 PamStack=gdm-2.20。

这是您可能遇到问题的地方。您可能需要尝试 3.18(这是 16.04)而不是 2.20。

找到 [xdmcp] 部分并添加一行 Enable=true。

那应该不会造成麻烦。

XDMCP 不是特别安全的协议,因此最好让 gdm 拒绝来自其他计算机的连接。在 /etc/hosts.allow 中添加一行 gdm: 127.* 并在 /etc/hosts.deny 中添加一行 gdm: ALL。

这个,你可以选择不做。如果你关心安全,我建议你这样做,否则,我认为你可以离开它。

现在gdm通过重新启动重新启动(可能是最简单的方法)。如果您看到 GDM 登录屏幕,则说明有问题。检查原始指南并调整一些设置。

如果您没有登录屏幕,请转到 TTY 并运行X -query 127.0.0.1. 如果 GDM 出现,杀死它(回到 TTY 并在那里杀死它)。

创建一个名为 的新用户monitor

addgroup --gid 983 monitor
adduser --uid 983 --gid 983 monitor
Run Code Online (Sandbox Code Playgroud)

在其中创建一个文件(指南没有名称规范)/etc/udev/rules.d/my.rules并输入以下内容:

SUBSYSTEM=="input", OWNER="monitor", GROUP="monitor"
Run Code Online (Sandbox Code Playgroud)

一些软件包安装:

apt-get install x11-utils xserver-xephyr
Run Code Online (Sandbox Code Playgroud)

我们需要用一些别名来分隔监视器:

ln -s xmessage /usr/bin/xmessage0
ln -s xmessage /usr/bin/xmessage1
Run Code Online (Sandbox Code Playgroud)

monitor在 TTY 中登录用户并创建~/.xsession.

把这个放在里面:

runscreen () {
    # $1 = number
    # $2 = geometry
    local xpid winid k
    while :; do
        xmessage$1 -geometry $2 "Window $1" &
        xpid=$!
        k=10
        while \
            winid=`xwininfo -name xmessage$1|grep 'Window id'|cut -d' ' -f4` \
            && [ $k -gt 0 -a ! "$winid" ]
        do
            sleep 1
            k=$(($k - 1))
        done
        if [ "$winid" ]; then
            Xephyr :1$1 -parent "$winid" -dpms -keybd "evdev,,device=$3,$xkb" -mouse "evdev,,device=$4" -query 127.0.0.1 
        fi
        kill $xpid
        sleep 3
        kill -9 $xpid
    done 
}

# For some reason I was unable to set the following in xorg.conf
# We need to turn off power management of the main X server because it doesn't
# see either of the keyboards and the mice so it will enter power-saving mode
# after 10 minutes
xset s off
xset dpms 0 0 0
xset -dpms

xkb='xkbrules=xorg,xkbmodel=evdev,xkblayout=us'

# PS/2 keyboard and mouse
kbd1=`ls /dev/input/by-path/platform-*-event-kbd`
mouse1=`ls /dev/input/by-path/platform-*-event-mouse`

# USB keyboard and mouse
kbd2=`ls /dev/input/by-path/pci-*-event-kbd`
mouse2=`ls /dev/input/by-path/pci-*-event-mouse`

runscreen 1 1280x1024+1920+0 "$kbd2" "$mouse2" &
runscreen 0 1920x1080+0+0 "$kbd1" "$mouse1"
Run Code Online (Sandbox Code Playgroud)

请记住对其进行编辑以反映您的决议。

startxmonitor用户身份运行,看看它是否有效。

如果它有效,则需要在启动时启动,因此将其添加到~/.profile(对于监控帐户)的末尾:

if [ "`tty`" = /dev/tty6 ]; then
    exec startx
fi
Run Code Online (Sandbox Code Playgroud)

杀死 GUI 并转到 TTY6。登录为monitor,它应该启动。

如果这样的作品,编辑该文件/etc/init/tty6.conf为根,更换开头的行/sbin/getty

exec /bin/login -f monitor tty6 </dev/tty6 >/dev/tty6 2>&1
Run Code Online (Sandbox Code Playgroud)

如果它有效,但您还想分离音频,链接的MultiSeatX指南为您提供了一些东西。

请记住,这可能不起作用。我很快就把它打出来了,如果有必要的话,希望可以编辑得更清楚一点。我对指南的部分内容进行了修改,使其与时俱进,并增加了成功的机会。

祝你好运!