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"
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:
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’):
4. Reboot the system and run the above command again to make sure that lp module does not bind to parport0
5. Make sure the lp module is not loaded:
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!