accessing my XP printer from Linux?
I have my printer connected to my Windows XP machine so everyone in the house can use it. But I can't access it from my Linux computer (Red Hat 8.0). I tried Samba but it only lets me share a local printer with others on the network. I use a Cable modem 4 port router to network and share access to the Internet (Linksys BEFSR41). Is there a way to configure Samba to allow me to access a printer on another computer, or is there any program that will accomplish this?
Thanks in advance
-=Mark=-
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Hi Mark,
It took a while before I was able to access network-printers, but what you most probably need is smbclient. You have to make an entry in your printcap-file (of course), then make an smbprint-script and a '.config' file for each networkprinter. Here are my files:
--- /etc/printcap :
[...]
smb0|SMB.HP.LJ4.normal.1:\ :cm=HP LaserJet 4 computerlokaal: :lp=/dev/smb0:\ :sd=/var/spool/lpd/smb0:\ :af=/var/spool/lpd/smb0/acct:\ :mx#0:\ :if=/usr/local/bin/smbprint
[...]
---
--- /usr/local/bin/smbprint (find some of these files on the net... but check the lines where I use a temporary file: on the net, you often find an other way of doing this, but it didn't work with me, and some people on this list helped me out):
#!/bin/sh -x
logfile=/tmp/smb-print.log
eval acct_file=\$$#
spool_dir=/var/spool/lpd/smb0
config_file=$spool_dir/.config
tempsmbprint=mktemp /tmp/smbprint.XXXXXX && sed 's/ //g' $config_file >$tempsmbprint && source $tempsmbprint && rm $tempsmbprint unset tempsmbprint
echo "server $server, service $service" >> $logfile
(
echo translate
echo "print -"
cat
) | /usr/bin/smbclient "\\\\$server\\$service" -U$user>> $logfile
---
--- /var/spool/smb0/.config :
server=LABMETSERVER service=HPLaserJ user=kurts password="xxxxxxxx"
---
Things are not completely like I want them right now, but at least, I can print. You can test some stuff, before you try the 'printcap'-thing etc. I did these things to test whether I could reach the printer:
$ gs -sDEVICE=ljet4 -sOutputFile=foo.hp foo.pdf $ smbclient //labmetserver/HPLaserJ -Ukurts passwd:
smb> print foo.hp
smb> quit
If this works, mess a bit with the printcap, .config and smbprint-file and things should get to work... By the way, I guess if you use redhed, there must be a kind of a tool somewhere. I remember there exists something like 'printtool' and it can search for networked printers (although it didn't work with me :-) ).
I hope this is an anwser to your question... or this can help you in some way.
Kurt.
Mail from Mark Johnson, sent on February 19 2003 at 23:42 (GMT-0800):
Quoted 16 lines
I have my printer connected to my Windows XP machine so everyone in the house can use it. But I can't access it from my Linux computer (Red Hat 8.0). I tried Samba but it only lets me share a local printer with others on the network. I use a Cable modem 4 port router to network and share access to the Internet (Linksys BEFSR41). Is there a way to configure Samba to allow me to access a printer on another computer, or is there any program that will accomplish this?
Thanks in advance
-=Mark=--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Signature · 7 lines
Common sense is the most evenly distributed quantity in the world. Everyone thinks he has enough. -- Descartes, 1637 - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs
Thanks Kurt for the help, but I have been working on CUPS lately and almost have it working. I found some help at HP.COM, as I have a HP 3820 printer, and got their latest drivers and used thier Red Hat install procedures. Then I used the CUPS configurator (localhost:631) and have been trying to get that working, but after I get everything entered in, I press the Print Test button and it tells me I don't have permission. I turned off the iptables (service iptables stop) and even disables the Norton firewall and still got no permission? maybe you can help me out on the naming conventions. cups wants the smb://server/sharename but I'm unsure which names convert from windows? is server the group name? is share name the computername? also I was asked by printtool what my name and password was, and there is no name or password setup on the XP box? It just has my name that I used to install windows? also do I use the XP's printer's share name in the path too? as in the sharename? or do I use the IP address for the server instead of the XP group name. As you can see I am starting to get a little confused :). In fact I'm too confused to even attempt your suggestions yet. I have too big of a headache right now.
If you or anyone else can help me get CUPS going or clarify the naming conventions I would really appreciate it.
Thanks in advance
-=Mark=-
Quoted 53 lines · Kurt Sys
Hi Mark,
It took a while before I was able to access network-printers, but what you most probably need is smbclient. You have to make an entry in your printcap-file (of course), then make an smbprint-script and a '.config' file for each networkprinter. Here are my files:
---
/etc/printcap:
[...]smb0|SMB.HP.LJ4.normal.1:\ :cm=HP LaserJet 4 computerlokaal: :lp=/dev/smb0:\ :sd=/var/spool/lpd/smb0:\ :af=/var/spool/lpd/smb0/acct:\ :mx#0:\ :if=/usr/local/bin/smbprint[...]
------
/usr/local/bin/smbprint(find some of these files on the net... but check the lines where I use a temporary file: on the net, you often find an other way of doing this, but it didn't work with me, and some people on this list helped me out):
#!/bin/sh -xlogfile=/tmp/smb-print.log
eval acct_file=\$$#
spool_dir=/var/spool/lpd/smb0
config_file=$spool_dir/.configtempsmbprint=
mktemp /tmp/smbprint.XXXXXX&& sed 's/ //g' $config_file >$tempsmbprint && source $tempsmbprint && rm $tempsmbprint unset tempsmbprintecho "server $server, service $service" >> $logfile
(
echo translate
echo "print -"
cat
) |/usr/bin/smbclient"\\\\$server\\$service" -U$user>> $logfile
------
/var/spool/smb0/.config:
server=LABMETSERVER service=HPLaserJ user=kurts password="xxxxxxxx"
---Things are not completely like I want them right now, but at least, I can print. You can test some stuff, before you try the 'printcap'-thing etc. I did these things to test whether I could reach the printer:
$ gs -sDEVICE=ljet4 -sOutputFile=foo.hp foo.pdf $ smbclient //labmetserver/HPLaserJ -Ukurts passwd:smb> print foo.hp
smb> quit
Quoted 6 lines
If this works, mess a bit with the printcap, .config and smbprint-file and things should get to work... By the way, I guess if you use redhed, there must be a kind of a tool somewhere. I remember there exists something like 'printtool' and it can search for networked printers (although it didn't work with me :-) ).
I hope this is an anwser to your question... or this can help you in some way.
Kurt.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Hello again,
I don't know a lot about CUPS, printer configuration etc. I just know how I managed to get it to work. Basically, I guess the following lines should work:
$ gs -sDEVICE=ljet4 -sOutputFile=foo.hp foo.pdf
this will convert a pdf-file to 'printer format' (in this case, HP Laserjet 4)
$ smbclient //labmetserver/HPLaserJ -Ukurts
Connect to the server, use as 'service' the printer HPLaserJ. labmetserver is the name of the computer (or IP-number, whatever you prefer, but your computer has to be able to resolve any name, so you can use the IP-number to be sure). I have an entry '157.193.64.19 lmeserv.rug.ac.be labmetserver' in my '/etc/hosts'-file. labmetserver is actually 157.193.64.19
My password is asked (I don't know how to work with it if not password protected, I think it shouldn't ask for one...) so I give it... and I can use the service HPLaserJ. Then, I can use some commands on this service, and one of these is 'print', which sends a file to the printer (the service I'm in). This should be a text file or 'printer type'-file (that's way I run the gostscript in the first line):
smb> print foo.hp
Just try this, and see where exactly you're stuck. Is it when you run 'smbclient', while you try to connect to the computer which shares a printer? And what error messages and warnings do you get?
Kurt.
Mail from Mark Johnson, sent on February 25 2003 at 21:19 (GMT-0800):
Quoted 42 lines
Thanks Kurt for the help, but I have been working on CUPS lately and almost have it working. I found some help at HP.COM, as I have a HP 3820 printer, and got their latest drivers and used thier Red Hat install procedures. Then I used the CUPS configurator (localhost:631) and have been trying to get that working, but after I get everything entered in, I press the Print Test button and it tells me I don't have permission. I turned off the iptables (service iptables stop) and even disables the Norton firewall and still got no permission? maybe you can help me out on the naming conventions. cups wants the smb://server/sharename but I'm unsure which names convert from windows? is server the group name? is share name the computername? also I was asked by printtool what my name and password was, and there is no name or password setup on the XP box? It just has my name that I used to install windows? also do I use the XP's printer's share name in the path too? as in the sharename? or do I use the IP address for the server instead of the XP group name. As you can see I am starting to get a little confused :). In fact I'm too confused to even attempt your suggestions yet. I have too big of a headache right now.
If you or anyone else can help me get CUPS going or clarify the naming conventions I would really appreciate it.
Thanks in advance
-=Mark=-Quoted 10 lines
Things are not completely like I want them right now, but at least, I can print. You can test some stuff, before you try the 'printcap'-thing etc. I did these things to test whether I could reach the printer:
$ gs -sDEVICE=ljet4 -sOutputFile=foo.hp foo.pdf $ smbclient //labmetserver/HPLaserJ -Ukurts passwd:smb> print foo.hp smb> quit
Signature · 8 lines
The difference between genius and stupidity is that genius has it's limits. -- Albert Einstein - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs