Hello, My Xen 3.0.3 server has a printer attached on the printer port /dev/lp0. I would like to set up a domU printserver. Can I treat /dev/lp0 as a block device and give a domU access to it simply by adding something like this to the domU''s configuration: ''phy:lp0,lp0,w'' If not, is there another way of letting domU use the printer, short of getting an lpt->usb convertor or installing a PCI card with an lpt port? I really don''t like setting up dom0 as a printserver. Kind regards, -- Sander Marechal http://www.jejik.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> My Xen 3.0.3 server has a printer attached on the printer port /dev/lp0. > I would like to set up a domU printserver. Can I treat /dev/lp0 as a > block device and give a domU access to it simply by adding something > like this to the domU''s configuration: > > ''phy:lp0,lp0,w''I''m afraid not, printers appear as character devices and there''s not a generic way of passing them through.> If not, is there another way of letting domU use the printer, short of > getting an lpt->usb convertorThat wouldn''t be very helpful if your domU is PV since it''s not possible to pass through USB to PV guests. There is passthrough for FV guests, but I''ve heard some dubious accounts of its stability - I''m not sure if it''s an officially supported option...> or installing a PCI card with an lpt port?That would work (although it would imply giving the guest more permissions in order to let it own the PCI device) for a PV domU.> I really don''t like setting up dom0 as a printserver.That''s sensible, although I sometimes suggest this sort of thing because it makes life easier (depending on your deployment). One thing you might be able to do is just give the domain access to the IO ports for the parallel port (and interrupts if there are any... I don''t know much about the parallel port hardware). You could then have the guest drive the printer directly through it; this might work, although it may be necessary to make sure dom0 doesn''t try to do anything with the port... Hope this helps, Mark -- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson wrote:> One thing you might be able to do is just give the domain access to the IO > ports for the parallel port (and interrupts if there are any... I don''t know > much about the parallel port hardware). You could then have the guest drive > the printer directly through it; this might work, although it may be > necessary to make sure dom0 doesn''t try to do anything with the port...I have no idea how I would go about doing that. To boot, I just found out that the server only has one PCI slot (the rest is PCI-X) and that''s taken up by the soundcard (for my jukebox server, another domU). So I guess there''s no other option than to add printserving to dom0. Thanks anyway for the advice :-) -- Sander Marechal http://www.jejik.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> I have no idea how I would go about doing that. To boot, I just found > out that the server only has one PCI slot (the rest is PCI-X) and that''s > taken up by the soundcard (for my jukebox server, another domU). So I > guess there''s no other option than to add printserving to dom0. > > Thanks anyway for the advice :-)OK, well maybe we can muddle through this together :-) Take a look at the output of: cat /proc/ioports | grep parport Do you get any results? The idea is that this should give you the ioport range used by the parallel port(s). In principle you can make sure there aren''t any parallel port drivers in dom0, and just add this to the domain config file in the form: ioports = [ "start-end" ] Then try to load your parallel port driver in the domU... This might not work, but I''d be surprised if it did anything too nasty to your system so it might be worth a try. If you still have problems, we could have a go at debugging them. Hope that helps! Cheers, Mark -- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson wrote:> Take a look at the output of: > > cat /proc/ioports | grep parport > > Do you get any results? The idea is that this should give you the ioport > range used by the parallel port(s). In principle you can make sure there > aren''t any parallel port drivers in dom0, and just add this to the domain > config file in the form: > > ioports = [ "start-end" ] > > Then try to load your parallel port driver in the domU...No such luck so far. First I created a fresh domU to test in. I found the ioports range and added it to the domU''s configuration: ioports = [ ''0378-037a'' ] Then I booted the domU for the first time and let it do a Debian base install (tasksel --new-install). Next I installed a bunch of printer packages: - lpr - printconf trying to print a file with "lp /some/file" gives: lp: Error - no default destination available. I looked in /dev and there''s no /dev/lp0. A "modprobe lp" didn''t do anything. I did see a /dev/printer but I think that''s only there because lpd is running. I do seem to have a working parallel driver. When I do "lsmod" I can see: Module Size Used by ppdev 9444 0 parport_pc 33092 1 lp 11780 0 parport 34120 3 ppdev,parport_pc,lp ipv6 229088 12 8250 28164 0 serial_core 20288 1 8250 ext3 120072 1 jbd 53224 1 ext3 mbcache 9124 1 ext3 dm_mirror 20048 0 dm_snapshot 16320 0 dm_mod 51000 2 dm_mirror,dm_snapshot processor 29608 0 So, what now? Thanks in advance, PS: If this ioports forwarding doesn''t work out then I have one other solution besides running dom0 as a print server. I was reading over the PCI specs yesterday and apparently you can use PCI cards in PCI-X slots as long as the cards conform to PCI 2.1 or higher. I have plenty of PCI-X slots left. My soundcard is PCI 2.1 so that could go into a PCI-X slot, freeing the PCI one for a cheap $10 parallel port PCI card. -- Sander Marechal _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wed, 2007-03-21 at 11:00 +0100, Sander Marechal wrote:> > I looked in /dev and there''s no /dev/lp0. A "modprobe lp" didn''t do > anything. I did see a /dev/printer but I think that''s only there because > lpd is running. I do seem to have a working parallel driver. When I do > "lsmod" I can see: >try a mknod /dev/lp0 c 6 0 (or just mknod lp0 c 6 0 ) while in /dev It looks like your going to have to set up the device, but if the module is loading ok, it could work. May want to double check the major / minor on that, going from memory the last time I had to create it. Hope this helps, Best, --Tim _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Tim Post wrote:> try a mknod /dev/lp0 c 6 0 (or just mknod lp0 c 6 0 ) while in /dev > > It looks like your going to have to set up the device, but if the module > is loading ok, it could work. > > May want to double check the major / minor on that, going from memory > the last time I had to create it.You remembered right :-) I am a few steps further but not quite there yet. The mknod did create /dev/lp0. When I ran "printconf" after that, it recognised a HP DeskJet 842c on the parallel port (close enough -- it''s an 840 in reality). I don;t know how cups/printconf detects their printers but to me this looks like good communication over the parallel port. lpstat -p says: printer deskjet_842c is idle. enabled since Thu 22 Mar 2007 12:39:29 AM UTC However, when I try to print something and run lpstat again to it I get: printer deskjet_842c disabled since Thu 22 Mar 2007 12:24:40 AM UTC - /usr/lib/cups/backend/parallel failed Now, I should say that the ink warning light is flickering on the printer. There''s black ink I think, but no more color ink.mI''m going to get some fresh cartriges tomorrow. I don''t know that well how cups works, but can the lack of ink cause the "parallel failed" message? Almost there! Kind regards, -- Sander Marechal http://www.jejik.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On 3/21/07, Sander Marechal <s.marechal@jejik.com> wrote:> I am a few steps further but not quite there yet. The mknod did create > /dev/lp0. When I ran "printconf" after that, it recognised a HP DeskJet > 842c on the parallel port (close enough -- it''s an 840 in reality). I > don;t know how cups/printconf detects their printers but to me this > looks like good communication over the parallel port. lpstat -p says: > > printer deskjet_842c is idle. enabled since Thu 22 Mar 2007 12:39:29 AM UTC > > However, when I try to print something and run lpstat again to it I get: > > printer deskjet_842c disabled since Thu 22 Mar 2007 12:24:40 AM UTC - > /usr/lib/cups/backend/parallel failedPermissions? crw-rw---- 1 root lp 6, 0 Mar 16 19:34 /dev/lp0 jerry -- "Oh joy! Rapture! I''ve got a brain" -Scarecrow _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Jerry Amundson wrote:> Permissions? > crw-rw---- 1 root lp 6, 0 Mar 16 19:34 /dev/lp0Close. Very close :-) I tried printing the contents of the hosts file: # lp /etc/hosts request id is deskjet_842c-2 (1 file(s)) # lpstat -p -d printer deskjet_842c now printing deskjet_842c-2. enabled since Thu 22 Mar 2007 08:04:13 AM UTC But nothing is printed. This could easily be the ink problem so I am going to get some new cartridges first and try again. Thanks so far! -- Sander Marechal http://www.jejik.com _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users