Multisession Workstations

 in
Press F1 for bash, F2 for Windows, F3 for Ubuntu, F4 for Mac OS and F5 for Citrix. Linux makes it all possible, and you don't even need a hard drive!
Installing Connection Tools

You need to set up your workstations to allow multiple remote sessions, connected to different servers and different OSes, each using the required specific connection protocol. LTSP includes only three types of connect scripts: shell, graphical Linux and Windows remote desktop. This is great, because out of the box, you are able to set up a shell session, a full diskless Linux client and a Windows remote desktop session.

LTSP lacks other interesting protocols, like VNC, NX and Citrix. For those, you'll need to install some tools and client applications.

Installing Additional Client Connection Tools

One of the features I like most about LTSP is that each time you update your ltsp-image, you actually “build” a small footprint distro. This means you can install packages, startup scripts or anything you want, into the LTSP image “distro”, and then simply update the image as needed. Don't confuse your “server” distro, with the LTSP image distro; they are completely different. Your server is mainly a building environment for the LTSP image, which is why images built from Ubuntu, look like Ubuntu. Images built on OpenSUSE, look and taste like OpenSUSE, and so on.

This hasn't always been the case though. In earlier releases, LTSP produced images that weren't related to the server distro. Earlier LTSP images were more like a distro of their own. Now, you can choose your server flavor and produce images of the same flavor. This allows you to keep using the distro you are familiar with on the server and on your thin clients.

Remember: things you install on your server are not installed onto your LTSP images. Within your server lives a mini-distro that is used to build the LTSP images. To access your building distro, you must chroot into it from your server. Simply type the following:

$ sudo chroot /opt/ltsp/i386

You are now working on your LTSP image distro root directory. This environment is what images will be built from. From here on, all you need to do to install software is type your standard distro shell commands. Let's try a small shell picture viewer as an example (this will be useful later):

$ apt-get install zgv

To exit from the chroot session and build the new image that now will contain the zgv command, do the following:

$ exit                    # to exit the chroot session
$ sudo ltsp-update-image  # to build the update image

After the image is built, reset your PXE boot client, press Ctrl-Alt-F1 to go to the shell session and check that zgv is available. In my setups, Ctrl-Alt-F1 always is a shell session, regardless of the settings in the lts.conf file.

Building the image is a time-consuming task, so you probably will want to wait until all needed packages are installed and built, and test once rather than multiple times.

For the objectives in this article, you will need to install a VNC client so you can connect to a Mac OS X session and the Citrix XenApp client.

Connecting to Mac OS X

First, set your MAC to allow incoming connections. Go to your Mac OS X server and open System Preferences. Under Internet and Network, click Sharing, then select the Screen Sharing check box. Next, click the Computer Settings button, check Anyone may request permission to control screen, and click VNCs viewer may control screen with password, and set a password. If you don't set this option, you will receive a “No matching security types” error each time you try to connect to your Mac OS X system (Figure 4).

Figure 4. Mac OS X Enable Remote Access

Now, back to the LTSP server. Install the VNC client and VNC server (I used xvnc4viewer, because it was available in the Ubuntu 9 repositories, but you may use any VNC client that is available for your distro):

$ sudo chroot /opt/ltsp/i386
$ apt-get install xvnc4viewer vnc4server

I know it doesn't make much sense to install a VNC server on your “client” image; however, you will need the vncpasswd command from it later.

Because your LTSP image and your main LTSP server are siblings, you are free to test software behavior on your server first. Bear in mind that they are closely related, but not identical twins. Just because the server is able to do something, doesn't ensure that the LTSP image also will be able to do it. However, if something doesn't work on your server, don't waste your time trying to make it work on the LTSP image either.

To test from your server, install xvnc4viewer directly on your server, and start a connection to your Mac. You must use the -FullColor option; if you don't, your MAC will not allow the connection:

$ xvnc4viewer -FullColor -FullScreen your.mac.ip.address

You will get a VNC authentication window asking for the password you set earlier on your Mac. Next, you should see a beautiful Aqua Mac OS desktop on top of your Linux screen!

This is great, but the password window doesn't work correctly on the LTSP image. Because you didn't load a window manager before the VNC viewer, the authentication window pops up with no mouse pointer visible, and you need to click on the box to start writing. So, let's avoid that problem. Go back to the chroot session for your LTSP image, and type vncpasswd. This will create the .vnc/passwd file, which you will use as a parameter to your xvnc4viewer command. Move the newly created file to /usr/share/ltsp/vnc-passwd.

Now, you need to create a screen script for this VNC session. Those scripts are in the /usr/share/ltsp/screen.d folder. Change directories to that folder, copy the rdesktop screen script and modify it to be a VNC script. Call this new script vnc1, and make it look like this:

#!/bin/sh

PATH=/bin:$PATH; export PATH
. /usr/share/ltsp/screen-x-common

VNC_OPTIONS=${VNC_OPTIONS:-"-FullScreen"}
VNCVIEWER_OPTIONS="${VNC_OPTIONS} -FullScreen $* ${VNC_SERVER}"

if [ -x /usr/share/ltsp/xinitrc ]; then
    xinitrc=/usr/share/ltsp/xinitrc
fi

xinit $xinitrc /usr/bin/xvnc4viewer ${VNCVIEWER_OPTIONS} \
               -- ${DISPLAY} vt${TTY} ${X_ARGS} -br >/dev/null

Now, exit your chroot session, and edit the /var/lib/tftpboot/ltsp/i386/lts.conf file. You should add two new parameters, and set your screen_04 to use your new script. It now should look something like this:

[default]
    VNC_OPTIONS  = "-FullColor -passwd /usr/share/ltsp/vnc-passwd"
    VNC_SERVER   = your.mac.ip.address
    ...
    SCREEN_04    = vnc1

Next, rebuild your LTSP image with the ltsp-update-image command, wait for the process to end and test it on your PXE boot client. Press Ctrl-Alt-F4, and you should see a Mac remote session.

Because the objective is thin-client corporate infrastructure, you most likely will want to have multiple connections to your Mac OS “server”. For this, there is Aqua Connect Terminal Server. Using it, you can connect several remote users to a single Mac OS X server (remember to double-check Apple's licensing terms).

______________________

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState