Windows Terminal Server Thin Clients w/ LTSP v5 on Ubuntu Feisty

Posted by ryan on Mon, 07/16/2007 - 10:37 in

Overview:
The clients PXE boot to the LTSP v5 server which auto-launches the Remote Desktop (rdesktop) client that auto-connects to a Windows 2003 terminal server. The result is you can take a bunch of end-of-life P2 or P3 computers, remove their hard-drives, boot them from the network and give them new life.

 

Assumptions:
- You have a properly configured Windows terminal server.
- You have an operational DHCP server which you can add scope options to.
- Your thin clients can PXE boot.
- You have a machine (or VM) you can install Ubuntu Feisty server on.

 

Caveats:
- Audio works but the user has no volume control in the rdesktop session, so they'll need their own volume knob on their headphones or speakers.
- Some audio chipsets may require special options in lts.conf (i810 works great).

 

Steps:

1) Install Ubuntu Feisty server (this is the LTSP server).

 

2) Install xubuntu-desktop:

apt-get install xubuntu-desktop

 

3) Install LTSP server:

apt-get install ltsp-server

 

4) Build the LTSP client (the following uses the local apt-cacher, if none then just do "ltsp-build-client"):

ltsp-build-client --mirror http://apt.cache.ip:3142/us.archive.ubuntu.com/ubuntu

 

5a) Setup rdesktop scripts:

/opt/ltsp/i386/etc/lts.conf

#
# LTSP v5 configuration file to work with Windows Terminal Server
#
# See: /usr/share/doc/ltsp-client/examples/lts-parameters.txt.gz for more options
#
[default]
        SOUND           = True
        LOCALDEV        = True
        NBD_SWAP        = True
        SYSLOG          = server
        SOUND_DAEMON    = rdp

    DNS_SERVER      = dns.server.ip
    SEARCH_DOMAIN   = dns.search.domain

    # rdesktop options
    RDP_SERVER      = w2k3.terminal.server.ip
    RDP_OPTIONS     = "-a 16 -x l -r sound:local"
    SCREEN_02       = rdesktop

 

/opt/ltsp/i386/usr/lib/ltsp/screen.d/rdesktop

#!/bin/sh
#
# The following script works for LTSP v5 and was tested in Ubuntu "Feisty" Linux.
# Original rdesktop script by James A. McQuillan,
# modified for LTSP v5 by Colin Osterhout of SERRC (www.serrc.org).
#
# This software is licensed under the Gnu General Public License.
# The full text of which can be found at http://www.LTSP.org/license.txt
#
#
#
#
/opt/ltsp/i386/etc/screen.d/rdesktop
#
# Call this through /opt/ltsp/i386/etc/lts.conf like this:
#           RDP_OPTIONS  = "-a 16"
#           RDP_SERVER   = w2k3.terminal.server.ip
#           SCREEN_02    = rdesktop
#

PATH=/bin:$PATH; export PATH
. /usr/lib/ltsp/ltsp_functions
 
# Get the lts.conf entries
eval `/usr/bin/getltscfg -a`

RDP_OPTIONS=${RDP_OPTIONS:-"-f"}

reg_info RDP_SERVER
reg_info RDP_OPTIONS

TTY=`/usr/bin/basename \`/usr/bin/tty\``
XFCFG=/tmp/XF86Config.${TTY}
export TTY

RDESKTOP_OPTIONS="${RDP_OPTIONS} -f $* ${RDP_SERVER}"

#
# Setup the DISP variable
#
TTY_N=`echo $TTY | sed -e 's/^.*\([0-9]\)$/\1/'`
export DISP=:$(expr ${TTY_N} - 1).0

################################################################################
#
# Setup the XF86Config file
#
while :; do
/usr/bin/xinit      /usr/bin/rdesktop           \
                            -u "" \
                          ${RDESKTOP_OPTIONS}         \
                          -- \
                          ${DISP}                     \
                          ${TTY}
#/usr/bin/x11vnc -display ${DISP} -passwd password -httpport 5800

done

 

5b) Make the script executable:

chmod a+x /opt/ltsp/i386/usr/lib/ltsp/screen.d/rdesktop

 

6) Install rdesktop in the chroot:

chroot /opt/ltsp/i386
apt-get install rdesktop
exit

 

7) Configure the DHCP server to have the following scope options:

017 Root Path: "/opt/ltsp/i386"
066 Boot Server Host Name: "ltsp.server.ip"
067 Bootfile Name: "ltsp/i386/pxelinux.0"

 

8) Configure the client to PXE boot. It should come up with a login screen to your terminal server.

 

* Left to do: cdrom, usb drives.

** Credit for rigging the above scripts to work should go to CTO, and also thanks to #ltsp especially Gadi and sbalneav.

What would make the USB devices so much easier (if I understand

What would make the USB devices so much easier (if I understand the architecture correctly) would be if there existed a FUSE driver in Windows. Currently I've been using the "rdesktop -r disk:/var/run/drives", a "/lib/udev/" script, and an entry in the "/etc/udev/rules.d/88-ltsp" script to mount a USB block device when inserted. But as always, unmounting becomes a problem. I'm thinking a simple ssh command might work if you had a static key exchange between the Windows Terminal Server and the clients, and an icon on the desktop that said "Safely remove devices". This would open up a security hole however, other users would be able to arbitrarily run commands on the remote device (or at the very least arbitrarily unmount devices).

If it just handled things like the LTSP FUSE implementation things would be a lot easier.

colin's picture
Posted by colin on Fri, 07/20/2007 - 10:26
And I should also add, if we just used a Linux desktop things wo

And I should also add, if we just used a Linux desktop things would be a whole lot easier.

colin's picture
Posted by colin on Fri, 07/20/2007 - 10:27
Post new comment
The content of this field is kept private and will not be shown publicly.