Improving my Remote Desktop Experience

I’ve been traveling quite a bit lately and I’ve found it particularly convenient to simply remote into my machine at the office and do all my work through Terminal Services (or are we supposed to be calling it Remote Desktop Services now?). This allows me to access the virtual machines and the servers located at the office without major latency. If you’ve ever tried using VMware Server Console through a VPN connection, you know what I’m talking about.

I always listen to music when working. At work, that’s not a problem since I’ve got all my music stored on my work computer. However, when on the road all my music is stored on my laptop. This becomes a problem since my laptop’s music player cannot be accessed without first minimizing the fullscreen remote desktop window.

Actually, there are two problems here:

  1. There is no keyboard shortcut for minimizing a fullscreen remote desktop session. You have to use the mouse cursor and click on the minimize button on the “banner” at the top.
  2. The media keys (play, pause, stop, etc.) that are present on so many laptops today are forwarded to the remote computer rather than to the music player on the local computer.

These problems become a real nuisance after a while when working primarily in a fullscreen remote desktop window, and so I decided to investigate if these problems could be addressed.

Terminal Services allow you to register add-ons that are loaded by mstsc.exe when you connect to a remote desktop server. Through a mechanism called virtual channels, the server- and client-side of the remote desktop connection can communicate with each other.

This mechanism is perfect for addressing the problems I identified above. For instance, when a hotkey is pressed in a fullscreen remote desktop session, the server requests that the client minimizes the remote desktop window, and when a media key is pressed it’s forwarded to the client, which injects the key press on the client computer such that it’s routed to e.g. the local music player without requiring the user to minimize the remote desktop window.

The add-on consists of three components described below. The client- and server-side components must be explicitly registered with Terminal Services at the client and server computers, respectively. You must be running with Administrator privileges when registering them.

Server-side component:

This component is responsible for intercepting the user input and forwarding it to the client computer. It does so by registering several hotkeys.

To register this component with Terminal Services, run the following command from Start->Run:

<path to component>\RdpServerControl.exe install

To unregister this component with Terminal Services, run the following command from Start->Run:

<path to component>\RdpServerControl.exe uninstall

The server-side component must be launched every time a new remote desktop session is initiated. You can do this manually by simply running the executable when you’ve connected to the server, or by having it start automatically when a user logs on. The component exits automatically when the user disconnects from the Terminal Services session.

Client-side component:

This component is responsible for executing the commands requested by the server-side component.

To register this component with Terminal Services, run the following command from Start->Run:

regsvr32 <path to component>\RdpClientControl.dll

To unregister this component with Terminal Services, run the following command from Start->Run:

regsvr32 /u <path to component>\RdpClientControl.dll

Configuration component:

This is just a small tool for configuring the server-side component. For instance, you can specify the keyboard shortcut for minimizing the fullscreen remote desktop window. It’s not required for using the add-on, which uses the default settings described below.

This component must be run on the server.

The default configuration is as follows:

  • Alt+F1: Minimize fullscreen remote desktop window.
  • Media keys are being forwarded by default.

If you’d like to try out the add-on for yourself, you can get it here: x86 or x64. It requires the Visual C++ 2008 SP1 redistributable: x86 or x64.

Disclaimer: Please note that it’s a very simple tool that was created for a very specific purpose, and the feature set is thereafter. If you experience any problems, drop me a line and I’d be more than happy to help you get it to work.


About this entry