Windows Server Hacks: Shadowing Remote Desktop Sessions
Pages: 1, 2
Connecting to the Console Session Directly
You can also connect directly to the console session on a terminal server from an XP client. To do this, open a command prompt on the XP client and type
mstsc -v:servername /f -console but before you do it, open Notepad on the terminal server's console and type something in it. The reason for doing this is that when you connect from the XP client to the console session of the terminal server, the interactive console on the server locks. Figure 3 shows a Remote Desktop session on an XP client connected to the console session on a Windows Server 2003 machine that has Remote Desktop enabled, again within a Virtual PC environment.
Shadowing the Console Session on Windows XP
Things work a little differently, however, in Windows XP, which has a scaled-down version of Terminal Services that only allows two (count them -- two) user sessions simultaneously. For example, say I have a box named XP194 on which I've enabled Remote Desktop using the Remote Desktop tab of System properties in Control Panel. I can then open a Remote Desktop session from XP191 to XP194 (doing so locks the console on XP194, but it does leave the console session running and any open applications running on it as well). If I try and open another Remote Desktop session to XP194, this time from XP192, my previous session initiated from XP191 is terminated. That's because Remote Desktop on XP only allows two user sessions -- in the case of Remote Desktop this is one remote session plus the console session -- at any one time.
(This is different, by the way, from how Remote Desktop works on Windows Server 2003. For example, if I enable Remote Desktop on a W2K3 box I can then open a Remote Desktop session from both XP191 and XP192 and still have access to the local console on the W2K3 box. But if I try and open a third connection from XP193, I get a message saying "The terminal server has exceeded the maximum number of allowed connections.")
Despite the limitations of Remote Desktop in XP, there is a cool hack that lets you actually shadow the console session on a Windows XP machine, and it works like this in my Virtual PC environment:
- First I open a Remote Desktop connection on XP191 to my Windows Server 2003 machine that has Remote Desktop enabled. This W2K3 machine will act as a kind of intermediary for our purposes.
- Now within the Remote Desktop session I just opened on XP191, I open a new Remote Desktop connection to my target machine XP194. The interactive console on the target machine now locks as expected.
- Next, from another XP box (XP192) I open a second Remote Desktop session with my Windows Server 2003 machine. There are now two remote sessions to my W2K3 box, one from XP191 and the other from XP192. In addition, within my remote session on XP191 I have remotely connected to XP194, my target machine.
- Finally, within the session opened on XP192, I start a command prompt and type
shadow 1to shadow the session opened in step 1 above. Then I switch over to XP192 and click Yes to the prompt saying "<Your credentials> is requesting to control your session remotely, Do you accept the request?"
To test the result, I tile my Virtual PC windows so I can see both XP191 and XP192 simultaneously. Then on XP192 I click the Start button and the Start menu immediately appears on XP191 as well (see Figure 4). But since my session on XP191 is actually the console on XP194 (connected through my W2K3 box), the result is that from XP192 I am shadowing the console session on XP191 (which is XP194). Pretty cool!
Return to the Windows DevCenter.