Page 1 of 2

DOS program won't run in MSDOS window in Windows XP guest

Posted: 10. Jan 2010, 10:28
by witwald
Hi,

I have installed Windows XP (x86) as a guest operating system under VirtualBox 3.1.2 running on Windows 7 x64. It appears to be working quite well, and the Guest Additions have also been successfully installed. The networking is operational, and I have successfully shared a folder for access by the Windows XP guest.

The problem that I'm having is as follows. When I try to run a 16-bit DOS application (called CALSOD) in an MSDOS window under Windows XP, CALSOD will not run. The following error message is shown:

Cannot execute Z:\CALSOD.EXE

Under normal circumstances, CALSOD starts up in text mode. When some calculations have been performed, the program would be controlled by the user to generate some plots. This would initialise a VGA-compatible graphics mode in order to draw those plots on the screen. Note that CALSOD is written in the now very dated Borland Pascal 7.0, and utilises the standard CRT and GRAPHICS units. It used to work fine under Windows 3.1, Windows 95 and Windows 98, as well as Windows XP. However, now it won't work at all.

Does anyone have any suggestions as to how I might get CALSOD working in the Windows XP guest?

I'd prefer to be able to use a Virtual Machine for running CALSOD under, instead of having to use a dual-boot scenario (i.e. WIndows 7 and Windows XP). Hence, it would be great if this problem could somehow be solved.

If there's some fundamental issue that will prevent CALSOD from running in an MSDOS window in the Windows XP guest, then that would also be handy to know. That way I needn't spend more effort trying different things when chasing down a non-existent solution.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 10. Jan 2010, 10:35
by MarkCranness
Perhaps create a shortcut for CALSOD (you can do that from Windows Explorer by selecting it and Right-click>Send to...>Desktop (create shortcut)), and then edit the shortcut Compatibilites (Right-click the shortcut>Compatibility tab) and experiment with the options there.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 10. Jan 2010, 11:23
by witwald
I've just now gone and created a shortcut to CALSOD. However, the options under the Compatibility tab are all grayed out, so I can't try them.

I did run the Compatibility Wizard on the CALSOD.EXE file. I set it to use Windows 95 compatibility, 256 colors and 640x480 graphics. But all to no avail. CALSOD still wouldn't run.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 10. Jan 2010, 11:40
by mpack
Why not try a FreeDOS VM instead?

Incidentally, the pedant in me cannot let this one pass: XP does not have an MSDOS window. It has a "Command prompt" window which may look quite similar to a DOS prompt, but this is in fact a 32bit application. This is in contrast to Win9x, which really did have a 16bit virtual MSDOS shell.

That said, XP is capable of running 16bit DOS applications, so I don't know why your app doesn't run. It could be a VBox issue.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 10. Jan 2010, 12:22
by witwald
Why not try a FreeDOS VM instead?
I did try an MSDOS 6.22 VM, which did work. However, getting access to all my files on the Windows disk drive doesn't seem possible, other than copying them across.
Incidentally, the pedant in me cannot let this one pass: XP does not have an MSDOS window. It has a "Command prompt" window which may look quite similar to a DOS prompt, but this is in fact a 32bit application. This is in contrast to Win9x, which really did have a 16bit virtual MSDOS shell.
I take your point that XP's Command Prompt is a 32-bit application. And CALSOD always worked quite happily under Windows 3.1/95/98.
That said, XP is capable of running 16bit DOS applications, so I don't know why your app doesn't run. It could be a VBox issue.
Yes, in the past XP quite happily ran the CALSOD 16-bit DOS application. It even worked as an extended-memory version, that allowed access to 16 MB of RAM, which, in it's day, was a sizeable jump up from the standard 640 KB.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 10. Jan 2010, 12:59
by mpack
witwald wrote:I did try an MSDOS 6.22 VM, which did work. However, getting access to all my files on the Windows disk drive doesn't seem possible, other than copying them across.
You may find that networking support in FreeDOS exists to more modern standards. If so (and I think it is), you may be able to set up a network shared folder, which would ease the task of copying data into and out of the VM. I believe there's a discussion of this the "Other Guests" forum.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 10. Jan 2010, 13:13
by witwald
Thanks. I'll look into FreeDOS in the Other Guests forum.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 10. Jan 2010, 20:07
by ghr
DOS filesharing is explained here: http://forums.virtualbox.org/viewtopic.php?f=4&t=865. For running (old) DOS software under XP: 'sometimes' the path to the directory where the executable is found must adhere to old DOS standards: no spaces (blanks), not more than 8 characters - you might just check (or change) that.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 11. Jan 2010, 10:03
by witwald
ghr wrote:For running (old) DOS software under XP: 'sometimes' the path to the directory where the executable is found must adhere to old DOS standards: no spaces (blanks), not more than 8 characters - you might just check (or change) that.
Thank you very much for that tip. I placed the CALSOD.EXE file in a folder where the (shared) path was simply Z:\CALSOD, and CALSOD started up OK!

And also a thank you to the others who have responded to this thread.

However, unfortunately, another problem surfaced. I was unable to get directory listings of a subdirectory. A text-mode window that normally works and provides a list of files that can one can select a file from, opened but stated "No files!" -- not quite what I expected. The subdirectory name consists of a DOS compatible name ("DATAFILE"), so once again I don't understand what's going on here. There was also a funny cursor problem in text mode, where the underline "_" cursor character was inverted. Also, when using the system-rpvided EDIT program, the mouse pointer was displaced from the actual text-mode pointer.

It seems that this Windows XP guest under VirtualBox isn't quite the same as running WIndows XP natively on the hardware of my dual-boot system. It also seems that, for running DOS applications, I should maybe stick to using DOSBox, which gives me access to the subfolders with 8.3 filenames, even though some of them have long file names. Not ideal, because of the high CPU usage, but it appears that that is a feature of the DOS architecture when run under a modern operating system.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 11. Jan 2010, 19:18
by mpack
witwald wrote:However, unfortunately, another problem surfaced. I was unable to get directory listings of a subdirectory.
The only thing that jumps out at me as unusual in that scenario is the drive letter. Have you tried running from a folder on the C drive? Obviously this isn't a solution, I'm just suggesting it as a useful experiment. Perhaps your software has problems with network drives. If so then all is not lost, because you can put a network shared folder inside the guest as easily as you can put it on the host - but inside the guest your software could access it directly.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 12. Jan 2010, 09:19
by witwald
mpack wrote:
witwald wrote:However, unfortunately, another problem surfaced. I was unable to get directory listings of a subdirectory.
The only thing that jumps out at me as unusual in that scenario is the drive letter. Have you tried running from a folder on the C drive?
I've just finished copying the entire CALSOD folder to the (virtual) C: drive. Lo and behold, the directory listing function now works in the expected manner! Thanks for the suggestion. :)
Perhaps your software has problems with network drives.
It's not really a "network aware" application as such. It just uses the standard Borland Pascal functions/procedures for obtaining folder listings by scanning a directory (using the FindFirst and FindNext functions, amongst others). These work fine under DOS as well as native Windows XP.

I don't know why a shared folder on my physical D: drive that is mapped to the Z: drive letter in the XP virtual machine would not be seen as anything but a "physical" Z: drive. I'd be interested to know what's going on here.
If so then all is not lost, because you can put a network shared folder inside the guest as easily as you can put it on the host - but inside the guest your software could access it directly.
How do I do that? I thought that by mapping the physical D:\Users\Username folder to the Z: drive, through using the VirtualBox Shared Folder mechanism, I was already putting the network shared folder (e.g. \\Vboxsvr\Foldername) inside my Windows XP guest.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 12. Jan 2010, 12:26
by mpack
witwald wrote:I've just finished copying the entire CALSOD folder to the (virtual) C: drive. Lo and behold, the directory listing function now works in the expected manner! Thanks for the suggestion. :)
Good, at least now you only have the problem of file exchange with the host to deal with.
witwald wrote:I don't know why a shared folder on my physical D: drive that is mapped to the Z: drive letter in the XP virtual machine would not be seen as anything but a "physical" Z: drive.
In truth, nor do I, but it doesn't surprise me that it doesn't work. Perhaps the network drive redirection is only done for 32bit apps.
witwald wrote:
If so then all is not lost, because you can put a network shared folder inside the guest as easily as you can put it on the host - but inside the guest your software could access it directly.
How do I do that? I thought that by mapping the physical D:\Users\Username folder to the Z: drive, through using the VirtualBox Shared Folder mechanism, I was already putting the network shared folder (e.g. \\Vboxsvr\Foldername) inside my Windows XP guest.
I meant "network shared folders", not VirtualBox Guest Additions shared folders. The latter can only access share folders on the host, and performance isn't as good as a real share.

Sharing a folder in XP is usually quite simple. First you need to be using either "Host-Only" or "Bridged" network mode to talk to the host. You need to make sure that host and guest belong to the same workgroup, usually "WORKGROUP". In the XP guest you will find this in My Computer, Properties, Computer Name tab, click the button to "Change the computer name or join a domain". You will have to find out what the equivalent is on your Win7 x64 host. All that done, just right click on a guest folder that you want to share, select "Sharing" tab, and choose the "Share this folder" option. You will need to give the folder a sharing name for network identification purposes, this name should be a short and simple one with no spaces or funny characters - eg. "Shared". I've had problems if I capitalized any letter other than the first. When all that is done you should be able to browse into guest shared folders from the host (browse network neighbourhood), while the guest is running.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 13. Jan 2010, 11:01
by witwald
mpack wrote:I meant "network shared folders", not VirtualBox Guest Additions shared folders. The latter can only access share folders on the host, and performance isn't as good as a real share.
In my case, that's exactly what I want to do: access share folders on the host from the XP guest machine. Is there a way to accomplish just that using VirtualBox?

Just for the sake of completeness, I would just like to mention the following, in case it's of help to someone else in a similar predicament to me. In my hunt for a workable option, I tried an evaluation version of VMware Workstation 7.0. This was able to import a fresh uninitialised version of the Windows XP mode configuration (even though I had already used and configured a virtual machine of Windows XP Mode on my host). VMware Workstation correctly ran CALSOD, switching between text mode and fullscreen graphics mode, just the way that CALSOD does when run natively under Windows XP. Note tha I ran CALSOD from:

1) the C:\CALSOD folder on the guest;
2) the My Documents\CALSOD folder (whose full path is of course much longer) on the guest;
3) and also from a VMware shared folder on one of the physical disks on the host (my D: drive).

It's a bit disappointing that neither VirtualBox nor Windows XP Mode can accomplish the same thing, which too me doesn't seem to be too great an expectation to place on a virtual machine that aims to be able to run Windows XP as a guest on a Windows host.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 13. Jan 2010, 12:02
by mpack
witwald wrote:
mpack wrote:I meant "network shared folders", not VirtualBox Guest Additions shared folders. The latter can only access share folders on the host, and performance isn't as good as a real share.
In my case, that's exactly what I want to do: access share folders on the host from the XP guest machine. Is there a way to accomplish just that using VirtualBox?
Yes there is, in fact it's easy. But we've already established that your CALCSOD software can't access files over a network (and that's what it is, even with the GAs), therefore the files will have to be local to the VM, and in a network shared folder if you need the host to have access.

Re: DOS program won't run in MSDOS window in Windows XP guest

Posted: 13. Jan 2010, 13:31
by witwald
mpack wrote:
witwald wrote:In my case, that's exactly what I want to do: access share folders on the host from the XP guest machine. Is there a way to accomplish just that using VirtualBox?
Yes there is, in fact it's easy. But we've already established that your CALCSOD software can't access files over a network (and that's what it is, even with the GAs), therefore the files will have to be local to the VM, and in a network shared folder if you need the host to have access.
I understand what you're saying, and I can accept that that's the way it is. Just to clarify, though, CALSOD can't access files over the network in VirtualBox, but it can do so in virtual XP machines running under both VMware Player and Windows XP Mode.

In case it helps someone to know this, just today, I set up VMware Player to use the virtual machine provided by Microsoft for Windows XP Mode in Windows 7 (VMware Workstation has a feature that enables it to import the virtual machine associated with Windows XP Mode, and VMware Player may also have the same feature). And, to my pleasant surprise CALSOD ran just fine, switching correctly between text mode and fullscreen graphics mode, and displaying the correct plots in graphics mode. And that was by accessing, from the guest, the CALSOD.EXE file that is stored on the host, not on the guest.

As VMware Player enables me to use CALSOD just like I did under native Windows XP, I am somewhat perplexed by the fact that neither Windows XP Mode nor VirtualBox can do the same.