VMware Server 2 on Linux Host with Parallel Port Passthrough

ParallelPort

Not being too familiar with linux printing, I blindly assumed that as long as the parallel port worked in the Linux host OS, that parallel port passthrough would work just fine. So, I proceeded to add a virtual parallel port to my Windows VM running on VMware Server 2.0.1 under CentOS 5.3.

I soon realized that this wasn’t as easy as it seemed. CentOS printed test pages, etc. just fine from the host using the device /dev/lp0. However, VMware wanted to use the device /dev/parport0 – actually, I really didn’t have an option as it was simply a drop-down menu and not a simply text field to enter whichever device I wanted to specify.

I tried manually editing the .vmx file and changing the line:

parallel0.fileName = "/dev/parport0"

TO

parallel0.fileName = "/dev/lp0"

No dice… Even though CentOS worked when trying to print to the device /dev/lp0, it did not seem to work this way with VMware Server. With a little digging, I was able to find a way to make the passthrough work correctly, albeit not 100% smoothly due to what may be a bug with VMware Server.

Here is what I did in order to get the port working:

1. Remove lp module:

[email protected]:$ rmmod lp

2. Edit the file /etc/modprobe.conf, and beneath the existing ‘alias’ lines, add these lines:

alias lp off
alias parport_lowlevel parport_pc

3. Make sure no modules are using the parport0 device (output should be ‘none’):

[email protected]:$ cat /proc/sys/dev/parport/parport0/devices/active

4. Reboot the system and run the above command again to make sure that lp module does not bind to parport0

[email protected]:$ cat /proc/sys/dev/parport/parport0/devices/active

5. Make sure the lp module is not loaded:

[email protected]:$ lsmod | grep lp

6. Add the virtual parallel port to the VM while it is powered off, and make sure it’s set to the hardware device /dev/parport0 and checked to Connect at Power On:

7. Boot VM, and it should auto-detect the LPT1 port inside of Windows:

8. Once Windows is loaded, go back to the host and edit the parallel port settings to disconnect the port, and then reconnect the port.

9. This parallel port passthrough should work until the next reboot of Windows, and then simply complete Step 8 again, and it will be back.

Hope this helps someone else that’s looking for a solution!

David Markley

Well, I was born to my parents... and did the school thing, and then work. So, pretty standard humanoid setup... :-)

  • SkaDan

    The HPLIP software offered by sourceforge/HP likes to think it supports parallel… not really.
    I was skeptical at first, but your instructions were clear, and worked!

    Thanks.

  • SkaDan

    The HPLIP software offered by sourceforge/HP likes to think it supports parallel… not really.
    I was skeptical at first, but your instructions were clear, and worked!

    Thanks.

  • Glad that it worked for you!

  • Glad that it worked for you!

  • You're a champion. This blog post is going straight to my favourites!

  • You're a champion. This blog post is going straight to my favourites!

  • Thanks for your tutorial it helps me not to repeat the same mistake.

    http://www.vpswebserver.com