you can use your virtual machine debugging facilities (or gdb/something else) to read memory directly. ms-dos has no memory protection nor it's a multi-task system, so you can read virtual machine memory, you can read virtual machine vga for input.
documentation says there exists a command
info vgatext -- print the contents of the VGA framebuffer formatted as standard text mode
the correct syntax to get output is:
run VirtualBox --debug --startvm msdos1.25, then, in debugger console:
info vgatext
copy-pasted output:
The COMPAQ Personal Computer DOS
Version 1.11
(C) Copyright COMPAQ Computer Corp. 1982
(C) Copyright Microsoft 1981, 82
A>
--------------------------------------------------------------------------------
VBoxDbg>
So, you can write a debugger script which hooks on a memory value inside your program's memory and dumps vga screen when a program does output / or you can write script that pauses cpu, saves content consistently, if output changes, saves updated content, continues cpu run
Some options to investigate are:
find how to write a debugging script for dumping memory contents of your application
find some debugging vga driver/serial port/memory dumping solution for quemu/dosbox/virtualbox
find some OLD utility program from 80's which maybe someone wrote back there for this purpose
add freedos tag here (or even move/repeat your question on big stackoverflow, I suppose some gurus should know a thing about problems like this
I'll update later if I find something interesting, but can you please reveal some details on why are you using 1.25, does this program works on newer versions of msdos? I bet you can find some young assembly hacker eager to patch-up this program to a newer version (or add file output with asm) for a small fee