Virtual PC 2004 SP1 and the LPT port

Rate This
  • Comments 6

With Virtual PC 2004 SP1 we made a change to the way we access the LPT (or parallel) port.  The reason for this is that we found a bug in Virtual PC 2004 which meant that we were not being guaranteed exclusive access to the LPT port for the virtual machine.  This meant that with Virtual PC 2004 it would be possible for the virtual machine to be talking to your printer - and for the host operating system to try and talk to the same printer at the same time.  Needless to say this is a big problem (which could lead to data loss, hardware problems, etc...).  So with Virtual PC 2004 SP1 we changed this behavior so that we actually are ensured of having exclusive access to the LPT port.

The problem is that by default Windows will grab control of the LPT port - if a printer is present - and it will not give up control.  There are - however - two ways that the user can make Windows give up control of the LPT port:

  1. Run 'net stop spooler' prior to launching the virtual machine.  Note that this will temporarily disable printing on the host operating system.  Once you are done with the virtual machine you can re-enable printing by running 'net start spooler'.

  2. Run 'sc config spooler start= disabled' and reboot your physical computer.  This will permanently disable printing on the host operating system and ensure that Virtual PC can always access the LPT port.


Leave a Comment
  • Please add 1 and 2 and type the answer here:
  • Post
  • Hi, I'm using a Windows XP VirtualPC VM with Codewarrior for Coldfire with a BDM attached to the parallel port with no trouble, connecting to host device and working fine like if it were a real machine and not a vm one.

  • Nitpick: That should be 'start=', then the space, then the 'disabled'. sc's command-line parsing is a bit esoteric.
  • 1.  I would think that if the sc and net commands are executed in this order, then the spooler service will be reliably stopped and a reboot wouldn't be necessary (on the physical computer).  Am I overlooking something, or is there a bug, or what?

    2.  If the device attached to the parallel port is a printer, then surely there's no real data loss, but the loss of printing time and materials for printouts that have to be repeated.  Data loss occurs from ways that Windows has been observed to handle hard disks.  Your pre-SP1 bug wasn't so severe.  (And if you can help prevent data loss, your services are needed in Windows development.)

    3.  As for unwanted sharing between the physical and guest machines, the following bug is also low priority, but just an observation.  If Ctrl+Shift+Esc are pressed, sometimes this opens both Task Managers in both environments.  (This is not Ctrl+Alt+Delete.  Of course Ctrl+Alt+Delete can only take effect in the physical machine and it does so.)
  • Roger -

    Thanks! I have fixed up the post

    Norman -

    Yes you are correct that both commands can be run in order.  Also - a lot depends on your interpretation of 'data' - for average office use this may not be a problem but what if the printer prints out security logs which are then deleted? (I have seen this sort of configuration)

  • People still use Parallel-connected printers? I thought everyone moved to USB or LAN-attached by now...
  • Yup - they do :) (sigh...)

Page 1 of 1 (6 items)

Virtual PC 2004 SP1 and the LPT port