Parallel port... again...

Discussions related to using VirtualBox on Linux hosts.
jml9904
Posts: 16
Joined: 8. Jan 2012, 23:43
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows, RHEL, SuSE

Parallel port... again...

Post by jml9904 »

I know this has been hashed around, but has there been any news about virtualizing the LPT (parallel) port under Linux? I'd like to attach my eprom programmer (stop laughing) to a Windows guest under Fedora... indications are on the Windows host side that there may be some test code, however, none under Linux.

Thanks!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Parallel port... again...

Post by Perryg »

They are testing it now and if all goes right it should be included in version 4.2.*
jml9904
Posts: 16
Joined: 8. Jan 2012, 23:43
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows, RHEL, SuSE

Re: Parallel port... again...

Post by jml9904 »

Wow, great!!! Thanks so much! If they're looking for testers, pls let me know off-list.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Parallel port... again...

Post by Perryg »

It has been available in Linux for a while (depending on your version). You just need to manually turn it on in the guests settings file. It more than likely will not survive a reboot though. Meaning you would need to edit it before you start the guest every time.

Or try

Code: Select all

VBoxManage modifyvm <uuid|name>
             [--lpt<1-N> on|<I/O base> <IRQ>]
             [--lptmode<1-N> <devicename>]
Make a backup of your guests control file first!
jml9904
Posts: 16
Joined: 8. Jan 2012, 23:43
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows, RHEL, SuSE

Re: Parallel port... again...

Post by jml9904 »

Thanks, Perry! I'll give that one a shot.
jml9904
Posts: 16
Joined: 8. Jan 2012, 23:43
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows, RHEL, SuSE

Re: Parallel port... again...

Post by jml9904 »

4.1.12 r77245 doesn't seem to have the lpt code in it at all. Will wait for 4.2. :)
klaus
Oracle Corporation
Posts: 1135
Joined: 10. May 2007, 14:57

Re: Parallel port... again...

Post by klaus »

The code for Linux host was in for a LONG time, and hasn't been modified much except the somewhat more recent adding of bidirectional printer port support (which isn't really tested, due to the lack of suitable hardware in today's PCs), there is just no official way to set it up in any version up to 4.1. One needs to manually hack the VM config (at your own risk, it's relatively obvious though), which should only be done when all VBox related processes are terminated and you double checked that there is no VBoxSVC process running for the current user.

The only reason why we decided to make it easier to enable is that in the current development version there is also host parallel port passthrough support for Windows, with a rather similar level of testing. Since we now cover the most widespread platforms it deserves an official way to configure it.

If you want to test drive things on Linux only you should be able to do this with any recent 4.1 version...
jml9904
Posts: 16
Joined: 8. Jan 2012, 23:43
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows, RHEL, SuSE

Re: Parallel port... again...

Post by jml9904 »

I would love to test on Linux, but VBoxManage doesn't seem to recognize the option.
--------------------------------------------------------------
user@host:~> VBoxManage -v
4.1.12r77245
user@host:~> VBoxManage modifyvm 6bf6d8ab-126e-4211-9399-d8510ea83f20 --lpt1 on
Oracle VM VirtualBox Command Line Management Interface Version 4.1.12
(C) 2005-2012 Oracle Corporation
All rights reserved.

Usage:

VBoxManage modifyvm <uuid|name>
[--name <name>]
[--ostype <ostype>]
<... snip ...>

VBoxManage: error: Unknown option: --lpt1
-------------------------------------------------------------------------------------
Do I have the syntax wrong? Using the VM name vs. the GUID doesn't seem to make a difference, and I've tried other combinations of options; they all come back "unrecognized"...

Thanks!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Parallel port... again...

Post by Perryg »

You need to edit the guests control file. Look for the entries below and change the enable bit to true. (only works with Linux hosts)

Code: Select all

 <LPT>
        <Port slot="0" enabled="true" IOBase="0x378" IRQ="4"/>
        <Port slot="1" enabled="false" IOBase="0x378" IRQ="4"/>
</LPT>
jml9904
Posts: 16
Joined: 8. Jan 2012, 23:43
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows, RHEL, SuSE

Re: Parallel port... again...

Post by jml9904 »

That did the trick! Thanks a million... off to test the port operations.
jml9904
Posts: 16
Joined: 8. Jan 2012, 23:43
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows, RHEL, SuSE

Re: Parallel port... again...

Post by jml9904 »

Spoke too soon; after modifying the vbox file as above, starting the VM emits:

"Failed to open a session for the virtual machine Windows XP.

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

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: Console
Interface: IConsole {1968b7d3-e3bf-4ceb-99e0-cb7c913317bb}"

Similar message for a Linux guest. This box is hosted on a Fedora 16 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: Parallel port... again...

Post by mpack »

ISTM there ought to be a host port assignment in there. E.g. on Windows hosts you might map it to "LPT1", I don't know what naming Linux hosts use.

Here's what the UART assignment is on one of the (Windows host) VMs.

Code: Select all

        <Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" path="COM1:" hostMode="HostDevice"/>
Note the last two fields. I think there ought to be something similar in the LPT line, particularly a path to a host device. However searching has not turned up precise details, and I'm not in a mood to search source code right now.

Here is a link to previous discussion of the xml syntax, but I don't see that it was ever settled.
jml9904
Posts: 16
Joined: 8. Jan 2012, 23:43
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows, RHEL, SuSE

Re: Parallel port... again...

Post by jml9904 »

I see where you're going, but I thought the additions to the config file would cover that, though:

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

There's the LPT port (LPT1), the I/O port, and the IRQ line - I'd think they'd get passed on through as virtual HW for the guest to pick up. Perhaps the current error is more related to VB not actually being able to match up the LPT port to an emulation driver?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Parallel port... again...

Post by mpack »

Nope. The IRQ crap is for the emulation which the guest will see. Look again at the UART line I showed you. It has all that crap too (exactly) - but it also has a couple of host assignment fields.
jml9904
Posts: 16
Joined: 8. Jan 2012, 23:43
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows, RHEL, SuSE

Re: Parallel port... again...

Post by jml9904 »

Looks like there's a conflict between what the driver wants (DevicePath, in src/VBox/Devices/Parallel/DrvHostParallel.cpp, line 331) and what the config file can pass; I'm using

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

I've tried DevicePath="/dev/parport0" without success, either. Really don't want to have to rebuild this all, but the SDK seems to indicate that it's supposed to be path, not DevicePath...
Post Reply