Welcome to MSDN Blogs Sign in | Join | Help

Virtual PC 2004 SP1 and the LPT port

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.

Cheers,
Ben

Published Monday, March 06, 2006 9:47 PM by Virtual PC Guy

Comments

Tuesday, March 07, 2006 4:11 AM by RFOG

# re: Virtual PC 2004 SP1 and the LPT port

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.

Great!
Tuesday, March 07, 2006 5:01 AM by Roger Lipscombe

# re: Virtual PC 2004 SP1 and the LPT port

Nitpick: That should be 'start=', then the space, then the 'disabled'. sc's command-line parsing is a bit esoteric.
Tuesday, March 07, 2006 10:26 PM by Norman Diamond

# re: Virtual PC 2004 SP1 and the LPT port

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.)
Wednesday, March 08, 2006 1:48 PM by Virtual PC Guy

# re: Virtual PC 2004 SP1 and the LPT port

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)

Cheers,
Ben
Thursday, March 09, 2006 4:23 PM by Jonathan

# re: Virtual PC 2004 SP1 and the LPT port

People still use Parallel-connected printers? I thought everyone moved to USB or LAN-attached by now...
Monday, March 13, 2006 6:21 PM by Virtual PC Guy

# re: Virtual PC 2004 SP1 and the LPT port

Yup - they do :) (sigh...)

Cheers,
Ben
New Comments to this post are disabled
 
Page view tracker