I am using the program "SoftXPand 2011 Duo" by Miniframe on my Windows 7 PC. It makes two workstations out of one computer. It uses the terminal services built into Windows to create the additional session. I use two screens, two keyboards and two mice to create this "illusion" of two computers. It works quite well and I can even play two different 3D games on the two screens attached to this single machine (using a Radeon HD5770 and a Core i5 2500k with 8 Gbytes RAM).

There are a few downsides to this. I just found about one that is hidden on the first look. The sessions you are in (even on the first workstation) will identify as a terminal server session! Now some programs will run with limited effects (graphical), and some won't run at all.

This also resulted in some games not running at all. They just say "Cannot be run in a terminal server session" and exit. I have already proven that top modern games (DirectX 10, 11) run just as good as on the same machine without SoftXPand, so this is a pretty artificial limitation!

So, can I somehow hack my current session so it doesn't look like a terminal server session anymore? I. E.

#include <windows.h>
#pragma comment(lib, "user32.lib")

BOOL IsRemoteSession(void)
{
   return GetSystemMetrics( SM_REMOTESESSION );
}

Will return FALSE? (Not a programming question! Just an example how programs detect if they're in a terminal server session!)

  • Do you have two keyboards/screens ? Please elaborate some more on your setup. – harrymc Jun 27 '11 at 7:57
  • @harrymc Yes, I do. Editing. – sinni800 Jun 27 '11 at 15:18
  • The reason apps refuse to run on a terminal server, even when you are using the console session, is because of licensing reasons - so that one licence cannot be used by more than one person at the same time. – paradroid Jul 12 '11 at 12:38
up vote 5 down vote accepted
+100

This is Miniframe, the developers of SoftXpand Duo. We suggest looking at our Knowledgebase for a recommendation on how to resolve the error with running SoftXpand Duo in a Terminal Server session:

How to resolve the error "Cannot be run in a terminal server session"

  • The link does not work - miniframe.com/component/kb/article/… this one works, though! Can I enter multiple programs by using a semicolon (;)? Also, here, have your first 125 reputation on SuperUser! :) I have also sent an e-mail for this issue, I am d*is@eot.de – sinni800 Jul 4 '11 at 15:54
  • that link also doesn't work – bradgonesurfing May 10 '17 at 10:27

There are several ways for an application to check whether it is running in a Terminal Server session. Some of them you might hack, as below :

  1. Registry : HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\TSAppCompat.
    This key is missing in a normal session on my desktop.
    You might try to delete it, if you can.
  2. SESSIONNAME environment variable values : Console / "RDP#" / (empty).
    You may try to run your game from the Command Prompt (cmd) after doing
    SET SESSIONNAME=Console (my desktop value) or SET SESSIONNAME= (empty).
    To find out its current value, enter SET SESSIONNAME before changing anything.
  3. The system calls GetSystemMetrics(SM_REMOTESESSION) and GetVersionEx (OSVERSIONINFOEX.wSuiteMask) return the execution context.
    Not much you can do against this one, except writing a system-hook for it.
    If interested see this codeproject.com article : API hooking revealed.
  • On 2), the session name is "console" (What the heck?). The key TSAppCompat is missing here, too. About the third... Looks hard to do. Isn't there a program that sits on top of another program and intercepts system calls like the one I mentioned? GetSystemMetrics. – sinni800 Jun 27 '11 at 19:58
  • According to your info, probably the 3rd method is the one worth attacking for GetVersionEx and GetSystemMetrics. I have added a link above (to be used by a programmer). – harrymc Jun 29 '11 at 7:37
  • Another note : If there a way to use MSTSC /admin in SoftXPand, this is worth a try. – harrymc Jun 29 '11 at 7:49
  • @harrymc why MSTSC /admin? I will look into the api hooking... It might be too complex for my programming abilities though. – sinni800 Jun 29 '11 at 13:16
  • "MSTSC /admin" is a rather long shot : it is a somewhat different remote session type, so maybe some programs may not detect it. – harrymc Jun 29 '11 at 13:44

I found a solution: running the programs you want by "runas"

After you log in via desktop, type that in cmd:

runas /user:YOUR_NAME "YOUR_PROGRAM_PATH"

I tested it against Bently's softwares and they do work well.

  • This circumvents the terminal server issue? Interesting, I have to try. – sinni800 Jun 17 '14 at 9:00
  • Does not work with mass effect 3 (This program cannot be run remotely) – Mgamerz Sep 5 '16 at 16:31

I'm using Microsoft Remote Desktop and I've tried the first 2 methods posted by @harrymc, but they don't work in my case. The third is too complicated for me so I've not given it a try.

In the end, I found that Parallel Access enables me to use the program that was showing the error. It's not as smooth as RDP, so I use it if I really have to use the program.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.