Can't print in parallel port using Windows Host and FreeDOS Guest

Discussions related to using VirtualBox on Windows hosts.
psaez
Posts: 14
Joined: 12. Jan 2019, 10:36

Can't print in parallel port using Windows Host and FreeDOS Guest

Post by psaez »

Hi, I'm using last virtualbox 6.0 on Windows 7 and I need to print with and old DOS program into an OLD parallel printer.

I Created a virtual machine with FreeDOS and I followed this tutorial by @mpack -> viewtopic.php?f=35&t=54187

Important things:
  • Windows only detect one LPT port installed, and it's called LPT1. I can see it in device admin.
  • Windows installs automatically the driver of the printer each time I start the computer even if I uninstall the driver for testing virtualbox without the driver installed on the host.
  • In the driver of the printer in Windows I can see that it's connected to LPT1.4 port. I'm not sure why the driver says 1.4 if the device admin of windows says it's called LPT1.
  • When I follow the tutorial by @mpack it says that if the printer is in LPT1 port, you must put "LPT1:" as a parameter in the command, but if I do that, I get this error when trying to start the virtual machine:
    HostParallel#0: Could not get direct access to the host parallel port!! (rc=VERR_INTERNAL_ERROR_3) (VERR_INTERNAL_ERROR_3). Parallel device 0 cannot attach to host driver (VERR_INTERNAL_ERROR_3).
  • If I add "LPT1" instead of "LPT1:" the virtual machine starts but is not capable of printing, FreeDOS doesn't have access to the port. The DOS program for printing says that printer is not detected.
  • If I add "LPT1.4" it gives an error of invalid port name.
I read a lot of posts of problems with parallel port: None of the proposed solutions worked on me.

Please help, thank you.
Last edited by socratis on 12. Jan 2019, 11:32, edited 1 time in total.
Reason: Added missing URLs.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by mpack »

"LPT1:" is correct, if a host device "LPT1:" exists. "LPT1" (without the colon) is a filename, not a device name. Naturally Windows will succeed in creating the file, so the lack of an error there is a red herring, but that will not help you print.

If you get an error when opening the "LPT1:" device then you should drill down into that problem. The first guess is that the host has that port open for some reason, or that the port is not enabled in the host for some reason.

I do not believe that "LPT1.4" is valid for any purpose. You should investigate what made you think that it is.


And just to clarify, I hope we are talking about a native LPTx port in the host, and not a USB LPT printer adaptor, which cannot be used in this way.
psaez
Posts: 14
Joined: 12. Jan 2019, 10:36

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by psaez »

very thanks for fast answer

the LPT1 is a native port of the motherboard, is not a USB adapter. The LPT1 port is perfectly working under windows 7 because I tested it. Windows 7 autoinstalls the printer driver and I tryed printing a "test page" and it printed the text page

With "LPT1:" in the command i tryed all this with same error result:
- rebooting host
- starting virtual machine after printing the test page in host after a host clean startup
- starting virtual machine without printing the test page in host after a host clean startup
- uninstalling the printer driver in host and starting Virtual Machine after driver uninstall
- tryed the same with previous version of virtual box (5.2.22)

Here is a picture with the LPT1 printer details in windows host, I can't see "LPT1:" anywhere

https://i.imgur.com/ePYwy6K.png

PD: I was wable to print using this printer in this computer in LPT1 previously when I had a windows xp dual boot, but that is not a possibility anymore
Last edited by socratis on 15. Jan 2019, 01:46, edited 2 times in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by mpack »

psaez wrote:Windows 7 autoinstalls the printer driver
Well, there's your problem. VirtualBox cannot open the port if the printer driver is already using it.

You need to understand that at the lowest level there's a driver for the parallel port. That needs to exist.

At a higher level there may be a generic printer driver, which opens the port provided by the parallel port driver. This needs to NOT exist. You can't share the LPT1 port. If it's opened in VirtualBox (for a VM) then it can't also be opened in the host. If Win7 insists on installing a printer driver then disable (not uninstall) it, and reboot the host. That should free up the port while keeping a placeholder to prevent it being installed again.
psaez
Posts: 14
Joined: 12. Jan 2019, 10:36

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by psaez »

mpack wrote: If Win7 insists on installing a printer driver then disable (not uninstall) it, and reboot the host. That should free up the port while keeping a placeholder to prevent it being installed again.
If I uninstall the printer, the printer doesn't be installed again until I reboot. So I tryed uninstalling the printer and starting virtual machine with same error.

I can't disable the printer. When I go to the printers panel in windows 7, if I right click on the printer, doesn't exists a "disable" option, only "uninstall device".

I tryed also finding the printer in device manager but is not there, only the LPT1 port, but not the printer, so what more can I try?
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by Martin »

Could you try uninstalling the printer driver, then disconnecting the printer cable?
Just to check if VirtualBox is able to connect the guest to the LPT1 port when there is no printer connected.
psaez
Posts: 14
Joined: 12. Jan 2019, 10:36

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by psaez »

Martin wrote:Could you try uninstalling the printer driver, then disconnecting the printer cable?
Just to check if VirtualBox is able to connect the guest to the LPT1 port when there is no printer connected.
good idea, tryed it with exactly same error, so maybe the problem is not related with the printer driver:
HostParallel#0: Could not get direct access to the host parallel port!! (rc=VERR_INTERNAL_ERROR_3) (VERR_INTERNAL_ERROR_3).
Parallel device 0 cannot attach to host driver (VERR_INTERNAL_ERROR_3).

Result Code: E_FAIL (0x80004005)
Componente: ConsoleWrap
Interfaz: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
then, @mpack, about this you tell before:
mpack wrote: Well, there's your problem. VirtualBox cannot open the port if the printer driver is already using it.
now we know that the problem is not the driver, what more can it be?
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by Martin »

Do you have any additional security software on your host which could interfere with a "device security" feature?
psaez
Posts: 14
Joined: 12. Jan 2019, 10:36

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by psaez »

Martin wrote:Do you have any additional security software on your host which could interfere with a "device security" feature?
nope, only microsoft security essentials, and I tryed disabling real time protection and I got the same error

BTW one question, when I installed virtual box, I did not install the networking bridge because this is freedos and will not be connected to internet, is that a problem for use LPT1?
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by Martin »

If I remember correctly there was something about that you would need to have an interrupt defined in the resource settings of the LPT1 port on the host.
Could you try to disable the 'automatic' resource settings in the host device manager for the parallel port and define it manually to address 0378 and interrupt 7?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by mpack »

psaez wrote: I can't disable the printer. When I go to the printers panel in windows 7 ...
Disable it in Device Manager.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by mpack »

Martin wrote:If I remember correctly there was something about that you would need to have an interrupt defined in the resource settings of the LPT1 port on the host.
I believe VirtualBox doesn't support parallel port interrupts, so I've never heard of a need to assign special resources on the host.

Like any host resource, VirtualBox accesses it via a host OS API, it shouldn't need any special low level host configuration.
psaez
Posts: 14
Joined: 12. Jan 2019, 10:36

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by psaez »

mpack wrote:
psaez wrote: I can't disable the printer. When I go to the printers panel in windows 7 ...
Disable it in Device Manager.
mpack i told previously that printer is not in device manager, only LPT1 is in device manager, and tryed disabling it, but if I do that then doesn't exist for virtual box, gives another error
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by mpack »

AFAIK, any device that Windows knows about is listed in device manager. And, it can't list the printer in the control panel applet if it doesn't exist.

How about trying a test print from the host, then show me a screenshot of the Device Manager.
psaez
Posts: 14
Joined: 12. Jan 2019, 10:36

Re: Can't print in parallel port using Windows Host and FreeDOS Guest

Post by psaez »

mpack wrote:AFAIK, any device that Windows knows about is listed in device manager. And, it can't list the printer in the control panel applet if it doesn't exist.

How about trying a test print from the host, then show me a screenshot of the Device Manager.
Hi, sorry for my delay, but I switched that old computer to a brand new Athlon 200GE (zen core) with a motherboard with parallel port and now I'm using Windows 10. I was forzed to switch because that old computer was working very bad and the new piezes arrived today.

I'm now posting from the new computer and I can say that I'm having EXACTLY the same problem, but with a difference, now the Epson printer is visible in device admin.

BTW I did what you want, I printed the test page from the host (I did previously in the old computer as i told in previous messages) and it works perfectly, but when trying to start the virtual machine with "LPT1:" it crashes. I tryed disabling the printer in device manager and it's exactly the same behaviour.

Please, what more can I do? I'm having the same issue in two computers, even in a brand new computer with the last version of windows.
Post Reply