LPT Port doesn't work properly

Discussions related to using VirtualBox on Windows hosts.
tristan202
Posts: 10
Joined: 15. Apr 2022, 09:46

LPT Port doesn't work properly

Post by tristan202 »

Main system: Windows 10 64-bit
VirtualBox: 6.1
Guest system: Windows XP 32-bit

I have a dealer.exe program that uses a key from the LPT port. It is currently running on Windows 7 32bit. There port settings are as follows:
- I/O 0378-037F
- DMA: 03
- LPT port number: LPT1

On another computer (windows 10 64bit), on which:
- I have the LPT output plugged into PCI-E
- the port in Win10 is visible as: SUNIX LPT Port (LPT1)
- After starting the program Dealer.exe I get the message: "Cannot change Visible in OnShow or OnHide" - this means that it did not read the key from the LPT port.

In cmd.exe I used commands in the correct path:
- VBoxManage modifyvm XP --lptmode1 "LPT1"
- VBoxManage modifyvm XP -lpt1 0x378 3

After starting the virtual machine and windows xp in the device manager I have:
- Port number: LPT1
- I/O 0378-037F
- IRQ 03

I run the program and get the message as above: "Cannot change Visible in OnShow or OnHide".
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: LPT Port doesn't work properly

Post by mpack »

The IRQ number for the first parallel port is normally 7, not 3. The latter is used by serial ports. The DMA number is not the IRQ number, and anyway the host hardware configuration is not relevant to the VM.

But, I would want to see evidence (a screenshot) that LPT1 exists on the Win10 host before I accepted that as correct.

See Enabling and Configuring Parallel (LPTx) Ports.
tristan202
Posts: 10
Joined: 15. Apr 2022, 09:46

Re: LPT Port doesn't work properly

Post by tristan202 »

ibb.co/K6Q401G
ibb.co/Lg8LJqk
ibb.co/vzL9Tn9
ibb.co/5FkHw9R
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: LPT Port doesn't work properly

Post by mpack »

One screenshot will be enough, but attach it locally here.

And please acknowledge the other points raised.
tristan202
Posts: 10
Joined: 15. Apr 2022, 09:46

Re: LPT Port doesn't work properly

Post by tristan202 »

Thanks.
I've set it by:
VBoxManage modifyvm XP -lpt1 0x378 7
Anything else I should do?
Attachments
Przechwytywanie.png
Przechwytywanie.png (12.15 KiB) Viewed 3515 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: LPT Port doesn't work properly

Post by mpack »

Can you show me that the LPT1 port appears inside XP's Device Manager?

In fact I'd like to see the VM log for the XP VM: Make sure the VM is fully shut down, then right click it in the manager UI. Select "Show Log" and save "VBox.log" (no other file) to a zip file. Attach the zip here.
tristan202
Posts: 10
Joined: 15. Apr 2022, 09:46

Re: LPT Port doesn't work properly

Post by tristan202 »

Log file
Attachments
VBox.zip
(23.87 KiB) Downloaded 18 times
tristan202
Posts: 10
Joined: 15. Apr 2022, 09:46

Re: LPT Port doesn't work properly

Post by tristan202 »

VM Device Manger Screenshot
Attachments
bez tytułu.JPG
bez tytułu.JPG (106.44 KiB) Viewed 3393 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: LPT Port doesn't work properly

Post by mpack »

Some minor asides before we return to the LPT issue:

You are allocating too much RAM - more RAM than your host can afford and also more than an XP guest usually needs. XP runs fine with 512MB, so I'm sure it will run like a dream with 2048MB.

You should also install the Guest Additions (see chapter 4 of the online user manual). This will relieve the CPU of a lot of work and make it more likely that other devices will work without stuttering.

The fact that you only gave the XP guest a 10GB drive could become a problem in the future, at which time you'll have to research how to enlarge an XP drive.



Returning to the LPT problem, I see this message in the log:
00:00:04.170599 drvHostParallelGetWinHostIoPorts: Addr not found for 'SUNIX LPT Port (LPT1)'
As far as I can tell this message means that the named host LPT port exists, but the Windows host refuses to "open" it. Do you have this dongle already opened by the host perhaps? Note that serial and parallel ports cannot be shared between apps (e.g. between VirtualBox and something else). Those old legacy devices cannot be used by more than one app at a time.
tristan202
Posts: 10
Joined: 15. Apr 2022, 09:46

Re: LPT Port doesn't work properly

Post by tristan202 »

RAM: Corrected.
Guest Additions: I will fix.
10GB drive: I will fix

How to check if a port is open by host?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: LPT Port doesn't work properly

Post by mpack »

tristan202 wrote: How to check if a port is open by host?
I'm afraid I have no idea - I have not used a parallel port myself since XP days. Generally speaking I would know what software I have enabled on that PC, e.g. if I installed any type of software on the host to manage that dongle, then that certainly means that it opens the port.
tristan202
Posts: 10
Joined: 15. Apr 2022, 09:46

Re: LPT Port doesn't work properly

Post by tristan202 »

I uninstalled the LPT port on the host. After reinstalling I have LPT3 in the device manager. I used the commands:
- VBoxManage modifyvm XP --lpt1 off
- VBoxManage modifyvm XP --lptmode1 "LPT3"
- VBoxManage modifyvm XP --lpt3 0x3BC 5

I receive an error:
[!] ASSERTION FAILED at line 2314: lpt

I also tried the addresses:
0x278 7
0x278 5
0x378 7
0x3BC 7

Always the same 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: LPT Port doesn't work properly

Post by mpack »

That final line should be "VBoxManage modifyvm XP -lpt1 0x378 7".

LPT3 is what the port is called on the host. There was no reason to change what the port is called inside the guest (LPT1). I suggest you read the LPT tutorial again, because I think that aspect is covered quite well.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: LPT Port doesn't work properly

Post by fth0 »

FWIW, I'm wondering if the parallel port is accessible when VirtualBox runs in NEM mode (Hyper-V).
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: LPT Port doesn't work properly

Post by mpack »

It's certainly worth checking.

@tristan202: I don't know if you are aware that you have Hyper-v enabled, and that this nearly always degrades VirtualBox performance even if it doesn't make it fail completely.

See HMR3Init: Attempting fall back to NEM (Hyper-V is active) for how to disable Hyper-v on the host. I would be good if you could do this anyway, at least temporarily, to answer Fth0's question.
Post Reply