LPT1 Pass-Through

Some time ago a parallel port flat bed scanner connected to a physical NT4 system was resurrected. Many years ago after virtualizing NT4, LPT1 parallel port pass-through was used in the virtual machine (VM) to use the scanner.

PCI pass-through was removed from VirtualBox beginning with the 6.1 release. Is LPT pass-through still available?

Other than two snippets about the vboxmanage command, the VirtualBox user manual seems void of helpful information. Yet that minimal information suggests pass-through remains available.

There are no GUI controls for this feature. The following commands configure LPT1 pass-through:


    vboxmanage modifyvm NT4Workstation --lptmode1 "/dev/parport0"
    vboxmanage modifyvm NT4Workstation --lpt1 0x378 7
    

That modifies the configuration file with:


    <LPT>
      <Port slot="0” enabled="true” IOBase="0x378” IRQ="7” path="/dev/parport0"/>
    </LPT>
    

Launching the NT4 VM was blocked by an error message that the /dev/parport0 file was not found. That made sense because there is no such port on the office computer.

After powering off the VM, the config file was adjusted by deleting the path="/dev/parport0" snippet.

The VM launched with no errors. After booting the VM the Control Panel->Devices applet showed the Parallel and Parport device services had started automatically.

After powering off the VM, the config file was toggled to enabled="false". After booting the VM the Control Panel->Devices applet showed the Parallel and Parport device services had not started.

Attempting to manually start the Parport device service failed with Error 0020: The system cannot find the device specified.

After restoring enabled="true" the device services started automatically.

These steps seem to confirm parallel port pass-through is still available. Is the feature functional?

The office computer where the VMs are used does not have a parallel port. A parallel port card is installed in the previous office computer that now is a test computer. That hinted parallel port pass-through had not been used since at least 2017 when moving the office desktop to newer hardware. A fair guess is the feature had not been used in at least 10 years.

Before proceeding the scanner was connected to the physical NT4 machine. Everything functioned as expected.

On the test computer the /dev/parport0 device node existed. VirtualBox was configured and the NT4 VM copied from the office desktop. The path="/dev/parport0" snippet was restored to the config file.

Launching the NT4 VM was blocked by an error message about a /dev/parport0 conflict. Original notes show that the lp kernel module needs to be blacklisted or unloaded to support parallel port pass-through. Browsing the office desktop found the module blacklisted, which explained not seeing that error there. The module was unloaded:

rmmod lp

The VM launched with no errors. The Control Panel->Devices applet showed the Parallel and Parport device services had not started automatically.

Attempting to manually start the Parport device service failed with Error 0020: The system cannot find the device specified.

The config file was modified by deleting path="/dev/parport0". After booting the VM the Control Panel->Devices applet confirmed the Parallel and Parport device services had started automatically.

In the VM, Photo Editor was launched but did not find the scanner.

The VM was powered off and the lp module loaded:

modprobe lp

The VM launched with no errors. The Control Panel->Devices applet confirmed the Parallel and Parport device services had started automatically.

Photo Editor still did not find the scanner.

The lp module was unloaded.

The Control Panel->Devices applet confirmed the Parallel and Parport device services had not started automatically.

Nonetheless Photo Editor seemed to find the scanner. The scanner light glowed but there was the following dialog warning:

The parallel port may be busy printing. Please allow printing to complete before using the scanner.

No print jobs were found in the local print server queue. The dialog is misleading. The problem is not that the parallel port was busy but the parallel port device services had not started automatically.

After selecting No in the dialog to ignore the “busy” printer, the expected dialog appeared that the scanner lamp was warming. Previewing and scanning a document worked as expected.

Using the scanner pass-through port, the office printer was connected temporarily with a Centronics cable. Printing a test page caused an error dialog:

Error printing to LPT1: for Document Test Page: The system cannot find the file specified.

After powering off the VM, the config file was changed by deleting the path="/dev/parport0" snippet. The related device services started automatically. This time a different dialog appeared:

Error printing to LPT1: for Document Test Page: The device is not ready.

No error messages or blinking LEDs at the printer.

Because everything works without error on a physical machine the conclusion was something misconfigured in the VM.

A different VM made no difference. The scanner drivers were not installed but the same results appeared trying to print a test page.

There is no need here for parallel port pass-through. Likely parallel port pass-through is functional. Likely something obvious is being overlooked. Because for many years the office printer has been connected with a 620n JetDirect network controller, there are no other VMs configured to use a parallel port printer. For now this will remain as Yet Another Unfinished Story.

Posted: Category: Usability Tagged: Virtual Machines

Next: Detecting the First Boot of the Year

Previous: Old CMOS Batteries