FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 04-02-2011, 10:42 PM
Liam O'Toole
 
Default accessing shared printed from virtualbox client

On 2011-04-02, Steve Kleene <skdeb@syrano.acb.uc.edu> wrote:
> On Sat, 2 Apr 2011 20:33:25 +0000 (UTC), I wrote:
>
>> I have a Wheezy host, an XP virtualbox client, and an old LaserJet 5MP
>> configured with CUPS and connected by a parallel port. How can I access this
>> printer from the XP client?
>
> On Sat, 2 Apr 2011 20:52:13 +0000 (UTC), Liam O'Toole replied:
>
>> Assuming the virtualbox client uses NAT networking (the default), the
>> client can't connect directly to the host's CUPS daemon. Instead tell it
>> to connect to the virtual private address 10.0.2.0 or similar; see the
>> output of the route command on the guest to determine the precise
>> gateway address.
>
> Thanks, but I'm not there yet. On the XP client, I ran "route" from the
> command prompt and got, in part:
>
> route PRINT
> route ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1 METRIC 3 IF 2
> destination^ ^mask ^gateway metric^ ^
> Interface^

That gateway is an external, routable IP address. What sort of networking
are you using in virtualbox? Can you tell us more about the network
configuration within the XP guest OS?

>
> So I tried setting up an XP network printer at these two URLs:
>
> http://157.55.80.1:631/printers/LaserJet_5MP
> http://157.0.0.0:631/printers/LaserJet_5MP
>
> but neither was found. I also tried 192.168.1.0, which is shown by route on
> the Linux host. "LaserJet_5MP" is the correct Linux name for the printer,
> but I must still be doing something wrong.

You need to arrange for the XP guest to connect to the CUPS daemon on
the wheezy host (and configure the CUPS daemon to accept such
connections). I don't think that the router IP address is relevant here.

--
Liam O'Toole
Cork, Ireland


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: slrnipf9hr.3io.liam.p.otoole@dipsy.tubbynet">http://lists.debian.org/slrnipf9hr.3io.liam.p.otoole@dipsy.tubbynet
 
Old 04-02-2011, 10:48 PM
Steve Kleene
 
Default accessing shared printed from virtualbox client

On Sat, 2 Apr 2011 20:52:13 +0000 (UTC), Liam O'Toole replied:

> Instead tell it
> to connect to the virtual private address 10.0.2.0 or similar; see the
> output of the route command on the guest to determine the precise
> gateway address.

Route didn't give me such an address, but ipconfig /all gave me these:

IP Address 10.0.2.15
gateway 10.0.2.2

I tried this sort of thing as a URL for the network printer:

http://10.0.2.2:631/printers/LaserJet_5MP

but still no luck.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: loom.20110403T004759-522@post.gmane.org">http://lists.debian.org/loom.20110403T004759-522@post.gmane.org
 
Old 04-02-2011, 10:54 PM
Steve Kleene
 
Default accessing shared printed from virtualbox client

> What sort of networking
> are you using in virtualbox? Can you tell us more about the network
> configuration within the XP guest OS?

The virtualbox manager says
Adapter 1: PCnet-FAST III (NAT)

/etc/cups/printers.conf (see the original post) does say that the printer is
shared. At the CUPS web interface
(http://localhost:631/printers/LaserJet_5MP), though, the header says "Not
Shared". So I'm not sure about that.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: loom.20110403T005413-309@post.gmane.org">http://lists.debian.org/loom.20110403T005413-309@post.gmane.org
 
Old 04-02-2011, 11:04 PM
Liam O'Toole
 
Default accessing shared printed from virtualbox client

On 2011-04-02, Steve Kleene <skdeb@syrano.acb.uc.edu> wrote:
> On Sat, 2 Apr 2011 20:52:13 +0000 (UTC), Liam O'Toole replied:
>
>> Instead tell it
>> to connect to the virtual private address 10.0.2.0 or similar; see the
>> output of the route command on the guest to determine the precise
>> gateway address.
>
> Route didn't give me such an address, but ipconfig /all gave me these:
>
> IP Address 10.0.2.15
> gateway 10.0.2.2

Ah, that looks more familiar!

>
> I tried this sort of thing as a URL for the network printer:
>
> http://10.0.2.2:631/printers/LaserJet_5MP
>
> but still no luck.
>

We're getting there.

Is the the CUPS daemon listening on the external network interface of
the host OS as well as localhost? Is it configured to accept connections
from other than localhost? The log files under /var/log/cups on the host
OS will contain information on any refused connections.

(I don't have a Windows XP guest to hand, but I have just set up a RHEL
guest to use the host's CUPS system. It can be done.)

--
Liam O'Toole
Cork, Ireland


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: slrnipfash.3io.liam.p.otoole@dipsy.tubbynet">http://lists.debian.org/slrnipfash.3io.liam.p.otoole@dipsy.tubbynet
 
Old 04-02-2011, 11:22 PM
Liam O'Toole
 
Default accessing shared printed from virtualbox client

On 2011-04-02, Steve Kleene <skdeb@syrano.acb.uc.edu> wrote:
>> What sort of networking
>> are you using in virtualbox? Can you tell us more about the network
>> configuration within the XP guest OS?
>
> The virtualbox manager says
> Adapter 1: PCnet-FAST III (NAT)

OK, that's the default. We have established elsewhere that the host is
contactable from the guest as 10.0.2.2.

>
> /etc/cups/printers.conf (see the original post) does say that the printer is
> shared. At the CUPS web interface
> (http://localhost:631/printers/LaserJet_5MP), though, the header says "Not
> Shared". So I'm not sure about that.

Me neither, but I would place more trust in the file than the web
interface.

The file /etc/cups/cupsd.conf on the host will tell you on which
interfaces the daemon is listening.

--
Liam O'Toole
Cork, Ireland


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: slrnipfbt1.3io.liam.p.otoole@dipsy.tubbynet">http://lists.debian.org/slrnipfbt1.3io.liam.p.otoole@dipsy.tubbynet
 
Old 04-02-2011, 11:23 PM
"tv.debian@googlemail.com"
 
Default accessing shared printed from virtualbox client

Le 02/04/2011 22:33, Steve Kleene a écrit :
> I have a Wheezy host, an XP virtualbox client, and an old LaserJet 5MP
> configured with CUPS and connected by a parallel port. How can I access this
> printer from the XP client?
>
> In XP Add Printer, I tried to define a network printer at these URLs:
>
> http://127.0.0.1:631/printers/LaserJet_5MP
> http://192.168.1.2:631/printers/LaserJet_5MP
>
> but they were not found. (192.168.1.2 is my port on a local router; ifconfig
> shows it for eth0.) The CUPS interface at localhost:631 lists the connection
> site as "parallel:/dev/lp0".
>
> I have not set up Samba sharing. As shown below, /etc/cups/printers.conf
> shows the printer as shared, and I thought that should suffice.
>
> I gather virtualbox won't support the parallel-port connection directly. I
> did succeed with a USB-to-parallel adapter cable and defining a USB printer,
> but I'd rather use the CUPS shared printer if possible.
>
> Thanks.
>
> ------------------------- /etc/cups/printers.conf -------------------------
> <Printer LaserJet_5MP>
> Info HP_LaserJet_5MP
> Location office
> MakeModel HP LaserJet 5MP Postscript (recommended)
> DeviceURI parallel:/dev/lp0
> State Idle
> StateTime 1301774690
> Type 8425540
> Product (Hewlett-Packard HP LaserJet 5P)
> Filter application/vnd.cups-raw 0 -
> Filter application/vnd.cups-command 0 commandtops
> Filter application/vnd.cups-postscript 0 -
> Accepting Yes
> Shared Yes
> JobSheets none none
> QuotaPeriod 0
> PageLimit 0
> KLimit 0
> OpPolicy default
> ErrorPolicy stop-printer
> </Printer>
>
>

Hi, this is the correct way to do it :

http://192.168.1.2:631/printers/LaserJet_5MP

provided that LaserJet_5MP is the proper name of your printer (lpstat
-t). Then in cupsd.conf you need something like:

<Location />
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
Allow From localhost
Allow From @LOCAL
</Location>

to allow printing from different subnet, and you need port 631 opened.

I have win7 guests configured this way and it works fine.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4D97B000.3030104@googlemail.com">http://lists.debian.org/4D97B000.3030104@googlemail.com
 
Old 04-03-2011, 01:58 AM
Steve Kleene
 
Default accessing shared printed from virtualbox client

I'm getting behind (or maybe I started there).

On Sat, 2 Apr 2011 23:04:49 +0000 (UTC), Liam O'Toole wrote:

> The log files under /var/log/cups on the host
> OS will contain information on any refused connections.

If I try to set up a network printer on XP at

http://192.168.1.2:631/printers/LaserJet_5MP

there is no error in /var/log/cups/error-log, but the XP "Add Printer
Wizard" says

Windows cannot connect to the printer. Either the printer name was typed
incorrectly, or the specified printer has lost its connection to the
server.

If I try to set up a network printer on XP at

http://10.0.2.2:631/printers/LaserJet_5MP

I get the same Windows error, and /var/log/cups/error-log shows this:

E [02/Apr/2011:21:31:37 -0400] Request from "localhost" using invalid Host:
field "10.0.2.2:631"

On Sat, 2 Apr 2011 23:22:09 +0000 (UTC), Liam O'Toole wrote:

> The file /etc/cups/cupsd.conf on the host will tell you on which
> interfaces the daemon is listening.

It shows
Listen localhost:631
Listen /var/run/cups/cups.sock

On Sun, 03 Apr 2011 01:23:44 +0200, tv.debian@googlemail.com wrote:

> Hi, this is the correct way to do it :
>
> http://192.168.1.2:631/printers/LaserJet_5MP
>
> provided that LaserJet_5MP is the proper name of your printer (lpstat
> -t).

lpstat -t does show that name.

> Then in cupsd.conf you need something like:
>
> <Location />
> Order Deny,Allow
> Deny From All
> Allow From 127.0.0.1
> Allow From localhost
> Allow From @LOCAL
> </Location>
>
> to allow printing from different subnet

I put this in cupsd.conf and restarted /etc/init.d/cups. Then I tried to set
up the XP network printer with the URL you suggest, but I got the same XP
error shown above.

> and you need port 631 opened.

I'm not sure what this means. It is listed in /etc/services and in
cupsd.conf.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: loom.20110403T035814-685@post.gmane.org">http://lists.debian.org/loom.20110403T035814-685@post.gmane.org
 
Old 04-03-2011, 09:05 AM
Liam O'Toole
 
Default accessing shared printed from virtualbox client

On 2011-04-03, Steve Kleene <skdeb@syrano.acb.uc.edu> wrote:
> I'm getting behind (or maybe I started there).
>
> On Sat, 2 Apr 2011 23:04:49 +0000 (UTC), Liam O'Toole wrote:
>
>> The log files under /var/log/cups on the host
>> OS will contain information on any refused connections.
>
> If I try to set up a network printer on XP at
>
> http://192.168.1.2:631/printers/LaserJet_5MP
>
> there is no error in /var/log/cups/error-log, but the XP "Add Printer
> Wizard" says
>
> Windows cannot connect to the printer. Either the printer name was typed
> incorrectly, or the specified printer has lost its connection to the
> server.
>
> If I try to set up a network printer on XP at
>
> http://10.0.2.2:631/printers/LaserJet_5MP
>
> I get the same Windows error, and /var/log/cups/error-log shows this:
>
> E [02/Apr/2011:21:31:37 -0400] Request from "localhost" using invalid Host:
> field "10.0.2.2:631"

OK, that is making sense. CUPS is receiving a request from localhost
(because the guest OS is running on the host), but the guest is
providing the address 10.0.2.2:631 in the HTTP header of the request.

>
> On Sat, 2 Apr 2011 23:22:09 +0000 (UTC), Liam O'Toole wrote:
>
>> The file /etc/cups/cupsd.conf on the host will tell you on which
>> interfaces the daemon is listening.
>
> It shows
> Listen localhost:631
> Listen /var/run/cups/cups.sock

To work around the problem above, tell CUPS to listen on the external
network interface as well:

Listen *:631

And then configure the guest to connect to the external IP address of
the host, which appears to be 192.168.1.2:631.

>
> On Sun, 03 Apr 2011 01:23:44 +0200, tv.debian@googlemail.com wrote:
>
>> Hi, this is the correct way to do it :
>>
>> http://192.168.1.2:631/printers/LaserJet_5MP
>>
>> provided that LaserJet_5MP is the proper name of your printer (lpstat
>> -t).
>
> lpstat -t does show that name.
>
>> Then in cupsd.conf you need something like:
>>
>> <Location />
>> Order Deny,Allow
>> Deny From All
>> Allow From 127.0.0.1
>> Allow From localhost
>> Allow From @LOCAL

You will probably need the @LOCAL line advised by tv.debian.

>> </Location>
>>
>> to allow printing from different subnet
>
> I put this in cupsd.conf and restarted /etc/init.d/cups. Then I tried to set
> up the XP network printer with the URL you suggest, but I got the same XP
> error shown above.
>
>> and you need port 631 opened.
>
> I'm not sure what this means. It is listed in /etc/services and in
> cupsd.conf.
>
>


--
Liam O'Toole
Cork, Ireland


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: slrnipge2p.3io.liam.p.otoole@dipsy.tubbynet">http://lists.debian.org/slrnipge2p.3io.liam.p.otoole@dipsy.tubbynet
 
Old 04-03-2011, 01:20 PM
Steve Kleene
 
Default accessing shared printed from virtualbox client

On Sat, 2 Apr 2011 20:33:25 +0000 (UTC), I wrote:
> I have a Wheezy host, an XP virtualbox client, and an old LaserJet 5MP
> configured with CUPS and connected by a parallel port. How can I access this
> printer from the XP client?

Here finally is the minimal solution that worked. Based on the suggestions
from Liam O'Toole and tv.debian@googlemail.com, I added this to cupsd.conf:

<Location />
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
Allow From localhost
Allow From @LOCAL
</Location>

I also added this:

Listen drx:631

where drx maps to 192.168.1.2 (the host) in /etc/hosts. In the XP client, I
defined a printer at this URL:

http://192.168.1.2:631/printers/LaserJet_5MP

That's it. It works now.

I have some other notes. On Sun, 3 Apr 2011 09:05:29 +0000 (UTC), Liam
O'Toole had suggested:

> To work around the problem above, tell CUPS to listen on the external
> network interface as well:
>
> Listen *:631

Putting this line literally into cupsd.conf gave these errors in the log:

E [03/Apr/2011:08:58:03 -0400] Unable to bind socket for address 0.0.0.0:631 -
Address already in use.
E [03/Apr/2011:08:58:03 -0400] Unable to bind socket for address :::631 -
Address already in use.

I also tried

Listen 192.168.1.*:631

which gave

E [03/Apr/2011:08:59:49 -0400] Hostname lookup for "192.168.1.*" failed!
E [03/Apr/2011:08:59:49 -0400] Bad Listen address 192.168.1.*:631 at line 21.

but either of these worked:

Listen 192.168.1.2:631
Listen drx:631

I chose the second because I will only need to change hosts, and not
cupsd.conf, on occasions when the router goes out and the host (drx) ends up
with a new IP address. I guess I'll still have to redefine the client
printer's URL.

One oddity is that the XP client did nothing (appearing to hang) for 2-3 min
after I entered the printer URL. But then it came to life, and there is no
delay when printing.

Thanks much to both of you for your time and expertise. I would not have
figured this all out on my own.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: loom.20110403T151754-82@post.gmane.org">http://lists.debian.org/loom.20110403T151754-82@post.gmane.org
 
Old 04-03-2011, 03:15 PM
Liam O'Toole
 
Default accessing shared printed from virtualbox client

On 2011-04-03, Steve Kleene <skdeb@syrano.acb.uc.edu> wrote:
--- SNIP ---
> I have some other notes. On Sun, 3 Apr 2011 09:05:29 +0000 (UTC), Liam
> O'Toole had suggested:
>
>> To work around the problem above, tell CUPS to listen on the external
>> network interface as well:
>>
>> Listen *:631
>
> Putting this line literally into cupsd.conf gave these errors in the log:
>
> E [03/Apr/2011:08:58:03 -0400] Unable to bind socket for address 0.0.0.0:631 -
> Address already in use.
> E [03/Apr/2011:08:58:03 -0400] Unable to bind socket for address :::631 -
> Address already in use.

I suspect that is because you kept the line

Listen localhost:631

in the file as well. Once the daemon had bound to localhost it was
subsequently unable to bind to all interfaces --- because that would
require binding to localhost again!

>
> I also tried
>
> Listen 192.168.1.*:631
>
> which gave
>
> E [03/Apr/2011:08:59:49 -0400] Hostname lookup for "192.168.1.*" failed!
> E [03/Apr/2011:08:59:49 -0400] Bad Listen address 192.168.1.*:631 at line 21.
>
> but either of these worked:
>
> Listen 192.168.1.2:631
> Listen drx:631
>
> I chose the second because I will only need to change hosts, and not
> cupsd.conf, on occasions when the router goes out and the host (drx) ends up
> with a new IP address. I guess I'll still have to redefine the client
> printer's URL.

Some routers allow you to reserve an IP address for a particular client.
Another approach is to set up dnsmasq on your network and arrange your
own local DNS. But that is perhaps overkill for a small network.

>
> One oddity is that the XP client did nothing (appearing to hang) for 2-3 min
> after I entered the printer URL. But then it came to life, and there is no
> delay when printing.
>
> Thanks much to both of you for your time and expertise. I would not have
> figured this all out on my own.
>
>

You're welcome. I'm glad it's working now.

--
Liam O'Toole
Cork, Ireland


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: slrniph3or.3io.liam.p.otoole@dipsy.tubbynet">http://lists.debian.org/slrniph3or.3io.liam.p.otoole@dipsy.tubbynet
 

Thread Tools




All times are GMT. The time now is 09:49 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org