Parallel port printing problem

Temporary forum to discuss issues and problems during a VirtualBox Beta or Release Candidate phase.

Parallel port printing problem

Postby ulogic » 31. Aug 2012, 00:49

According to the release announcement for VirtualBox 4.2, one of the new features is support for parallel port passthrough on Windows hosts. I was excited by this announcement as I have been using Virtual PC 2007 for a printer that does not have Windows 7 drivers.

The host is running on Windows 7 64 bit with 8GB of RAM. The motherboard has an on-board parallel port at address 378. The guest machine is running Windows XP 32 bit. I could not get the printer to work in VirtualBox as it kept reporting paper empty status. I tried setting the host BIOS port settings at standard parallel port, bi-directional, and ECP+EPP modes. I also tried various on/off combinations of interrupt configurations in the host and guest but that did not change the symptoms.

The printer is a Xerox XD100 (which is essentially the same as a Sharp AL1000). The driver is very fussy and will only work with onboard parallel adapters. It will not work with USB parallel converters or PCI add-in cards because they don't provide the standard I/O addresses of 378/278/3BC, even in a non-virtualized environment. However, as I mentioned before, it does work under Virtual PC 2007 SP1.

The VirtualBox Manager does not have a section for managing parallel ports the way it does for serial ports. I manually edited the configuration file.

<LPT>
<Port slot="0" enabled="true" IOBase="0x378" IRQ="7"/>
<Port slot="1" enabled="false" IOBase="0x278" IRQ="4"/>
</LPT>

With the above configuration changes in version 4.2 RC2 and RC3, the virtual machine fails to start with the following error:

Failed to open a session for the virtual machine XP Pro.

Parallel#0 could not open '' (VERR_PATH_NOT_FOUND).

Parallel device 0 cannot attach to host driver (VERR_PATH_NOT_FOUND).

Result Code: E_FAIL (0x80004005)
Component: Console
Interface: IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}


I had to set the port enabled value back to false to allow the VM to start succesfully.
ulogic
 
Posts: 21
Joined: 7. Dec 2009, 21:57
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows 7 32/64 bit,Windows XP 32 bit

Re: Parallel port printing problem

Postby Perryg » 31. Aug 2012, 01:13

Try with IRQ5
<Port slot="0" enabled="true" IOBase="0x378" IRQ="5"/>
Perryg
Site Moderator
 
Posts: 25923
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX - Other

Re: Parallel port printing problem

Postby ulogic » 31. Aug 2012, 03:13

Changing to IRQ 5 did not make any difference. The VM still fails to start with the error

Parallel#0 could not open '' (VERR_PATH_NOT_FOUND).
Parallel device 0 cannot attach to host driver (VERR_PATH_NOT_FOUND).
ulogic
 
Posts: 21
Joined: 7. Dec 2009, 21:57
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows 7 32/64 bit,Windows XP 32 bit

Re: Parallel port printing problem

Postby Perryg » 31. Aug 2012, 03:36

I know it works as I have it working. Although you should not actually edit the *.vbox file to get there. You need to use VBoxManage and set it up that way with several other entries. I don't see that the DEVs have actually addressed this in the manual as of yet, but hopefully they will pickup on this topic and reply. On a Linux host the following works, but I doubt it will on a Windows host since the ports are different.

Code: Select all   Expand viewCollapse view
VBoxManage setextradata vm_name "VBoxInternal/Devices/parallel/0/Config/IRQ" 5
VBoxManage setextradata vm_name "VBoxInternal/Devices/parallel/0/Config/IOBase" 0x378
VBoxManage setextradata vm_name "VBoxInternal/Devices/parallel/0/LUN#0/Driver" HostParallel
VBoxManage setextradata vm_name "VBoxInternal/Devices/parallel/0/LUN#0/Config/DevicePath" /dev/parport0
Perryg
Site Moderator
 
Posts: 25923
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX - Other

Re: Parallel port printing problem

Postby ulogic » 31. Aug 2012, 03:52

Starting the VM after running those commands gives the following error

Parallel#0 could not open '/dev/parport0' (VERR_FILE_NOT_FOUND).
Parallel device 0 cannot attach to host driver (VERR_FILE_NOT_FOUND).

Under Windows it should be trying to access \\.\LPT1 to be able to use ioctl
ulogic
 
Posts: 21
Joined: 7. Dec 2009, 21:57
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows 7 32/64 bit,Windows XP 32 bit

Re: Parallel port printing problem

Postby ulogic » 31. Aug 2012, 03:59

I stopped all virtual machines and the VBox manager, edited the config file replacing /dev/parport0 with \\.\LPT1 and now the VM will start. However, the test page fails to print. It no longer reports an out of paper condition, just a less than helpful "Error - Printing" status.

Both the host and guest machines show they are using IRQ 7. I changed the setting in the config file from IRQ 5 to IRQ 7, but there was no change in the symptoms.
ulogic
 
Posts: 21
Joined: 7. Dec 2009, 21:57
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows 7 32/64 bit,Windows XP 32 bit

Re: Parallel port printing problem

Postby anshul makkar » 31. Aug 2012, 11:01

Please don't modify the xml file directly, but instead use the following APIs for parallel port configuration.

vboxmanage modifyvm <vmname> --lptmode[1-n] LPT[1-n]
vBoxManage modifyvm <vmname> --lpt1[1-n] <Port address> <IRQ No.>

for eg.
Enabled parallel port with configuration
vboxmanage modifyvm Fedora_VM --lptmode1 LPT1
vBoxManage modifyvm Fedora_VM --lpt1 888 5 .

We will try to update the user manual soon.

Let us know if still facing issues.
anshul makkar
Oracle Corporation
 
Posts: 28
Joined: 7. Feb 2012, 16:59

Re: Parallel port printing problem

Postby ulogic » 31. Aug 2012, 11:52

I ran the following commands:
vboxmanage modifyvm "XP Pro" --lptmode1 LPT1
vBoxManage modifyvm "XP Pro" --lpt1 0x378 7

The net effect of that was it changed the configuration from
<Port slot="0" enabled="false" IOBase="0x378" IRQ="4"/>
to
<Port slot="0" enabled="true" IOBase="0x378" IRQ="7" path="LPT1"/>

I still can't print from the VM. After the print job times out, it shows a status of "Error - Printing". I initially had put in the I/O address at 378 decimal which is 0x17A. In that case the print job status showed a status of paper empty.
ulogic
 
Posts: 21
Joined: 7. Dec 2009, 21:57
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows 7 32/64 bit,Windows XP 32 bit

Re: Parallel port printing problem

Postby mpack » 31. Aug 2012, 12:04

Have you tried detecting new hardware inside the guest since making these changes? Does the guest device manager show the LPT1 port as present, and using the base address and IRQ you assigned to the simulation?
mpack
Site Moderator
 
Posts: 13162
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows XP
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Parallel port printing problem

Postby ulogic » 31. Aug 2012, 15:01

I have found Windows XP to be pretty much plug and play when it comes to onboard LPT devices. However, I did uninstall the printer port in the device manager and rebooted the guest OS. When it came back up, the default is to not use any interrupts. I reconfigured it to use any interrupt assigned to the port.

The resources assigned to the port in the virtual machine are as follows:
I/O Range 0378-037F
I/O Range 0778-077F (this address range should not appear)
IRQ 7

I have another machine running Windows XP on a 9 year old motherboard. I only see the additional addresses when the port is configured in the BIOS to either ECP or ECP+EPP modes. On this motherboard, there are only 4 addresses in the range 0778-077B, but it also shows DMA 3 as another resource.

On my Windows 7 machine, the second address range has 8 addresses from 0778-077F when ECP mode is enabled, and it also shows DMA channel 3 is assigned.

Furthermore, the device manager on both the native machines list the device as an "ECP Printer Port" when ECP mode is enabled, whereas it it shows up as simply a "Printer Port" when it is configured in the BIOS as a standard, bidirectional, or enhanced printer port.

On my host machine where I am running VirtualBox, I tried every BIOS mode (SPP/bidirectional/EPP/ECP/ECP+EPP) but could not get the guest machine to print anything.

On my old native XP machine, the printer works in every BIOS configurable mode, with or without the interrupt enabled. In VirtualPC 2007, the guest machine can only print successfully when ECP mode is not enabled in the host BIOS.

I could not find any VBoxManage commands to configure the operating mode for the printer port. It seems to me that the second address range should only be present if a DMA channel is also assigned, and that the guest operating system should detect it as an ECP port.

VBoxManage probably support another command to set the operating mode for the parallel port and present it correctly to the guest machine.
ulogic
 
Posts: 21
Joined: 7. Dec 2009, 21:57
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows 7 32/64 bit,Windows XP 32 bit

Re: Parallel port printing problem

Postby anshul makkar » 3. Sep 2012, 08:54

Please can you share the the resource sheet for your parallel port (i.e IO Range, Memory Range and IRQ) and also VBox XML file.
anshul makkar
Oracle Corporation
 
Posts: 28
Joined: 7. Feb 2012, 16:59

Re: Parallel port printing problem

Postby ulogic » 4. Sep 2012, 02:57

It is curious that even in versions, even going back as far as 3.1, of VirtualBox that don't support parallel ports, the Windows guest still show resources assigned to LPT1. Also in 4.2 beta3, disabling the printer port does not make it disappear from the device manager.

I tried it in a second virtual machine (after disabling it in the first virtual machine) with the same settings. In the first machine, the document fails to print and the printer status shows "Error - printing". In the second machine, the document disappears from queue but nothing ever prints.
Attachments
VictimXP.xml
In this machine, printing fails with "Error-printing".
(12.6 KiB) Downloaded 69 times
lpt1_resources.png
lpt1_resources.png (27.81 KiB) Viewed 10336 times
ulogic
 
Posts: 21
Joined: 7. Dec 2009, 21:57
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows 7 32/64 bit,Windows XP 32 bit

Re: Parallel port printing problem

Postby anshul makkar » 4. Sep 2012, 13:32

Please use the binaries uploaded at "http://www.virtualbox.org/download/testcase/parallel_port.zip" and share the log file.
anshul makkar
Oracle Corporation
 
Posts: 28
Joined: 7. Feb 2012, 16:59

Re: Parallel port printing problem

Postby anshul makkar » 4. Sep 2012, 17:43

Also try with Interrupt disabled i.e LPT port settings, select option "Never use an interrupt" .
anshul makkar
Oracle Corporation
 
Posts: 28
Joined: 7. Feb 2012, 16:59

Re: Parallel port printing problem

Postby ulogic » 4. Sep 2012, 19:41

With the new device driver DLLs, the virtual machine fails to start with

Cannot load R0 module C:\Apps\VirtualBox/VBoxDDR0.r0: supLoadModule returned VERR_LDR_IMAGE_HASH (VERR_LDR_IMAGE_HASH).

Failed to register ourselves as a PCI Bus (VERR_MODULE_NOT_FOUND).

Result Code: E_FAIL (0x80004005)
Component: Console
Interface: IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}

I thought I had uploaded the log before, but I must have left out a step, but it is here now.
Attachments
VictimXP-2012-09-06-10-36-06.log
(99.03 KiB) Downloaded 107 times
Last edited by ulogic on 7. Sep 2012, 14:09, edited 1 time in total.
ulogic
 
Posts: 21
Joined: 7. Dec 2009, 21:57
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows 7 32/64 bit,Windows XP 32 bit

Next

Return to VirtualBox Beta/Release Candidate Feedback

Who is online

Users browsing this forum: Majestic-12 [Bot] and 3 guests