# Printing from Gentoo to a shared Windows XP printer via Cups

## hulk2nd

Ok,

for the first, hi at all!

In this thread i'm gonna try to explain, how to use a shared printer, that is connected to a Windows XP machine in your lan.

It isn't hard at all but it took me hours to get it working cause i couldn't find a good tutorial, that's why i decided to write this one.

I'll try to explain it with the help of what i've done here:

1. My computers:

a) My windows XP computer is called "jimbo", the ip is 192.168.0.3, the standard user is hulk ( pass xxxxxxx ) and the connected printer is an epson stylus c62.

- share the printer by right-clicking on it and give him a simple name, in my case "epsonc62".

- disable any firewalls ( you can configure it later but first we will make sure that printing will work at all ).

b) My Gentoo machine is a vaio notebook, called hulktop, the ip is 192.168.0.22

2. the requirements:

make sure that your xp machine is in your /etc/hosts. i couldnt get it working with the ip adress only.

in my case it is:

```
192.168.0.3     jimbo.spengnet.lan         jimbo
```

optionally you can add "cups" to your USE-Flags, but this is not necessary.

the programs we need:

```
emerge samba

emerge cups

emerge psutils

emerge ghostscript

emerge gnome-print (optional)
```

it seems that you need the "HP Inkjet server for Ghostscript", if you have a Hewlett Packard printer.

```
emerge hpijs
```

now you need a driver for your printer. you can either go to www.linuxprinting.org to get the .ppd file for your printer ( in my case Epson-Stylus_C62-gimp-print-ijs.ppd ), or you can 

```
USE="ppds" emerge gimp-print
```

 to get all available gimp-print drivers.

else just do

```
emerge gimp-print
```

if you choosed just to download the file from linuxprinting.org, then you have to copy it over to 

```
/usr/share/cups/model/
```

( strangefully i experienced, that the downloaded driver for my printer from linuxprinting.org prints faster than the driver from the gimp-print package. even with the same settings ... )

3. the installation

now we start cups:

```
/etc/init.d/cupsd start
```

open your favourite browser and go to http://localhost:631/

go to "manage printers". if you're asked for a password type in your normal root account infos. the first three informations (name, location, description) can be filled just like you want. i choosed to name it epsonc62 but i don't think it is needfull that this name is the same one that you gave your printer on the xp machine. click continue. choose "Windows Printer via SAMBA". click continue.

then tipe in the location: 

```
smb://username:pass@workgroup/host/printer
```

in my case this is 

```
smb://hulk:xxxxxxx@msheimnetz/jimbo/epsonc62
```

maybe it is working with the normal guest account so i suggest you'll try this first before using your normal login.

```
smb://guest:@workgroup/host/printer
```

click continue.

choose the vendor of your printer ( in my case epson ), continue

choose your printer model eg the driver you installed earlier, continue

if I didn't forget something and everything went well, you should now be able to print the test page.

the last thing is to add cups to runlevel default so that the printer works everytime you reboot.

```
rc-update add cupsd default
```

comments, critics and feedbacks in any case are very welcome  :Smile: 

greets,

hulkLast edited by hulk2nd on Mon Oct 27, 2003 1:40 am; edited 8 times in total

----------

## TheWart

Nice guide.

I am going to print this out, cause when I go home for vacation, I am going to have to do this.

----------

## hulk2nd

i hope it can help you. it would be nice to get at least one positive feedback so that i know everything works well ( i had to edit it several times already, cause i forgot somethin ).

greets,

hulk

----------

## RedBeard0531

GOOD TIMING!!!  :Wink: 

I needed this today. Great job. You might want to consider submiting this to the gentoo-docs team, and mabey others so it can be googled. It continues to amaze me that there are beter docs in the forums of a reletively unpopuler (in terms of users, I personaly love it) distro than on google!!!  :Twisted Evil: 

----------

## a.zapatista

thank you thank you thank you thank you   :Razz:   :Razz: 

----------

## hulk2nd

so, it seems to work  :Very Happy: 

i'm glad i could have helped you.

greets,

hulk

----------

## thomasando

i can't get it working! i'm trying to print to a machine on the other side of a VPN at my parents house. the connection is up, i can browse samba shares etc from my machine, i can ping the systems on the other side, just cups doesn't want to talk... i have put the ip address and hostname of the system it's connected to in /etc/hosts and tried connecting using the hostname as well as the ip address and it doesnt like it.

my internal subnet is 192.168.0.x and the one at my parents house is 192.168.1.x - the vpn is ipsec, done via 2 smoothwall boxen. Has anyone got any ideas on how i might get this running?

edit: the system on the other side of the vpn with the printer attached is windows 2000. i'm trying to print from gentoo (of course!)

----------

## hulk2nd

this normally happens when you forget to enter username / pass in the string, wihile trying to connect to the printer.

```
smb://username:pass@workgroup/host/printer
```

----------

## Raniz

Works Great!

----------

## Darkon

Works for me ;)

----------

## XeroByte

doesn't work for me... when I try to print the test page or something other it says: 'aborted'. Can't figure out why it doesn't work :/

EDIT: and when I click on 'Restart Job' it says: 'client-error-not-possible'

seems like there's something wrong with the XP-machine

----------

## MatzeOne

the only windows i didn't removed of my pcs is windows millenium on my laptop... will it work with this guide? i'll try if you don't say no  :Wink: 

----------

## Eddy

 *XeroByte wrote:*   

> doesn't work for me... when I try to print the test page or something other it says: 'aborted'. Can't figure out why it doesn't work :/
> 
> EDIT: and when I click on 'Restart Job' it says: 'client-error-not-possible'
> 
> seems like there's something wrong with the XP-machine

 

I have the same problem   :Sad: 

----------

## hulk2nd

have you guys disabled all your firewalls?

----------

## XeroByte

yeh, firewall is disabled...

----------

## Koybe

strange... works well with test page and i get blank page for anything else   :Shocked: 

----------

## hulk2nd

these problems are really strange. the problem is that i don't have any experience with these.

@xerobyte: maybe you typed the password / username wrong? i had the same problem when i forgot to enter it.

@Koybe: have you tried to use another .ppd file? maybe another driver would solve these problems.

----------

## XeroByte

no, they're correct (username and password)... reconfigured it several times tho to check if they weren't wrong... but is it normal that in printer overview only smb://workgroup/host/printer appears without the username und password in it?

----------

## hulk2nd

yes, thats normnal.

have you tried to ping the other computer so that you at least can be sure that it is not a connection problem?

if not try it with ping <ip> and with ping <host>

greets,

hulkLast edited by hulk2nd on Fri Oct 10, 2003 10:39 am; edited 1 time in total

----------

## XeroByte

yes, ping works without any problems... looks somehow like the xp machine rejects any incoming printer jobs...

----------

## hulk2nd

hmm just for fun, try it with administrator as the username (and of course with the admin pass).

maybe it is a rights-problem.

----------

## XeroByte

doesn't work neither  :Sad: 

----------

## Koybe

how maybe the problem is i have a canon s750 and found no ppd for it... so i'll try some of it. 

Another question when i'll have it work how can i put the "cups start" at boot for not having to type it each time?

----------

## hulk2nd

```
rc-update add cupsd default
```

----------

## Koybe

I should have guest but i'm noob :p sorry

----------

## MatzeOne

 *Koybe wrote:*   

> how maybe the problem is i have a canon s750 and found no ppd for it... so i'll try some of it. 
> 
> Another question when i'll have it work how can i put the "cups start" at boot for not having to type it each time?

 

i foolowed the instructions and it works...

i have a canon s750, too... i used the cups driver for canon s800... good quality here on the test pages  :Smile: 

----------

## Sevein

"Connection failed with error NT_STATUS_ACCESS_DENIED" 

This is the error messange that I can see when I am in my cups web-server configuration system, in the manage printers.

Description: Impresora laser en blanco y negro

Location: Conectada al ordenador de la salita (salita.tomareswireless.sewi)

Printer State: idle, accepting jobs.

"Connection failed with error NT_STATUS_ACCESS_DENIED"

Device URI: smb://SEVEIN/PC-SALITA/impresora

Should I put some password? But the printer in the XP system dont need passwords!  :Sad: 

----------

## ToryGA33

I've been following this thread hoping for a solution to my problem.

I was having the issue above of all the print jobs going to an "aborted" status.

I finally was able to determin after adding "debug" to the cups config file that there was a program missing.

"hpijs"

I ran "emerge hpijs", and tried again and low and behold, a perfect page.

I never ran accross a single source that mentioned this program.  I only figured this out after going carefully through the error log.

I hope someone finds this information useful.

BTW, my printer is an HP Photosmart 7150.

Cheers!

----------

## XeroByte

 *ToryGA33 wrote:*   

> I've been following this thread hoping for a solution to my problem.
> 
> I was having the issue above of all the print jobs going to an "aborted" status.
> 
> I finally was able to determin after adding "debug" to the cups config file that there was a program missing.
> ...

 

yeh... thank you... took a look at the error log file and had to install gimp-print... now all works fine!

----------

## cbolin

I want to thank you for this post and highly rec'd you submit it as a FAQ.  It worked perfectly the first time for me.

Thanks.

----------

## hulk2nd

@Sevein

try to use your windows username / pass. if you haven't set one until now, try to create another user with password and enter these account infos into the string. i normally have a pass set on my xp machine but i've read somewhere on the net, that it doesn't without it.

I'm sorry for all the people who can't get it working. and I'm glad that it works for some people, but there is one thing for sure: I'll try to get the thread with your comments, experiences, solutions and help up to date so that it will work as much as possible   :Very Happy: 

thanks and greets,

hulk

----------

## ToryGA33

Hulk,

Just wanted to add a thank you.  Even though I had some problems, I wouldn't have known where to begin without your post.

So THANKS!!

--Tory

----------

## billbalt

Normally, a Windows printer is shared with Everyone/Print permissions. No password is required to access the printer.

To print to a printer configured in this manner from Linux using SMB/CUPS, you must connect using the guest account using no password.

When you don't set it up properly, you get this error:  "SMB tree connect failed: NT_STATUS_ACCESS_DENIED" 

If you get this error, go to http://localhost:631. As you are adding or modifying your printer, when you get to "Device URI:" ,  enter " smb://guest:@computername/printsharename".

----------

## mhenley

What would i need to change on this procedure if I cant guarantee a specific IP address due to using DHCP on the network.  Its a Win2000 machine with the printer.

----------

## xavan

Great job   :Very Happy: 

----------

## Yamakasi

Yes!!!!!

It works!

Thx so much for the guide Hulk...I was working on that forever!  :Smile: 

----------

## cranch

Is there anyway for the currently logged on user to access the printer without using the guest account?  I disable my guest account for security reasons....

----------

## hulk2nd

i think you can use every user that is able to print. just try it. my xp machine is currently broken so i can't test it by myself.

greets,

hulk

----------

## nukes

Thanks man! This worked great for me!!  :Smile: 

 :Cool: 

----------

## NewBlackDak

Just a tip.  On the windows machine(NT, 2K, XP) you can go to add/remove programs, click on add/remove windows components, click on other network file and print services, click on print services for Unix.  Hit ok a couple times.  Then share out your printer with a simple name-eg.  no spaces, no weird characters, only 0-9, a-z, or A-Z.  Then you can lpr print jobs to the machine.  It server is just the IP or qualified domain name of the machine you're trying to print to, and the queue is the name you used to share the printer.  I find this to be MUCH more reliable and gobs faster than smb-printing.  

At work I have our printers setup like this.

Machine (2K server) hanging off the central switch with 2 NICS.  First NIC is on the Central Switch with gigabit, second goes to a 16Port switch via 100bT that's not tied into the rest of the network.  All printers are on the second switch, and installed on the server which has "Print Services for Unix", and "Appletalk File/Print Services" installed.  Each printer is shared out with a simple, but descriptive name.  All print jobs are handled by this machine.

----------

## Boris27

Do the IP's have to be static? Im on DCHP, but can disable that.

----------

## NewBlackDak

no.  If the machines get domain names, you don't need static IPs.

----------

## basvdijk

Hi there,

I've got problems with printing on a windows 98 printer (HP deskjet 710C).

As url I typed: smb://192.168.0.5/HP710C. I get the following error: 

```
"Unable to connect to SAMBA host, will retry in 60 seconds...ERROR: Connection failed with error NT_STATUS_UNSUCCESSFUL".
```

 I have no idea what the problem is. I tried to create a guest account on the Win98 machine but this is quite difficult in win98. The default username is "ico van dijk"  maybe there is some problem with the spaces. Can someone help me?

edit: Just figured out, if I connect with nautilus to "smb://192.168.0.5" nautilus prompts for a password. If I use "smb://guest:guest@192.168.0.5" it connects without prompting for a password. I also tried to use this string (smb://guest:guest@192.168.0.5/HP710) in cups but got the same error as described above...Last edited by basvdijk on Tue Nov 18, 2003 10:10 am; edited 1 time in total

----------

## wb1975

Hi everyone 

 the phaser 3110 reported to be gdi printer , I plan to print from my win2k client 

 to this gentoo box via raw printing ... I have uncomment the two file ( in samba with cups )

 but everytime the prin job started , the printer just blinking ... 

 what happen to this printer ? I manage to print if connected to win2k directly using 

 parallel port or usb port 

 thanks 

wb

----------

## RedNeckCracker

Just my two cents, i had to install ijs for my epson EPL 5900L to make it working

(here http://epsonepl.sourceforge.net/ )

----------

## miracle

Hi, your tutorial worked fine on my system:

I print from a laptop with gentoo toward an Epson EPL-5900 PS connected on my office desktop with win2000Pro. 

I print from every office like program and/or editor (I configured it in KDE 3.2 printer utility aswell) but I don't see it in my Mozilla printers window. It shows only "PostScript/default" in the printers tab/list. How do I overcome this?

Thank you.

Miracle

----------

## d3vr0n

What if the printer connected to the Windows machine is not Linux-compatible?

In my case, I run Gentoo on my personal computer and the family computer runs Windows 2000. The Lexmark X5150 is connected to the Windows computer and is absolutely not compatible in Linux. I suppose I'd need some sort of print server service running on the the Windows machine. Ideas anyone?

----------

## UberLord

All you really need to print via CUPS is the PPD file which should be included with the Windows drivers.

----------

## d3vr0n

So, you're saying my printer is compatible with Linux+Cups? Or just accross a network?

I haven't seen anything about being able to print locally to it. I find that strange because when I booted Gentoo with the printer connected, the kernel saw the printer ("USB Bidirectional Printer") and the scanner ("HID compliant something or other").

It'd be nice if I could Gentoo that box instead of running W2k.

I'm trying to get the rest of my computers and family weened off of Windows.

----------

## JakeP

Im having the 'aborted' problem with my hpLaserJet1000. How would i enable debugging in cups, to see what program i should install?

----------

## mafe

```

http://chrishiller.net/archives/misc_tech/index.php

Broken CUPS

If you get a CUPS error message (generally in /var/log/cups/error_log ) which looks like:

PID #### stopped with status 22!

Go into your CUPS config (usually /etc/cups/cupsd.conf ), and set LogLevel to debug. Restart the CUPS server (on Redhat, usually done by /etc/rc.d/init.d/cups restart ). Try to print again, and then examine the error log.

If you see this:

/usr/lib/cups/filter/foomatic-rip: No such file or directory

Then you should download, compile and install the foomatic-filters. It will help you.
```

IT worked for me.

----------

## lambo

Just want to say thanks, I spent several days trying to print to my XP box, trying to follow the instructions on other posts.  I'm surprised Samba is still working with all of the changes I made.  Following your instructions I was able to get this up in 10 minutes.   :Very Happy: 

----------

## kpitty

Thanks for your guide.  It was just what I needed.   :Very Happy: 

----------

## Propagandhi

Good guide. Just what i needed after several painful hours of trying to get the printer work on gentoo and share the printer to windows. 

Easier this way, works like a charm. (and besides, my missus with her win-comp mostly uses the printer anyways)

----------

## Shrekkie

Hulk !!!

Thnx alot man ! I had a problem, but your tip , adding user and pass to the URI did it ...

 :Very Happy: 

Gentoo Forums pWn them all !!!!

----------

## thechosen0ne

This was exactly what I needed!!!

I could NOT get the IP address to work. I hadn't even thought of adding an entry to the /etc/hosts file. This stopped my "Unable to connect to SAMBA host" problems. This seems like maybe it's a problem with samba or cups as I would think it should work using ip's and not rely on name resolution...

Thanks!

[EDIT] 

Nooo! I'm so close... Windows says it's printing and the printer sounds like it's getting ready to print but the little light on the printer just blinks...  :Sad: 

http://www.linuxprinting.org/pipermail/samsung-list/2002q4/000378.html

this looks like it's close to the problem I'm having, but with RH... not Gentoo... any ideas? BTW I am using an HP PSC 1210

http://www.linuxprinting.org/pipermail/hp-list/2003q4/004324.html

This is another good description of my problem, same printer, mandrake

[EDIT]

OMG OMG OMG I can't believe it works... 

The solution is insanely simple. Go into your printer properties in Windows. Under the Ports tab, disable Bidirectional Support. Apparantely the printer is waiting for some sort of confirmation before starting to print.

I have never been so happy to see a printer test page in all my life. 

Let me know if this helps anyone else.

----------

## smukec

I bumped into a samba problem solving printing.

 It seems I'm having problems with samba in first place.

In the network there are 5 PCs(3xWin + 2xgentoo). I can't any share info from the Win boxes(XP and 2k).  And one of those win boxes is sharing the printer (because it is a HP PSC and they want to scan in windows) - previously we run the printer on a gentoo box with no problems.

 From the 'smbclient PRNBOX' I can see that it tries to access IP:139 which is (apparently) not listening on any of those win machines. I suppose the problem is on the win side.

 Whan would you propose, how to proceed now.

----------

## flashingcurser

Ya, me too.

ERROR:

client-error-not-possible

Any new thoughts on this problem?

----------

## fop

Same error as flashingcurser and a bunch of other people...

EDIT:

https://forums.gentoo.org/viewtopic.php?t=133668

This post helped me. However, since the Windows machine with the printer uses DHCP, the IP changes every once in a while. I have to change the IP in /etc/hosts accordingly. Is there a way around this?

----------

## ender.wiggin

hi, cool guide  :Smile: 

e.

----------

## tecknojunky

When I arrive to where you specify the URI, there is no WINDOWS SHARE printer listed.

EDIT: I mistakenly thought that the samba server was unneeded for cups to use a windows shared printer.  :Embarassed: 

----------

## brain salad surgery

i tried from gentoo to a windows XP pro printer share:

won't work using guest account

won't work using administrator account

gotta use a normal account + passwd

as mentionned

----------

## brain salad surgery

i tried from gentoo to a windows XP pro printer share:

won't work using guest account

won't work using administrator account

gotta use a normal account + passwd

as mentionned

----------

## meulie

 *RedNeckCracker wrote:*   

> Just my two cents, i had to install ijs for my epson EPL 5900L to make it working
> 
> (here http://epsonepl.sourceforge.net/ )

 

And I had to emerge foomatic to get my Xerox Docuprint M750 working...     :Cool: 

----------

## brasuca

i'm trying to use a hppsc700 connected to a xp box, trying to use it with samba.  I configure it, but when I try to print a test page, it used to say "host not found".  Now it says connection refused.

----------

## fuhreal

THANK YOU !!! Worked like a charm !!

Only had to use the computers name as the IP wouldn't work for some reason.. oh well, i don't change my coputers names so i need not worry.  Just hope i can remember this in case i have to print while on-site  :Wink: 

----------

## m9dhatter

i managed to get the shared printer working. i have a lexmark optra t612. my problem is that the printer seems to squeeze two pages in a single sheet although everything in the config shows up as normal and intended ( single sheet, landsacape view ). even the test page shows up in only one side. how do i resolve this?

----------

## L.U.

Just another thank you post. Spent over a day trying to get my particular printing set-up working before I found this post. Once I did find it, I was done in 20 minutes.   :Very Happy: 

----------

## makzu

Worked perfectly for me.  Thanks!

 *TheWart wrote:*   

> I am going to print this out, cause when I go home for vacation, I am going to have to do this.

 

Ha ha, I get it, you're printing out the printer setup guide.  It's a catch-22!

----------

## Stormy

Hi, I've been dealing with this for hours now,   after working hard with smbclient to finally be able to mount the printer and put a text file there (it prints) to finally being about to actually mount the printer to a directory (/printer) i can't seem to get cups to grab on and print and I think I know why,  the problem lays in the fact that we use a domain and that the printer is shared useing a local user/pass (we tryed domain/pass still same problem)  i was able to get the previous two connects to the printer useing "austin\printer:printer" to connect to the bad boy, were talking standard laser printer supporting PCL 6 here, i've tryed to go into the cups web interface and tell it smb://austin\printer:printer@austin/Laser and it sits there and looks at me with a NT_STATUS_ACCESS_DENIED so i'm sure that this is comming from the fact that it's trying to ask about printer in the domain or whereever it is, in our smb.conf file we have specified that the workgroup='ed the domain, now we've tryed different logins on the cups side, and going as far as useing the local and the domain administrator user/password with still problems, my last guess is going to try and be useing the command line to do this and see if it comes up.  If anyone else has seen this and found a good work around please let me know.

Update:  I installed it off the command line and it worked fine!

----------

## olias2

Thanks for this guide. It worked great for me with the guest:@ and no password. I only had to emerge the following...

```
samba

cups

gnome-print
```

I left out psutils and ghostscript because I don't really know what they're for.  :Question: 

Olias   :Very Happy: 

----------

## bungernut

I believe that i have the Linux Side setup correctly, when i have the print manager in windows open and then sent the test page as a job i see it come up, spool then disapear without printing. The windows computer prints its jobs just fine. I am using a guest account without a password. Has anyone seen this before?

EDIT (SOLVED)

need to emerge pnm2ppa and configure /etc/pnm2ppa.conf correctly, that it. Found it in another forum but lost the link

----------

## matttions

hi to every.body .. really cool guide ..

I can print from any application  [more o less] but what about the  character? I can't print it out with Ximian-office 1.1.2 ..

Did you have my same problem?

[Driver of the printer [HP 5051]--> hpijs. 

win2000 the printer server

my gentoo-box the client ...]

----------

## kaidon

Nice guide, thanks alot.

A few tips for the paranoid Windows users (like me) who have locked down their boxes.

You'll have to enable/check the following settings:

Network device properties:

Client for Microsoft-Networks

File- and printer sharing for Microsoft-Networks

Internetprotocols (TCP/IP) > Properties > Extended > WINS > Activate Netbios over TCP/IP

Windows Services:

"Server" service must be running

I needed all the above to even be able to activate printer sharing.

Firewall configuration: (I'm using Sygate personal firewall)

allow connections:

host: <your linux ip here>

direction: both (in/out)

protocol: tcp

remote ports (linux): 1024-65535

local ports (windows): 445

[edit]

To configure cupsd to only listen on localhost open /etc/cups/cupsd.conf and change the following:

#Port 631 <-- default, comment this out

# 20040926/sa: listen only on localhost

Listen 127.0.0.1:631

[/edit]

[edit 2]

You can login to http://localhost:631/admin with any user that is in the group "lp". Like this you don't have to (ab)use your root account for that.

[/edit]

hth someone

cheers & thanks again

k

----------

## Neonamu

Thx for the guide. I'm trying to do all u say and it works perfectly.

Very good guide.

----------

## ugus

thank you!. 

clear, short, very good guide.

working perfect.  :Very Happy: 

----------

## Bob P

 *Bob P wrote:*   

> After installing the printer as recommended, I've noticed that any user on the Linux box can browse their way to the printer settings menu in the control center and view the username:password combination that samba is using to access the printer share on the windows box.  Specifically, the location of the printer is listed in plain view on the printer configuration menu:
> 
> ```
> Type: local printer
> 
> ...

 

i have the solution for the problem where a user's SMB username:password is being displayed inappropriately in the "location" field of the KDE Printer Manager.  this error was caused by a misunderstanding of what the contents of the "location" field in the printer description are intended to contain.  although it may appear that the printer URI information is supposed to be entered in the printer location field, doing so will cause the password disclosure problem referenced earlier.  instead of entering the URI information in the location field, use your own descriptive information about the physical location of the printer in your workplace.

To put this in better context, let's look at the instructions in this HowTo regarding logging onto http://localhost:631 to configure the printer:

 *hulk2nd wrote:*   

> open your favourite browser and go to http://localhost:631/
> 
> go to "manage printers". if you're asked for a password type in your normal root account infos. the first three informations (name, location, description) can be filled just like you want. i choosed to name it epsonc62 but i don't think it is needfull that this name is the same one that you gave your printer on the xp machine. click continue. choose "Windows Printer via SAMBA". click continue.
> 
> then tipe in the location: 
> ...

 

after logging onto the localhost and supplying your root credentials, you are asked to provide three pieces of information:  printer name, printer location, printer description.  it is essential that you DO NOT enter the URI location information into this "location" field.  doing so will inappropriately disclose your username:password information on the windows box in plain text within the KDE Printer Manager in plain view for all to see!

Instead of entering this information for the "printer location"

```
smb://username.password@workgroup/domain/sharename 
```

try entering something descriptive, like this:

```
Main Computer Lab
```

the result is that when a KDE user opens the KDE Printer Manager, the text string "Main Computer Lab" will displayed in the printer's location field instead of the URI to your SMB box (which would inadvertently provide full disclosure of the username:password!).

After you finish entering the printer name, printer location, and printer description, select "Device: Windows Printer via Samba."  on the next screen the following information should be entered into into the "Device URI" field: (don't enter it anywhere else!)

```
smb://username.password@workgroup/domain/sharename 
```

This mistake resulted from confusion about using the term "printer location" interchangeably with "printer URI".  be sure that you understand the difference.

----------

## Belial`

Well, I think I've tried everything I could find on the net, but it just won't work  :Crying or Very sad: 

I have a HP DeskJet 3420, everything works fine (Printer is shared, and I can send jobs to it) but when the printer should start to print, he doesn't.

It just hangs at 64kb/3,70MB in the print queue, or whatever you call it...

So I this means, my Gentoo sends te file to the print queue, but Windows, or the printer can't do anything with it...

Is it just a non-linux-compatible printer or what? I really want this to work  :Confused:  Can somebody help??

----------

## Bob P

it may not be intuitive, but i think you need to emerge this regardless of the model of your HP printer. 

```
emerge hpijs
```

i needed to emerge it for my laserjet to work properly.

----------

## Belial`

I have installed hpijs, but it still doesn't work  :Sad: 

thanks anyway...

----------

## GaDDiM

You don't need to emerge samba if you have Windows XP (don't know of other versions of windows but I assume 2000 has it also) nor doing difficult with users or guest accounts

You need to add a Windows Component under "OtherFile and Print sharing" called "Print services for Unix". This is actually just a ldp server.

If you are using a firewall (which is default with SP2) you need to open port 515 TCP.

Now add a printer just like the first post describe only with the Device URI

```
lpd://host/printer
```

if your printer name in windows contains spaces you can escape them by using %20

I have a printer called "HP Deskjet 720C" set up in windows on the computer "kamer" so my Device URI would be:

```
lpd://kamer/HP%20DeskJet%20720C
```

Update: you have also put the start up type of the service "TCP/IP Print Server" to automaticLast edited by GaDDiM on Fri Mar 18, 2005 12:00 pm; edited 1 time in total

----------

## Anouar

Hi hulk,

I can't even get connection with the printer,

it says this:

 *Quote:*   

> printer State: idle, accepting jobs.
> 
> "Unable to connect to SAMBA host, will retry in 60 seconds...ERROR: Connection failed with error NT_STATUS_ACCESS_DENIED"
> 
> Device URI: smb://holodeck/hp

 

why is that?

greetz,

Anouar from the Netherlands

----------

## sleek

Thanks! This works great with my HP DeskJet 880C. Been looking for a guide like this, so I'm extremely happy!

----------

## linux_weenie

If you have an HP-DeskJet-720C, then you will also need to make sure you

```
emerge pnm2ppa
```

otherwise you will continue to get an aborted status on your print jobs even if you emerge hpijs. Hope this helps anyone using a pnm2ppa driver.

-Will

----------

## deXtuX

Strangely enough, my Lexmark E220 (laser printer) wouldn't work with any of the Lexmark drivers I could find (they don't have one specifically for the E220, only the E210), so I finally chose the HP LaserJet driver though the KDE control planel just for the hell of it, and its been working perfectly ever since.

----------

## saan

I had similar problems with people from previous posts. After monkeying around for about an hour, I got mine working by obtaining driver(.ppd file) from www.linuxprinting.org.  Emerging "gimp-print" gave me awful print result on my old Epson Stylus Color 740. Oh yeah, I skip part 2 on this how-to regarding inputing local ip address into "/etc/hosts" and it still works. Also I had to used regular user with password when configuring "smb://xxx..." 

Thanks for this Tips & Tricks!

----------

## Seather

When trying to add a printer in the web admin utility, Windows Printer via SAMBA is not listed in my Device: list. I have cups and samba both in my use flags?

Edit: fixed, recompiled both and started samba before cups seemed to fix that problemLast edited by Seather on Sat Feb 12, 2005 11:52 am; edited 1 time in total

----------

## Seather

I have the following problem,

When trying to print out a test page in the cups utility, I get the following error message in cups' log files:

```
E [12/Feb/2005:13:50:17 +0200] Unable to convert file 0 to printable format for job 12!

I [12/Feb/2005:13:50:17 +0200] Hint: Do you have ESP Ghostscript installed?
```

I have even tried downloading the "ESP Ghostsscript" src, compiled and installed it, but still having the same problem.

Using the Epson Stylus Color 460 driver from gnome-print

Please?

----------

## AdamG

Thanks..Worked Like a charm   :Smile: 

----------

## KFM

how do I tell what my hostname and workgroup name are on a windows box?

----------

## NateZ

wow, thank you so much - i've been wanting to do this for so long!

----------

## _Master_

thnx a bunch man  :Very Happy:  works great with my HP Psc 2410

----------

## cerealito

Your guide Works great with my HPLaserJet1100!

thank you very much!

----------

## shanenin

When I go to print a test page, it starts the process(I can hear the printer move), then it just stops. According to windows XP the page is being printed, but never finished.

----------

## YuriyRusinov

hulk2nd, thank you very much. I many many days unsuccessfully configured printing on Windows machines via cups before I have found this topic. Your guide is works great.

----------

## shanenin

 *shanenin wrote:*   

> When I go to print a test page, it starts the process(I can hear the printer move), then it just stops. According to windows XP the page is being printed, but never finished.

 

I got it to work by setting up an account with a password. One guy on this thread said he got it to work with a guest account, so I thought I would try(unsuccesfully).

----------

## bertaboy

 *billbalt wrote:*   

> Normally, a Windows printer is shared with Everyone/Print permissions. No password is required to access the printer.
> 
> To print to a printer configured in this manner from Linux using SMB/CUPS, you must connect using the guest account using no password.
> 
> When you don't set it up properly, you get this error:  "SMB tree connect failed: NT_STATUS_ACCESS_DENIED" 
> ...

 

Thanks, that solved it for me

----------

## thomasa88

Weee  :Cool: 

I have tried with foomatic and kde setup (the cups admin page wouldnt find my printer model) and that worked ok when the printer was connected locally, but when it runs through a win2k I have to use ghostscript,

thx for telling me how  :Very Happy: 

----------

## blackcell

Worked great for me on first try.

I used 

```
smb://username:pass@192.168.100.2/hpdeskjet
```

.

Thanks  :Very Happy: 

----------

## Garth

Thanks for the HOW-TO. Works fine now.

I tried to connect to a Windows98 connected printer and found that the smb string had to simply be:

```

smb://computername/printername

```

Make sure you don't have a password set on the printer share in Win98. I couldn't find a workaround for that.

----------

## Iced-Tux

THANX  :Smile: 

Just what I have been looking for  :Smile: 

It's working like a charm, but one question remains:

Will every program send its data through cups ? Or how do I configure them, so that they WILL print through cups all the time??

Maybe that is one hell of a silly question, but I'm really at a loss there.

----------

## Royle

I followed this guide but for some reason I'm getting an error, it is: 

```
"Connection failed with error NT_STATUS_LOGON_FAILURE"
```

Does anyone know what this error means and how I would go about fixing it?  Thanks in advance for your help.

----------

## Skardal

Dude!

I have the same problem!

My printer is a _see topic_, and it's shared on my brothers computer(winxp).

Have tried using the "unix printer thing" as mentioned before in this thread, but that did'nt work.

```
"Remote host did not accept data file (1)" 
```

Did also try with just the samba-setting from the beginning of this thread, but only got the 

```
"Connection failed with error NT_STATUS_LOGON_FAILURE"
```

message..

Any suggestioins?

----------

## Icethepenguin

You rule, I have been fighting this for months and you go and solve my problems in an hour.

Thanks a million,

kevin

----------

## Icethepenguin

 *hulk2nd wrote:*   

> this normally happens when you forget to enter username / pass in the string, wihile trying to connect to the printer.
> 
> ```
> smb://username:pass@workgroup/host/printer
> ```
> ...

 

Let me first say thank you for writing this and I cited you when I put this in with my easy install of Gentoo Linux.  In reference to using a username, I found it easier to do 

```
smb://guest@workgroup/host/printer
```

 and found that this will work 100% of the time, especially since its hard to get the username and password for windows to work since most people like me use first name/middle name/last name with spaces.  So I used "guest" and it worked great on both my micro-desktop and laptop.

Thanks again,

Kevin

----------

## Icethepenguin

 *Royle wrote:*   

> I followed this guide but for some reason I'm getting an error, it is: 
> 
> ```
> "Connection failed with error NT_STATUS_LOGON_FAILURE"
> ```
> ...

 

You may have already figured this out, but if this has anything to do with your username:password try using 

```
smb://guest@workgroup/host/printer
```

 by using guest I have had 100% success with it.

----------

## catharsis_

Works like charm, thanks a bunch!   :Smile: 

----------

