Some help with Printing to file from DOS VM to Host

Discussions about using non Windows and Linux guests such as FreeBSD, DOS, OS/2, OpenBSD, etc.
Post Reply
BMANN06
Posts: 4
Joined: 22. Dec 2020, 18:23

Some help with Printing to file from DOS VM to Host

Post by BMANN06 »

Hello All,

Very new to Virtual Box and need some help setting up a DOS VM to print to file on the Host (Windows 10 LTSC 1809). I've just migrated from Workstation Pro for some mouse issues (not an issue with Oracle, so thank you very much for alleviating that headache). We have about 40 steelbox DOS systems that run an HMI program that controls our plant. I have a couple of the DOS stations virtualized, this HMI Program has the ability to print all the alarms to a printer. However I'd like to print them to a file for historical access. Here is the script I'm attempting to run:

VBoxManage Modifyvm PIC37 --lpt1 0x378 7 - This works just fine, however I need to know how to setup the LPT1 to print to a "FILE" and then "File Location" (which is [HOST]C:\Alarms\K_Alarms.txt)

I've been able to run the command:

VBoxManage Modifyvm PIC37 --lptmode1 file (this executes ok, but i have no idea the syntax to point it to the host disk C:\Alarms\K_alarms.txt)

Can someone help me out?

Thanks in advance!!!

Brian
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Some help with Printing to file from DOS VM to Host

Post by scottgus1 »

BMANN06 wrote:VBoxManage Modifyvm PIC37 --lpt1 0x378 7 - This works just fine
Per the Virtualbox manual, it appears that --lptmode only directs to parallel ports on the host. Sounds like you need a "virtual parallel port to file converter" for the host to register as a parallel port.
websearch: "virtual parallel port that redirects to pdf"
https://superuser.com/questions/1202945 ... te-printer

Also try in-the-VM methods to get the DOS printer to redirect to a file in the VM, then transfer the file to the host through a network. Web-search "print to a file in DOS". https://community.spiceworks.com/topic/ ... ad-of-lpt1
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Some help with Printing to file from DOS VM to Host

Post by mpack »

I'm not sure I'm getting what's being attempted here, but AFAIK a VirtualBox LPTx emulation can't be redirected to a file, because it isn't a stream. It's a bunch of IO commands to a piece of hardware. If you can configure the DOS guest to print to a serial port, then maybe that might be redirected.

Personally I think the only viable solution is to print to a file inside DOS. Then you have the simpler problem of getting the DOS file to the host PC for printing.
BMANN06
Posts: 4
Joined: 22. Dec 2020, 18:23

Re: Some help with Printing to file from DOS VM to Host

Post by BMANN06 »

First,

Thanks very much for the replies!

I used to run these DOS VMs with VMware Workstation Pro - In VMware you can configure a completely virtual Parallel port and have it set up to "print to file" on the Host disk. Here is a snipit from the .VMX file

parallel0.present = "TRUE"
parallel0.fileType = "file"
parallel0.fileName = "C:\ALARMS\K_ALARMS.TXT"

parallel0.bidirectional = "FALSE"


parallel0.startConnected = "TRUE"

Now, I understand that VirtualBox binds to the Physical Parallel port on the host, (unfortunately, the host doesn't have a physical parallel port). Is there a retail/commercial version of Virtual Box that I can look into and perhaps request features etc? I find the the virtualbox much more stable with these older DOS Virtual Machines. I only have to support these older systems for maybe another year. I will look into printing to the guest, however file access may be an issue, these dos machines network to each other via Novell's IPx/SPx, so file sharing to the windows 10 Host will be a pain if not impossible.

If i were successful in getting the dos systems to print to their disk, is there a method within the Virtual Box for me to access the file system on the virtual disk?

Thanks again for taking the time to review and reply!
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Some help with Printing to file from DOS VM to Host

Post by scottgus1 »

There is a pay-for version but it comes steep. Oracle Store

However the devs report they are slammed, and one 100-seat license is probably not going to unslam them enough.
BMANN06 wrote:is there a method within the Virtual Box for me to access the file system on the virtual disk?
Only with Guest Additions, which are not available for DOS.
BMANN06 wrote:file sharing to the windows 10 Host will be a pain if not impossible.
File sharing through an intermediate VM, like Windows 7, could possible. 10 et al can still talk to 7. (Or turn on SMB1 file sharing on a non-internet-connected Windows 10, maybe that might bridge your DOS VMs over.)
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Some help with Printing to file from DOS VM to Host

Post by mpack »

Setting up a FreeDOS VM would make it easier to provide common networking.

But even easier: several Windows apps exist which can open VDI files, especially if they contained recognized Windows filesystems (i.e. NTFS and FAT). E.g. 7-zip happily allows you to view a VDI like an archive and copy files out of it. I don't think it allows you to copy files in however.
Post Reply