OpenVZ Forum


Home » General » Support » USB printer inside VE
USB printer inside VE [message #27140] Mon, 11 February 2008 03:52 Go to next message
kierse is currently offline  kierse
Messages: 5
Registered: February 2008
Location: Canada
Junior Member
Hi everyone,

I'd like to setup a print server (using CUPS) inside of a VE to access a USB printer thats connected to the HN. I've added the printers device node (/dev/usb/lp0) to the VE with the following comand:

vzct set 777 --devnodes usb/lp0:rw


and verified that it does appear in the VE's config file

DEVNODES="usb/lp0:rw "


When setting up the printer from within the CUPS web interface, the printer is correctly identified and listed in the list of supported/available devices. Unfortunately, after completing the setup, I am unable to print to the device. I don't see any errors on screen nor in any of the CUPS log files. What I do see is the following alert:

"Printer not connected; will retry in 30 seconds..."


The device node appears in the VE as /dev/usb/lp0 (same as the HN) and I seem to have both read and write permission as I can cat and echo the device without error. I've checked that the usb printing module (usblp) is compiled and loaded before attempting to use the printer.

I've come across a wiki posting (http://wiki.openvz.org/Printing_in_VE_with_Debian_stable) and a forum posting ( http://forum.openvz.org/index.php?t=msg&th=1350&#msg _7649) indicating that printing from within a VE is supported. Is there something I need to know or do in order to get USB printing working? Is running a CUPS server supported?

Thank,
Kierse
Re: USB printer inside VE [message #27270 is a reply to message #27140] Wed, 13 February 2008 10:05 Go to previous messageGo to next message
xemul is currently offline  xemul
Messages: 248
Registered: November 2005
Senior Member
Does this printer work from the ve0?
If it does, please, show the /proc/vz/devperms file contents.


http://static.openvz.org/userbars/openvz-developer.png
Re: USB printer inside VE [message #27291 is a reply to message #27270] Thu, 14 February 2008 06:07 Go to previous messageGo to next message
kierse is currently offline  kierse
Messages: 5
Registered: February 2008
Location: Canada
Junior Member
xemul wrote on Wed, 13 February 2008 03:05

Does this printer work from the ve0?


What is the ve0? I have verified that the printer works when connected to the hardware node (via cups), if that is what you are asking.

xemul wrote on Wed, 13 February 2008 03:05

If it does, please, show the /proc/vz/devperms file contents.


here ya go:

Version: 2.7
         0 b 016 *:*
         0 c 006 *:*


Kierse
Re: USB printer inside VE [message #27292 is a reply to message #27140] Thu, 14 February 2008 07:45 Go to previous messageGo to next message
xemul is currently offline  xemul
Messages: 248
Registered: November 2005
Senior Member
Quote:

I have verified that the printer works when connected to the hardware node

Yes, this was what I was asking about. That's good.

Quote:

here ya go:

Version: 2.7
0 b 016 *:*
0 c 006 *:*


OK. That's good.

Looks like configuration on HN and in VE differ. Can you strace the cups in both HN and VE, so that we could find the difference. Perhaps some proc file is missed, or empty, maybe some sysctl is RO for VE or some other problem.


http://static.openvz.org/userbars/openvz-developer.png
Re: USB printer inside VE [message #27332 is a reply to message #27292] Fri, 15 February 2008 05:30 Go to previous messageGo to next message
kierse is currently offline  kierse
Messages: 5
Registered: February 2008
Location: Canada
Junior Member
After reading your comments I realized that the VE wasn't running when I captured the output of /proc/vz/devperms. Here is the accurate data:

Version: 2.7
         0 b 016 *:*
         0 c 006 *:*
       777 c 006 180:0


where '777' is the VE that I'm trying to print from.

Quote:


Looks like configuration on HN and in VE differ. Can you strace the cups in both HN and VE, so that we could find the difference. Perhaps some proc file is missed, or empty, maybe some sysctl is RO for VE or some other problem.



I've included the output of strace from both the HN and the VE when starting the cups daemon. When diff'd, there does appear to be a considerable number of differences between the two files. However most seem to be the kind you'd expect to see when examining system calls (ie differing memory addresses, resource ID's, etc). There are a couple of places where one or the other is missing a large block but nothing obvious (to me anyway) really seems to stand out. Mind you I don't really know what I'm supposed to be looking for Embarassed

Kier
  • Attachment: HN.txt
    (Size: 144.86KB, Downloaded 360 times)
  • Attachment: VE.txt
    (Size: 133.17KB, Downloaded 330 times)
Re: USB printer inside VE [message #27553 is a reply to message #27332] Tue, 19 February 2008 14:46 Go to previous messageGo to next message
kierse is currently offline  kierse
Messages: 5
Registered: February 2008
Location: Canada
Junior Member
Any ideas?

Re: USB printer inside VE [message #33170 is a reply to message #27553] Fri, 26 September 2008 09:07 Go to previous messageGo to next message
abougeard is currently offline  abougeard
Messages: 3
Registered: September 2008
Location: Versailles, France
Junior Member
I've the same problem.
I'm a newby Embarassed
I would like to configure a printer in a VPS
But I d'ont understand what you mean when you talk about VE or HN.
VE=VPS??
Can you explain

[Updated on: Fri, 26 September 2008 11:12]

Report message to a moderator

Re: USB printer inside VE [message #33179 is a reply to message #27140] Fri, 26 September 2008 17:36 Go to previous messageGo to next message
kenjy is currently offline  kenjy
Messages: 50
Registered: July 2008
Location: Mexico
Member
VE= Virtual environment (your virtual machine)
HN= Hardware Node (your physical machine)

Reading the user guide and the wiki should help you to understand and to learn to work with openvz.


http://kenjy.net |Live net !!!
Re: USB printer inside VE [message #33187 is a reply to message #33179] Sat, 27 September 2008 08:12 Go to previous messageGo to next message
abougeard is currently offline  abougeard
Messages: 3
Registered: September 2008
Location: Versailles, France
Junior Member
I'm sorry but terms used in that topic are different from official documentation.
Could ypu help me about my usb problem?
Re: USB printer inside VE [message #33715 is a reply to message #27140] Mon, 03 November 2008 01:01 Go to previous messageGo to next message
strites is currently offline  strites
Messages: 1
Registered: October 2008
Junior Member
I have also problem with this:

I got to get cups work with an usb printer from inside a VE.

(in this case the printer is an epson cx3650)

I did "vzctl set 631 --devnodes usb/lp0:rw"

I can get escputils to show ink level from inside the VE, using the method requiring r/w to /dev/usb/lp0 works.

CUPS doesn't find the printer (when it comes to the "select device" part, no usb is listed.

Do I have to add something?
Re: USB printer inside VE [message #33751 is a reply to message #33715] Sat, 08 November 2008 10:55 Go to previous messageGo to next message
Tenyo is currently offline  Tenyo
Messages: 5
Registered: November 2008
Junior Member
Hi all!
I've started using openvz 1 month ago... wonderful project!
Same problem here... (with openvz 2.6.26 compiled from git)

Cups doesn't show the usb printer (an epson epl-6200l in my case).
I've used the same procedure successfully used in other VEs before:

1. created the the devices with mknod identical to the ones in the HN
2. exposed the devices in the VE

This worked perfectly in an MythTV and in an MPD VE, but not in this one.

[Updated on: Sat, 08 November 2008 12:00]

Report message to a moderator

Re: USB printer inside VE [message #34045 is a reply to message #33751] Thu, 27 November 2008 13:13 Go to previous messageGo to next message
Tenyo is currently offline  Tenyo
Messages: 5
Registered: November 2008
Junior Member
SOLVED!!!

Pretty easy I've to admit, tested with Gentoo (HN and VE):

1) in HN lsusb to identify numbers relative to the usb port and the attached printer
Bus 008 Device 005: ID 04b8:0005 Seiko Epson Corp. Stylus Printer
Bus 008 Device 001: ID 1d6b:0001 


2) in VE go to /dev/bus/usb, create a directory equal to the Bus number and create there with mknod 2 devices: 1 for the usb port and 1 for the pritner with the same device number in HN
crw-rw-r-- 1 root usb 189, 896 Nov 26 08:58 001
crw-rw-r-- 1 root usb 189, 900 Nov 27 12:29 005


3) now create in VE a device similar to the one in HN for the usbprinter and a link if needed:
crw-rw-rw- 1 root lp 180, 0 Nov  7 19:32 lp0

lrwxrwxrwx 1 root root 7 Nov 26 17:51 usblp0 -> usb/lp0


4) time to add devices permission on your VE configuration file:
DEVICES="c:180:0:rw c:189:896:rw c:189:900:rw"


5) start the VE end enter, with lsusb you should see both devices: the port and the printer

6) Cups should find the printer attached to the usb port

Good Luck Smile
Re: USB printer inside VE [message #34047 is a reply to message #34045] Thu, 27 November 2008 14:58 Go to previous messageGo to next message
abougeard is currently offline  abougeard
Messages: 3
Registered: September 2008
Location: Versailles, France
Junior Member
wow,

I'm just a little small in linux to complete all your method.

could you add to the post the command that do what you explain?

arnaud
Re: USB printer inside VE [message #34056 is a reply to message #34047] Fri, 28 November 2008 14:24 Go to previous messageGo to next message
Tenyo is currently offline  Tenyo
Messages: 5
Registered: November 2008
Junior Member
I've written an howto...
hope this helps:

http://wiki.openvz.org/USB_Printing_in_VE

Bye^^
Re: USB printer inside VE [message #34061 is a reply to message #34056] Fri, 28 November 2008 17:23 Go to previous message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Thank you very much.

We appreciate your kindness!
Previous Topic: WINS samba server in VE
Next Topic: AFP or CSF on vzID
Goto Forum:
  


Current Time: Fri May 10 01:29:40 GMT 2024

Total time taken to generate the page: 0.01569 seconds