Printing to Windows XP printer from Ubuntu

Enable “Print Services for Unix” on Windows XP machine and share printer. (I’m not actually sure that this is necessary, it might be a red herring…)

When you add the printer in Ubuntu,

  1. Choose “Network Printer” and “Windows Printer (SMB)”
  2. put your Workgroup in the Host field
  3. Put “guest@<host>/<printer>” in the Printer field (replacing <host> and <printer> with your host & printer names)

So, for example, if your Windows machine was called “Dozer” and your printer was called “LaserPrinter”, you would put “guest@Dozer/LaserPrinter”.

You should not need a name and password for the Windows machine for this to work.

Note: please note that case-sensitivity is important.. e.g. If you think your machine name is “DOMINO”, it should be “Domino” in the config above.

58 Comments

  • Peter Diachun

    Reply Reply June 30, 2005

    6/30/05

    Thanks for you posting on printing to Windows xp printer from Ubuntu! I have not been able to get mine to work. I am not sure how to fill in the Printer field.

    Host should be the workgroup, correct?
    printer name is the name I see on the printer list on other Windows machines using this printer, correct?
    How are these two name separated? Dot, space, slash? Please show an example.

    Name and password? For the Ubuntu machine, or what?

    Sorry I need so much help!

    I am just starting with Linux and like Ubuntu a lot. I have to get it to print and network both ways. I can move files from my Windows machines on the network, but not the from the Ubuntu to the Windows machines.

    Thanks again!!

    Peter

  • Rachel

    Reply Reply June 30, 2005

    Thanks for your comment – I’ve added an example.

  • john

    Reply Reply September 8, 2005

    Thanks a bunch. This worked perfectly.

  • marvyn

    Reply Reply September 30, 2005

    hello i need help on how to make my printer available in a windows box. i can print from ubuntu to windows. but when i put the printer on a ubuntu box, windows box cant access the printer?? any idea on how to fix this.
    i’ve read that i need to edit smb.conf but i cant seem to understand it.

  • Geoff

    Reply Reply November 8, 2005

    Thanks for this excellent advice. It has got me up and running!

    Thanks Geoff

  • doug

    Reply Reply November 17, 2005

    Didn’t work here. Print jobs still sit in the q

  • Vitor Silva

    Reply Reply November 26, 2005

    thank!!! Worked like a charm. A+

  • Istvan

    Reply Reply November 29, 2005

    Windows domains does not work :(

  • Boelcke

    Reply Reply November 30, 2005

    Thanks for the pointer. With some work, your direction worked out for me.

    I did find that the PPD file included on the disc of my Brother HL-2040 gave me some odd error code. Using the HL-5140 driver, however, worked out fine.

    And just to spell it out for all the ubuntu newbies like me,

    Windows, Control Panel, Add or Remove Programs, Add/Remove Windows Components, Other Network File or Print Services.

    Windows, Control Panel, Printers and Faxes, Sharing tab, select sharing, and jot down the name.

    Right-click My Computer, Properties for the computer name.

  • Patrick

    Reply Reply December 5, 2005

    I click on System > Administration > Printing and then get an error “The CUPS server could not be contacted”.

    Any ideas?

  • Paul

    Reply Reply December 27, 2005

    Boelcke, thanks for the tip.

    Used HD-5140 (postscript) driver on a shared Brother 8440, works great.

  • Joe

    Reply Reply January 20, 2006

    thank you so much! i cant imagine how long i wasted configure smb options and messing up my familys network to get this to work when the real solution took a minute! it works perfectly

  • Mike J.

    Reply Reply January 23, 2006

    thanks !!!!!
    seriously, thanks

  • Brian

    Reply Reply January 26, 2006

    Thanks I had been working on this for hours. I am printing to a HP Laserjet6L on Windows XP from Ubuntu. Your settings worked perfect. If your still having problems make sure the printer name your using is the windows printer share name.

  • John Truxton

    Reply Reply January 29, 2006

    As a “n00b” to linux, unbuntu specifically, i just wanted to say thank you for helping out, I couldn’t get it to work for the life of me and spent hours on samba’s website trying to figure out what was wrong. Your tip was right on the mark, i hadn’t put the unix services on my windows box… you are awesome, thanks!

  • Jared

    Reply Reply January 29, 2006

    Good info, totally worked. Too bad Ubuntu isn’t more clear about it. Just a FYI, you don’t need “Print Services for Unix” installed on Windows if your connecting to the printer with SMB. Great site, keep up the good work!

  • mark

    Reply Reply February 10, 2006

    stellar! why isn’t this exact example in other official tutorials? thanks rachel!

    -m

  • Andy

    Reply Reply February 14, 2006

    I did all of this correctly and when i go to print something my jobs all pass through as if they have printed but nothing comes out of the printer :(

  • Jong

    Reply Reply February 17, 2006

    I also have the same problem as Andy. I just followed your approach and Debian’s approach, but I couldn’t print anything. When I clicked the printer property, it says “couldn’t find a suitable printer”. Got any idea about this. Any comment would be appreciated. Thanks…

  • Andy

    Reply Reply March 18, 2006

    thanks for this, has worked like a charm, again thank you!

  • stephen

    Reply Reply April 3, 2006

    Works a treat!

    Note that the host name is Case Sensitive, despite my windows box calling itself ‘DOZER’ (for example), only ‘Dozer’ works.

  • WuMessiah

    Reply Reply April 30, 2006

    Hello, another Linux semi novice. I have to say this was extremely usefull and you have saved me a lot of time and work. The amazing part was I am actually getting a better response sharing my windows printer via smb then I did connecting it directly to the linux machine for some reason? Bottom line, you rock!

  • jarvz

    Reply Reply May 4, 2006

    hi
    need help i cant print using my ubuntu from a window98 printer based computer??
    can u help for settting it up and configuration to access win98 using my ubuntu..

  • Markst

    Reply Reply May 11, 2006

    Worked great…..once I had the case sensitive printer name typed in correctly (i.e. BrotherH)

    Thanks for the help!

  • Mr. Atoz

    Reply Reply May 17, 2006

    Any tips on how to make SMB printing work when the printer name has a space in it? (Which, incidentally, is allowed in Windows)

  • eli

    Reply Reply June 12, 2006

    Great description… I found the windows extra enablement part to be necessary. Thanks for setting up my printer for me!

  • Jean

    Reply Reply June 18, 2006

    Heya, just an ubuntu noob that wants to say thx. Your advice was right on the money.

    Just a little advice for people trying to find out the info on their windows machine.

    1) To find the workgroup (likely defaulted to MSHOME) right mouse click on my computer and click properties. Then select the Comptuer Name tab and you’ll see the information. Remember only the first letter should be capitalized when you type it into ubuntu.

    2) To get the exact name of the printer click start->settings->printers and faxes. Right mouse click the printer and select properties. Then click the sharing tab and the name of your printer should be apparent.

    Good luck and happy ubuntuing.

  • Reg

    Reply Reply June 22, 2006

    Perfect!
    So easy under Badger.
    I too am using a Brother HL 2040 which I noticed wasn’t in my Ubuntu driver list anyway so just chose the 5140 following advice from this page. Worked first time!

  • Adric

    Reply Reply June 30, 2006

    Thanks for the tip to use 5150 for the HL 2040 …. works great.

    Adric.

  • Tausche

    Reply Reply August 31, 2006

    Patrick, do you have an /etc/cups/client.conf ?
    if so, be sure it’s empty or has a working configuration (first one is easier for testing :-)

    I’ve had the same problem, this solved it.

    wbg

  • Kris Rao

    Reply Reply September 5, 2006

    I too have installed Ubuntu for the first time and am very new. My home set up is that I have a Linkstation with a print server and an HP Officejet v40.

    Even though the Linkstation has Linux powering it – do I need to connect to the Linkstation with Windows Printer (SMB). Assuming the answer is yes I have set:

    Host = Workgroup
    Printer = guest@Linkstation/lp

    You have not specified what the username and password should be – I am able to navigate to the Linkstation files from the Ubuntu computer with no problem (access is not restricted?. Peter Diachun asked this same question on June 30, 2005.

  • drew

    Reply Reply September 7, 2006

    THANKS SO MUCH this is a really great and simple way of showing. Much better than other sites!

  • dennis

    Reply Reply October 1, 2006

    This is so simple yet I cannot get it to work.
    Have added the printer but test page will not print :(
    Got this message from Properties:
    Printing: Unable to connect to CIFS host, will retry in 60 seconds…

  • dmparker

    Reply Reply December 24, 2006

    Right on! I’ve been looking for this solution for days, got to your page and quickly figured it out, thank you so much.

    At first I had a problem (Unable to connect to CIFS host…) but once I did a
    “net view ” from a windows box I was able to see what my printer was ACTUALLY called, not what I THOUGHT it was called…

  • Paul

    Reply Reply October 16, 2007

    Thanks for this.

    Note that the host name is Case Sensitive, despite my windows box calling itself ‘mainbox’, only ‘Mainbox’ works.

    Why doesn’t the case sensitive mention get made in any of the other guides.

    BIG BIG THANKYOU..

    PLEASE receive a large deposit of good karma in your karma account.

  • Rachel

    Reply Reply October 16, 2007

    Paul, thanks for the karma deposit :-)

    I’ve added a note about the case-sensitivity.

    Rachel

  • wieszti

    Reply Reply September 21, 2008

    Thanks man

  • Janesh

    Reply Reply October 29, 2008

    Hi,
    I was struggling with printer setup and your note worked like a charm. Very useful information. Thanks.

  • lioddities

    Reply Reply November 25, 2008

    I couldn’t get it to work at first by following the instructions exactly. Then I noticed the “verify printer” button and kept changing things till it said “verified”. What I did was use the IP address of the machine hosting the printer instead of the hostname. Worked like a charm then. Hope this helps someone.

  • xylene2301

    Reply Reply December 13, 2008

    Thanks; that was just enough.

    Jeans post was also helpful:

    1) To find the workgroup (likely defaulted to MSHOME) right mouse click on my computer and click properties. Then select the Comptuer Name tab and you’ll see the information. Remember only the first letter should be capitalized when you type it into ubuntu.

    2) To get the exact name of the printer click start->settings->printers and faxes. Right mouse click the printer and select properties. Then click the sharing tab and the name of your printer should be apparent.

  • Kdcleuah

    Reply Reply December 13, 2008

    Thanks!,

  • joe

    Reply Reply January 21, 2009

    HI
    we’ll i would think that what ever printer (host) you have the printer
    attached to.. you have to go to that computer and admin and make the printer SHARED… then any computer on your net can point at the host
    and that printer.. of coarse you have to leave it turned on!! waist of power!! no green their!!

    best to buy one of the internet printers comming out now.. solves all these problems for only a little more money. scrap all the other printers.

    you can get a printer ethernet spooler also.. little more to set up but it works.

    joe

  • joe

    Reply Reply January 21, 2009

    HI

    what we really need is how to run a new printer epson, hp , lexmark on ubuntu so it will run the windows version of the software to do graphic printting .. else it only does text!!

    how do you fake out ubuntu to drive a windows printer driver?

    thanks
    joe

  • Rachel

    Reply Reply January 22, 2009

    Joe, if you set the printer driver on Ubuntu to be “raw”, then you can use the Windows printer driver on the client. Works a treat..

    Rachel

    • Christian

      Reply Reply November 18, 2012

      , I discovered long ago that in geanerl, Macs use superior hardware though it’s the same stuff as you’ll find in upper end non-Mac PCs. Linux runs as well as it possibly can on a Mac! If you’re a geek and have time to screw with it, it even makes an acceptable desktop. I’m a geek and am paid very well to play with Linux but my free (as in priceless) time is much more valuable and I’d rather be paddling my kayak than fixing the issue of the day or re-inventing the wheel every other day. OS X is more reliable but for my uses, OS X is pretty useless. So, what’s the solution? I run Windows 7 (just replaced XP after many years of reliable service) on my Mac hardware. It screams, it doesn’t break, and I don’t need to search through endless Linux and Mac fanboy diatribes to find solutions to the myriad of issues common to both.At this point you are probably guessing I’m a Windows disciple but in truth, my favorite OS of all for day-to-day productivity is Solaris but for a truly solid Solaris installation, you need Sun hardware. That stuff ain’t cheap and though my income is above average, I just can’t see spending so much for a home machine that I only use for checking email, surfing, and home finance. Windows is the next best thing and though Mac hardware is a bit pricey, it’s solid and a lot cheaper than a Spark. No, I don’t build my own machines. I did years ago but now that computers are so cheap, it’s just not worth it. The Mac Mini is more machine than I need and at least for a Mac it’s cheap.The Bottom line is that for the average user, the Linux desktop just isn’t ready. Windows and Mac dominate the market for a reason. Linux is free after all! As a wise old dude once told me many years ago, The most expensive motorcycle you can ever buy is a free one. After spending lot’s of money and countless unpaid hours screwing with it, Linux can be made into a fine and robust operating system that is virtually bulletproof (at least until the unpaid folks who write this stuff update the kernel that breaks half your machine) or you can buy one that works out of the box and get on with your life.Linux if good if you want a functional machine in today’s resource hungry software world and have dated hardware. Both Windows and OS X do have minimum hardware requirements so if you’re machine barely cuts it, Linux may be the better choice BUT . since you have a fairly modern and very capable machine and probably aren’t writing code for a living, or even as a hobby, or running a server farm in your basement, I can’t think of a single reason beyond free to install Linux.I’m gonna catch fire for that one but that’s the way I see it.

  • zegh

    Reply Reply February 6, 2009

    I had a long fight to finally get to print in xp. So this is a happy ending for me. The info in the comments was very useful too.

    Thank you all.

  • John Koval

    Reply Reply March 25, 2009

    I must have something wrong with my install of linux (8.04) because when I try to add a printer in Ubuntu I don’t see anything about
    network printers, only local printers.

    The network printer I do have is on a Windows XP machine which uses NWlink to allow other XP machines access the printer

  • John Koval

    Reply Reply March 26, 2009

    Solved my own problem:

    Using Ubuntu 8.04
    1. reinstalled samba

    2.Administration -> Printing -> New Printer -> Windows Printer via SAMBA

    3. in SMB Printer sub-window, Browse

    4. Browsed to HOME/Luigi/hpdesk
    so that address was
    smb://HOME/Luigi/hpdesk
    in general
    smb://workgroup/server/printer

    It works wonderfully; thanks for your guidance

  • Jelsa

    Reply Reply May 9, 2009

    I tried to be able to print to Windows XP Host printer . In this case, I have HP D1360. Finally the way is just to make sure you do these steps :
    1. Go to Control panel -> Printers & faxes
    2. Right-click on Printer -> Properties -> Ports tab
    3. Uncheck “enable bidirectional support”

  • John Koval

    Reply Reply October 16, 2009

    I am Back again;\
    now I can’t find //Home/Luigi when browsing.
    Can find this when using Windoze (this machine has dual boot)
    so I must have removed something need for this.
    I have reinstalled most of samba components, but this has not helped

  • Pari

    Reply Reply November 11, 2009

    If it helps anybody, i used the ip address of my computer for the
    I was having a lot of problems with the verification. The guest account fixed that for me. Thanks!

  • Pari

    Reply Reply November 11, 2009

    whoops… i meant to say i used the ip address of my computer for the “host”

  • Dharmendra Singh

    Reply Reply October 14, 2010

    HI there,
    I have Hp LasserJet 1007/1008 printer installed on windows xp sp2 on some other machine which is in LAN. And on the other hand side I’m running Ubuntu 10.04 lucid on my PC in LAn too. I want to share printer which is on Windows Xp in LAN. Plz suggest me on this.
    Regards

  • wootboy

    Reply Reply December 12, 2010

    Thanks A LOT, Rachel. Ubuntu 10.10 was able to find my printer, which is a few years old, with ease. Cheers!

  • Anonymous

    Reply Reply December 25, 2011

    Hello,
    i have a kyocera taskalfa180 printer which doesnt seem to be supported in linux. I installed it in xp vmware and am able to print from it. problem comes when adding it to ubuntu…I browse a network printer from system>printing and i see it but i dont know which drivers to select from the database coz my kyocera model is not listed. Any assistance is highly regarded.

    br..

    peter

Leave A Response

* Denotes Required Field