From the rdesktop homepage, "rdesktop is an open source client for Windows NT Terminal Server and Windows 2000/2003 Terminal Services, capable of natively speaking Remote Desktop Protocol (RDP) in order to present the user's NT desktop".

rdesktop was initially written by Matthew Chapman and is released under the GNU Public Licence (GPL). With the release of rdesktop 1.5.0, a feature known as seamlessrdp was contributed by Cendio allowing rdesktop to run individual applications rather than a full desktop.

Fontis has been working on a number of patches to the seamlessrdp feature, adding support for rdesktop session connection-sharing, icon support, improved handling of always-on-top windows and more.

Contents

  1. Overview
  2. Announcements
  3. Screenshots
  4. Installation
  5. Usage
  6. Feedback

Overview

The patch currently adds the following features:
  • Connection sharing - allows a single rdesktop connection to launch multiple applications. When run in seamless mode, rdesktop creates and listens on a control socket. A new option allows rdesktop to be run in slave mode, which notifies the master rdesktop instance of a new command to be run and then exits. The master instance sends a client-to-server message to the SeamlessRDP server component, which runs the new command.
  • Icon support - SeamlessRDP X windows have the same icon as their Windows counterparts, instead of the default X icon. When a new window is created on the server, the server component sends a 16x16 icon back to the client via a server-to-client message. This feature has since been implemented in the current CVS version of rdesktop. The new implementation is preferred, and so our previous icon support has been removed. -- 10/9/2007
  • Always-on-top windows - previously, if a window was always-on-top on the server, it wouldn't be on the client. It was possible to get into a situation where the client and server didn't agree on what window was topmost, which led to some unusual effects (ie a window appearing to slide 'under' the side of another window). Windows that are always-on-top on the server (WS_EX_TOPMOST flag set) now have the _NET_WM_STATE_ABOVE hint set, which should keep them on top on the client side as well. Our patch for this issue has been accepted into rdesktop CVS. -- 7/3/2008
  • Tooltips - some applications had issues with tooltips, such as causing their parent window to lose focus while they were displayed. The server component now attempts to tell when a window is a tooltip so that the client can treat the window correctly. This issue has since been fixed in the latest rdesktop CVS version, so it's been removed from this patch. -- 7/3/2008
  • Closing windows - instead of ending the whole rdesktop process when one client-side window is closed, a client-to-server message is sent to tell the server to close the corresponding server-side window. Our patch for this issue has been accepted into rdesktop CVS. -- 11/3/2008

Announcements

Announcements regarding the patch are made on the rdesktop-devel mailing list:

Screenshots

Installation

  1. Download the source for the latest version of rdesktop from CVS (press enter when prompted for a password):
    $ cvs -d:pserver:anonymous@rdesktop.cvs.sourceforge.net:/cvsroot/rdesktop login
    $ cvs -z3 -d:pserver:anonymous@rdesktop.cvs.sourceforge.net:/cvsroot/rdesktop co -P rdesktop
    As of 16 July 2010, these patches do apply cleanly against the current CVS version of rdesktop. However, if you have any problems applying the patch in the next step, download and unpack this older rdesktop CVS snapshot which has been tested with the patch:
    $ wget http://www.fontis.com.au/files/rdesktop_src.tar.gz
    $ tar xzvf rdesktop_src.tar.gz
  2. Download the rdesktop patch:
    $ wget http://www.fontis.com.au/files/rdesktop.patch
  3. Apply the patch and compile:
    $ patch -p1 < rdesktop.patch
    $ cd rdesktop
    $ ./bootstrap
    $ ./configure
    $ make
  4. Download updated server component and unpack. Alternatively, obtain the seamlessrdp CVS snapshot or download direct from CVS, apply the seamlessrdp patch and then compile:
    $ cvs -z3 -d:pserver:anonymous@rdesktop.cvs.sourceforge.net:/cvsroot/rdesktop co -P seamlessrdp
    $ wget http://www.fontis.com.au/files/seamlessrdp.patch
    $ patch -p1 < seamlessrdp.patch

Usage

The following examples assume the SeamlessRDP server component files (seamlessrdpshell.exe, seamlessrdp.dll and vchannel.dll) have been unpacked to C:\seamlessrdp\.
  • To start a SeamlessRDP session, invoke rdesktop in the same way as before applying the patch:
    ./rdesktop -A -s "C:\seamlessrdp\seamlessrdpshell.exe notepad" server
  • To run a new command inside the existing SeamlessRDP session:
    ./rdesktop -l "calc"
  • New command-line options:
    • -M: Specify the path for the control socket that the rdesktop process listens on. By default, this is $HOME/.rdesktop/seamless.socket
    • -l: Instead of starting a new rdesktop process, connect to an existing process' control socket and tell it to run a command on the server. Can be combined with the -M option to use a non-standard socket.
Running multiple applications from shortcuts can be difficult at present, since there may be no way of knowing which should be invoked first as master and which as slave commands. A possible workaround is to call rdesktop through a wrapper script which tests whether it should run as master or slave. The following perl script is an example:
#!/usr/bin/perl
 
my $bin = '/usr/local/bin/rdesktop';
my $host = 'w.x.y.z';
my $socket = "$ENV{'HOME'}/.rdesktop/seamless.socket";
my $shell = 'C:\seamlessrdp\seamlessrdpshell.exe';
 
if (@ARGV != 1) {
    print "usage: rdesktop-wrapper <command>\n";
    exit;
}
 
# if socket and master session exist,
# launch command in slave mode
$numprocs = `pgrep -U $ENV{'USER'} -x rdesktop | wc -l`;
if (-e $socket and ($numprocs == 1)) {
    exec($bin, '-M', $socket, '-l', $ARGV[0]);
# otherwise, start new master mode
# only if no other sessions running
} elsif ($numprocs == 0) {
    exec ($bin, '-A', '-s', $shell . " $ARGV[0]", $host);
}

Feedback

Please direct any feedback through our contact page or through the rdesktop-devel mailing list which we are subscribed to.