Chapter 12.  Accessing Client Resources from the Terminal Server

Table of Contents

12.1. Accessing the Clients Local Drives
12.1.1. Introduction
12.1.2. Requirements
12.1.3. Mounting and Unmounting Local Drives
12.1.4. Accessing local drives from Windows Terminal Servers
12.1.5. Mounting Drives at Login
12.1.6. Limitations and additional information
12.2. Using Serial Port redirection
12.2.1. Introduction
12.2.2. Requirements
12.2.3. Enabling Serial Port Redirection
12.2.4. Accessing the redirected port from applications
12.2.5. Limitations and additional information
12.3. Using Sound Device Redirection
12.3.1. Introduction
12.3.2. Requirements
12.3.3. Using sound redirection with UNIX applications
12.3.4. Using sound redirection with Windows Terminal Servers
12.3.5. Using sound redirection with Crossover
12.3.6. Limitations and additional information
12.4. Using Smart Card Redirection
12.4.1. Introduction
12.4.2. Requirements
12.4.3. Enabling Smart Card Redirection
12.4.4. Limitations and additional information

In this chapter we will describe how to access client resources, such as local drives and serial ports, from the Terminal Server.

12.1.  Accessing the Clients Local Drives

12.1.1.  Introduction

Starting with ThinLinc version 1.3.0, it is possible to access the clients drives and filesystems from the terminal servers. With thin terminals, one might want to access a local floppy or CD-ROM drive. When running the client on a workstation, applications on the terminal server can access all filesystems mounted at the workstation, just like local applications can.

Note

Many Digital Cameras can be accessed as a USB storage device, and can be exported as a local drive.

12.1.2.  Requirements

  • The ThinLinc UNIX client, version 1.3.0 or newer. Local drive redirection for the Windows client was introduced in version 1.6.0. The client must be configured for exporting local drives.

  • The Linux kernel on the terminal server must have NFS version 3 (over TCP) client support.

12.1.3.  Mounting and Unmounting Local Drives

The exported local drives can be mounted with the command tl-mount-localdrives . The drives will be mounted below $TLSESSIONDATA/drives. A symbolic link called "thindrives" will be created in the user's home directory, pointing to this directory. The syntax for tl-mount-localdrives is:

tl-mount-localdrives [-h] [-v]

The -v option causes the tool to be executed in verbose mode, while -h shows the syntax.

The Hiveconf parameter /utils/tl-mount-localdrives/mount_args specifies the mount arguments. This Hiveconf parameter is normally found in /opt/thinlinc/etc/conf.d/tl-mount-localdrives.hconf. The options mountport, port, mountvers, nfsvers, nolock, and tcp will always be used.

Mounted local drives can be unmounted with the command tl-umount-localdrives .If some applications are using a mount at this time, they can continue to access the mount, even though the mount has been removed from the filesystem hierarchy (so called "lazy" umount). The syntax for tl-umount-localdrives is:

tl-umount-localdrives [-a] [-s] [-l]

If -a is specified, then all mounted local drives, for all users on this machine, will be unmounted. If -s is specified, then all mounted local drives, for all sessions belonging to the current user, will be unmounted. If -l is specified, the thindrives link will not be updated.

Note

When using multiple sessions per user, the thindrives link will point to the newest session that executed tl-mount-localdrives. tl-umount-localdrives will restore the link to the newest session which is not newer than the current session and which has mounted local drives.

12.1.4.  Accessing local drives from Windows Terminal Servers

When using Windows Server 2003 or newer, access to the Local Drives is possible via RDP. In this case, no configuration is required; sessions started with tl-run-rdesktop (and associated commands) will automatically have the local drives redirected.

Note

Due to what seems to be a limitation in the RDP protocol, local drives with names longer than seven characters will be displayed using only the first seven characters on the Windows Terminal Server.

Local Drives can also be accessed from Citrix ICA servers. In this case, the Citrix ICA client must be configured to export the desired "thindrives" directories.

12.1.5.  Mounting Drives at Login

Often, it's convenient to automatically mount all local drives for a user when the session starts. This can be accomplished by adding a symbolic link to /opt/thinlinc/etc/xstartup.d, pointing at /opt/thinlinc/bin/tl-mount-localdrives:

# ln -s /opt/thinlinc/bin/tl-mount-localdrives
/opt/thinlinc/etc/xstartup.d

In this case, you should also add a link to tl-umount-localdrives :

# ln -s /opt/thinlinc/bin/tl-umount-localdrives /opt/thinlinc/etc/xlogout.d

Starting with ThinLinc 2.0.0, the links in xstartup.d and xlogout.d for enabling local drives are present by default after installation. To disable local drive redirection, remove the links.

12.1.6.  Limitations and additional information

  • Some kernels have a limit on how many NFS mounts are possible. On most Linux 2.4 systems, the limit is around 250. With some kernels (Red Hat Linux kernels, for example), the limit is around 800. To prevent reaching this limit, make sure to use an automounter for other NFS filesystems.

  • A mounted local drive, for example /var/opt/thinlinc/sessions/joe/47/drives/cdrom, is only usable during the lifetime of the ThinLinc session. If the user ends the session without unmounting and then starts a new session, the mount will not be usable even if the session number happens to be same. In this case, any attempts to access the mount will give the error message "Stale NFS file handle". To be able to use the local drive, the user needs to run tl-mount-localdrives .

  • The mounted local drive does not fully support POSIX semantics. The usual limitations of NFSv3 applies. Additionally, if the file is moved to another directory while a process has the file open, the process will get a "Stale NFS file handle" error on any subsequent file operation for that file.

  • Local files are uniquely identified by their inode number. Some file system implementations, such as the Linux 2.4 FAT implementation, do not provide persistant inode numbers. Inode numbers will change on each remount, which usually results in "Stale NFS file handle" errors.

  • To prevent users from mounting local drives at the terminal server, execute this command:

    # chmod u-s /opt/thinlinc/libexec/tl-mount-personal