r3 - 24 Jun 2006 - 05:06:04 - StevenMcCoyYou are here: TWiki >  Ltsp Web  >  VideoCards > MultiSeat

Multi-Seat LTSP

This page is for covering multiple users sharing one terminal to connect to a terminal server.

-- StevenMcCoy - 22 Jun 2006

Multi-Head X11

X.org appears to be currently broken:

https://launchpad.net/distros/ubuntu/+source/xorg/+bug/42731

Virtual Server

Following the MoreUbuntu approach it is possible to generate a diskless Ubuntu Server image with VServer virtualisation and then run separate jail/container LTSP clients on top of that with slight modifications to the configuration to prevent device overlap.


* Work in progress, it works just not automagically *

  • install ubuntu dapper server

$ sudo mount -o nolock 10.0.0.70:/mnt/common /common/ 
$ sudo debootstrap  --arch i386 dapper /common/vserver/i386/ http://hk.archive.ubuntu.com/ubuntu/

  • install vserver, update /etc/apt/sources.list

# cd /common/vserver/i386/
# echo "deb http://ubuntu.uni-klu.ac.at/ubuntu.uniklu/ dapper uniklu-vserver" >> etc/apt/sources.list
# wget http://ubuntu.uni-klu.ac.at/uniklu-debuild.pub
# chroot /common/vserver/i386 apt-key add uniklu-debuild.pub 
# chroot /common/vserver/i386 apt-get update 
# chroot /common/vserver/i386 apt-get install util-vserver vserver-debiantools linux-image-2.6.15-26-686

  • update pxe server, dhcp, etc
  • create netboot initrd:

# chroot /common/vserver/i386/ /bin/bash

  • edit etc/mkinitramfs/initramfs.conf: replace BOOT=local with BOOT=nfs

# mkinitramfs -o boot/initrd.img-2.6.15-26-686l 2.6.15-26-686


notes for vserver usage

  • no modules
  • no swap
  • no networking / dhcp

  • create ubuntu vserver, define ubuntu image

# cat >> /etc/vservers/ltsp1
ARCH="i386"
DIST="dapper"
MIRROR="http://hk.archive.ubuntu.com/ubuntu"
INTERFACE="eth0"

then start the bootstrap

# newvserver -v --hostname ltsp1 --domain cn.yorkion.com --ip 10.0.0.76

  • link to ltsp

# cd /opt/ltsp
# ln -s /etc/vservers/ltsp1/vdir i386

  • continue ltsp-build

comment out debootstrap in /usr/sbin/ltsp-build-client

# ltsp-build-client

  • remove init.d stuff so you can actually start

# for i in klogd hwclock.sh urandom networking umountfs halt reboot mountvirtfs mountall.sh usplash
> update-rc.d -f $i remove

  • patch ltsp init scripts for vserver, no rcS scripts are actually run so this is redundant

# patch <<EOF
--- ltsp-client-setup.original  2006-06-24 03:58:22.000000000 +0800
+++ ltsp-client-setup   2006-06-24 04:05:23.000000000 +0800
@@ -28,18 +28,27 @@
 test -f /etc/default/ltsp-client-setup && . /etc/default/ltsp-client-setup

 load_modules() {
+    if [ Y = "${IS_VSERVER}" ] ; then
+       return
+    fi
     for module in $(env | awk -F= '$1 ~ /^MODULE_/ { print $2 }'); do
         modprobe $module
     done
 }

 configure_console() {
+    if [ Y = "${IS_VSERVER}" ] ; then
+       return
+    fi
     if [ -n "$CONSOLE_KEYMAP" ]; then
         loadkeys "$CONSOLE_KEYMAP"
     fi
 }

 configure_swap() {
+    if [ Y = "${IS_VSERVER}" ] ; then
+       return
+    fi
     if [ -n "$SWAP_SERVER" -a -n "$NBD_PORT" ]; then
         cat <<EOF > /etc/nbd-client
 NBD_DEVICE[0]=/dev/nbd0
@@ -68,6 +77,9 @@
 }

 configure_network() {
+    if [ Y = "${IS_VSERVER}" ] ; then
+       return
+    fi
     cat <<EOF > /etc/network/interfaces
 auto lo
 iface lo inet loopback
@@ -81,6 +93,9 @@
 }

 configure_fstab() {
+    if [ Y = "${IS_VSERVER}" ] ; then
+       return
+    fi
   echo "/dev/root       /       unionfs defaults        0       0" > /etc/fstab
   echo "tmpfs           /tmp    tmpfs   defaults,nosuid,nodev 0 0" >> /etc/fstab
   mount /tmp

  • add vserver line to lts.conf

# cat > etc/lts.conf
[Default]
        IS_VSERVER              = Y
        SERVER                  = 10.0.0.72
        XSERVER                 = auto
        X_MOUSE_DEVICE          = /dev/input/mice
        X_MOUSE_PROTOCOL        = auto
        X_MOUSE_EXTRA           = "ZAxisMapping 4 5"
        USE_XFS                 = N
        LOCAL_APPS              = N

  • fix mtab, presumably matching vserver parameters

# rm etc/mtab
# cat > etc/mtab
/dev/hdv1 / ufs default 0 0
none /proc proc defaults 0 0
none /tmp tmpfs size=16m,mode=1777 0 0
none /dev/pts devpts gid=5,mode=620 0 0

  • modify unhide list and notify host kernel

# cat >> /usr/lib/util-vserver/defaults/vprocunhide-files
/proc/mtrr
/proc/bus/

# /usr/lib/util-vserver/vprocunhide

  • add capabilities to access devices for X11

# cat > etc/vservers/ltsp1/bcapabilities
CAP_IPC_LOCK
CAP_IPC_OWNER
CAP_SYS_RAWIO
CAP_SYS_ADMIN
CAP_NET_ADMIN
CAP_NET_RAW
CAP_MKNOD

  • start vserver

# vserver ltsp1 start
RTNETLINK answers: File exists
ipv4root is now 10.0.0.76
New security context is 49166
 * Starting LTSP client...
   ...done
# vserver ltsp1 enter
root@ltsp1:/#

  • configure X11, fill in devices from "lspci -X", modify xorg.conf if necessary

# dpkg-reconfigure xserver-xorg

  • create VT, one for each seat

# mknod dev/tty6 c 4 6

  • for X devices that are missing dev nodes create them, probably should rebind dev from udev root for usb?

# mkdir dev/input
# mknod dev/input/mice c 13 63
# mknod dev/mem c 1 1
# chgrp kmem dev/mem
# chmod o-r dev/mem

  • start X directly to test

# X -query 10.0.0.72 -xf86config /etc/X11/xorg.conf -novtswitch -sharevts vt6

smile

And it actually works (!) Albeit this is GDM on the server if XDMCP enabled, not LDM/SSH as LTSP uses. This means a lot of integration work is necessary to update all the scripts to get this working cleanly. I'm using VMWare which only has one monitor but presumably two will work, the problem is configuration of a real system:

  • vserver isn't using DHCP its a static IP address. You could use a private LAN between the host and each seat using iptables as a NAT router but this will make remote connections rather difficult (?) DHCP on a split interface is asking for problems as to updating the vserver's address (eth0:1, eth0:2, etc). So you would have to pre-define a pool of dynamic addresses for the vserver host and map to a range of static IP addresses for each seat frown On the Vserver mailing list there has been discussion about DHCP in a vserver guest and it is possible but will require giving extra capabilities to the guest, not much of a problem really. It should be possible to use the Xen approach and bridge the hosts DHCP address with a virtual NIC per vserver guest seat but you have to generate a unique MAC address for each seat. Effectively this means some form of DHCP management of MAC addresses is necessary for the seats (!)
  • Managing client images, ideally only one image is required and LTSP handles the changes necessary for each vserver seat (re: vcopy).
  • Device assignment, packages from Userful/Groovix recommend plugging keyboard, mouse, audio into a USB hub for each seat. Display a prompt on each screen to press a number unique to each and the system can then determine the USB hub and all the other devices. Alternatively administration overhead increases by having to manually determine which device and statically assign in a bigger lts.conf.


REFERENCE: To install regular Ubuntu vserver:

# newvserver -v --hostname ltsp2 --domain cn.yorkion.com --ip 10.0.0.76

Starting this server shows the regular startup output:

# vserver ltsp2 start
 * Starting system log...
   ...done.
 * Running local boot scripts (/etc/rc.local)
   ...done.
# vserver ltsp2 enter
root@ltsp2:/#


References

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback