LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-24-2004, 08:56 PM   #1
RogueWave
LQ Newbie
 
Registered: Jan 2004
Location: Toronto, Canada
Distribution: slackware
Posts: 13

Rep: Reputation: 0
samba/cups: lp from linux to Windows


Hi,

Linux newbie running slackware kernel 2.4.22.

I have samba working for file sharing... I can get files back and forth from my Linux PC to my Windows XP PC.

I've been trying to get the "lp" command working so that I can print files from my Linux PC to the printer attached to my Windows PC. I am able to print directly if I used the smbclient like this:

echo "hello world"| smbclient //desktop2004/Printer -N -c "put -"

I have been trying to use the following commands to set up my lp command to do the same sort of thing, but it's not working. Here's what I did:

/usr/sbin/lpadmin -p HPOfficeJetG55 -v smb://DESKTOP2004/Printer -P /root/HP-OfficeJet_G55-hpijs.ppd
/usr/bin/enable HPOfficeJetG55
/usr/sbin/accept HPOfficeJetG55
/usr/sbin/lpadmin -d HPOfficeJetG55

And here's what happens when I try to use lp:

root:/etc/cups > echo "hello world"| lp
Status Information, attempt 1 of 3:
sending job 'root@MyLinuxBox+449' to HPOfficeJetG55@localhost
connecting to 'localhost', attempt 1
cannot open connection to localhost - No such file or directory
Make sure the remote host supports the LPD protocol
Waiting 10 seconds before retry

The lp command seems to default to "localhost", even though I've used the lpadmin command to set the default printer to use the windows printer through samba. I have the cups server running with the default .conf files.

Does anyone have any ideas on how I could fix this?
 
Old 01-25-2004, 11:45 AM   #2
tricky_linux
Member
 
Registered: Jul 2003
Distribution: Red Hat Linux 9.0; Old and Solid
Posts: 674

Rep: Reputation: 30
i don't think it's neccessary to go through all that stuff it your linux and wind* have the same workgroup.
linux should automatically see that printer and all you have to do was add a network printer.
 
Old 01-25-2004, 04:08 PM   #3
RogueWave
LQ Newbie
 
Registered: Jan 2004
Location: Toronto, Canada
Distribution: slackware
Posts: 13

Original Poster
Rep: Reputation: 0
I have changed my Linux workgroup to be the same as my Windows work group, by modifying smb.conf, if that's what you mean. In Network Places, my Windows PC and Linux PC now appear under the same workgroup. But nothing else has changed.

"linux should automatically see that printer" Where? Which command do I run to automatically see that printer?

"and all you have to do was add a network printer" I don't understand... I thought network printers have there own IP addresses, whereas a printer attached to a Windows PC is accessed through Windows Networking or samba? And if I were to add it as a network printer how would I do so? All my research on Linux printing keeps on pointing me back to samba and cups....
 
Old 01-26-2004, 10:33 AM   #4
tricky_linux
Member
 
Registered: Jul 2003
Distribution: Red Hat Linux 9.0; Old and Solid
Posts: 674

Rep: Reputation: 30
what name are you using to share your printer?
i assume that you shared it as "lp" and that computer's ip address was 192.168.0.1.
then the printer's ip address would be "\\192.168.0.1\lp".
also, you have to use the same user passwd in order to print.
just use samba to see if it can see your shared printer.
you add your printer by running "redhat-config-printers" or "redhat-config-printer" can't remember which one was right.
 
Old 01-26-2004, 11:16 AM   #5
RogueWave
LQ Newbie
 
Registered: Jan 2004
Location: Toronto, Canada
Distribution: slackware
Posts: 13

Original Poster
Rep: Reputation: 0
As per my initial post, the name I am using to share my printer is //desktop2004/Printer. This works with the smbclient, as described above.

My windows computer is on 192.168.1.2 I am running slackware, not redhat.

more info:

root:/root > smbclient -L desktop2004 -N
added interface ip=192.168.1.3 bcast=192.168.1.255 nmask=255.255.255.0
Got a positive name query response from 192.168.1.2 ( 192.168.1.2 )
Domain=[DAVESWORLD] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

Sharename Type Comment
--------- ---- -------
E$ Disk Default share
IPC$ IPC Remote IPC
print$ Disk Printer Drivers
SharedDocs Disk
G$ Disk Default share
Downloads Disk
CDRW Disk
F$ Disk Default share
Printer2 Printer CutePDF Printer
ADMIN$ Disk Remote Admin
C$ Disk Default share
Printer Printer hp officejet g series

Server Comment
--------- -------
DESKTOP2004 Home Office Desktop PC
MYHOST Samba Server

Workgroup Master
--------- -------
DAVESWORLD DESKTOP2004
 
Old 10-31-2005, 08:45 AM   #6
carletto
LQ Newbie
 
Registered: Oct 2005
Location: Italy
Posts: 2

Rep: Reputation: 0
Hello

I have now the same problem you had on "network printing" with Linux.

And I am much more novice than you were.

Have you solved that problem?
How ?

I have the printer on an XP Professional PC.
Attached to an Ethernet cable I have a PC without printers and with:
--XP Home
--Debian Linux.

Bye and thxs
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant print using samba and cups to a windows printer araldit Linux - Networking 5 11-27-2007 09:21 PM
samba + cups + windows xp + fedora c2 jonthelam Linux - Software 9 02-14-2006 12:05 PM
SAMBA & CUPS (Linux & Windows Printing) xcythe Linux - Networking 4 06-12-2005 11:46 AM
How to connect Windows printer (cups+Samba)? Waldi Slackware 8 08-31-2003 03:11 PM
Windows printing to CUPS via Samba JahToasted Linux - General 0 08-22-2003 02:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration