$theTitle=wp_title(" - ", false); if($theTitle != "") { ?>
About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like
Today I troubleshooted an old DOS application that needed to run on a 32 bit Citrix XenApp Server. The last time I saw an actual DOS application in a production environment must be years ago.
When starting the application, the WOW subsystem (NTVDM) crashed with the message: “NTVM encountered a hard error.”:
After spending some time troubleshooting I remembered a similar issue from a few years ago where a DOS application worked fine from the Console but refused to work from an RDP or ICA session.
And indeed the application works perfectly when run from the Console but not from a Console session. I noticed that the application switched to full screen mode after it was launched (even when I set it to Windowed mode) and presumably this is why ntvdm errors: full-screen mode is disallowed for DOS apps in RDP (and ICA) sessions as documented in Q192190.
I looked for a way to force the application to run in windowed mode but I was unable to find such a solution. So I decided to test the application in DOSBox, an x86 PC emulator.
And that worked perfectly, no changes were needed at all to make the application run.
As an added bonus, DOSBox takes care of typical issues with DOS applications running on Citrix XenApp such as keyboard polling and 100% cpu usage.
I was even more impressed that the application runs fine with DOSBox on my Windows 7 64 bit machine!
There is one thing I didn’t like though, DOSBox always shows a Splashscreen that fades in and out:
This is typically something that is not desirable on a XenApp (or RDS) environment because it causes many unnecessary screen updates. This may be a non issue on a fast LAN but on a slower WAN or high latency connection it may matter. Do how do we get rid of it?
There is no commandline argument or config setting that disables the splash so I figured that my only option would be to compile the DOSBox source and leave out the splash screen.
So I downloaded the source files from the sourceforge project page and launched Visual Studio 2010.
The Splashscreen is in sdlmain.cpp but I noticed this comment:
1 2 | /* Please leave the Splash screen stuff in working order in DOSBox. We spend a lot of time making DOSBox. */ |
This presented me with a dilemma: I really think the creators deserve their credit but at the same time I want to get rid of the splash.
So I decided to change the code in a way that the Splash screen is shown when run from the Console but not when run from an RDP or ICA session. This change was very easy, I surrounded the Splash screen code with a conditional statement:
1 2 3 4 5 6 | /* We will ignore the splashscreen when in a remote session */ if (!GetSystemMetrics(SM_REMOTESESSION)) { // Splash screen code } |
In order to compile the code with Visual Studio I followed the Building DOSBox with Visual C 2008 Express article from the Wiki.
Below you will find two downloads:
If you are going to use DOSBox I highly encourage you to make a donation to Support the DOSBox project.
A few other causes for the “NTVM encountered a hard error” message may be:
5 Responses for "NTVDM encountered a hard error"
Also take a look at http://support.microsoft.com/kb/890067
They recommend adding a registry key for MS-DOS app on Windows 2003.
@Jonathan: thanks for the KB, I verified that this fixed is present in SP2 but the registry key is not enabled by default.
Remko, I downloaded the modified version of DOSBox 0.74 you provided and attempted to use it on a computer running Windows XP Professional with Service Pack 1, but the application failed to start. Upon attempting to run dosbox.exe, an error is received with message:
“This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem.
I think this message occurs when necessary dependencies are not included.
Why do you believe the problem is happening?
The should be a “”” character after “the problem.” in my above post.
[…] https://www.remkoweijnen.nl/blog/2011/12/14/ntvdm-encountered-a-hard-error/ […]
Leave a reply