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.

40 Responses to “Printing to Windows XP printer from Ubuntu”

  1. Peter Diachun Says:

    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

  2. Rachel Says:

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

  3. john Says:

    Thanks a bunch. This worked perfectly.

  4. marvyn Says:

    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.

  5. Geoff Says:

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

    Thanks Geoff

  6. doug Says:

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

  7. Vitor Silva Says:

    thank!!! Worked like a charm. A+

  8. Istvan Says:

    Windows domains does not work :(

  9. Boelcke Says:

    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.

  10. Patrick Says:

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

    Any ideas?

  11. Paul Says:

    Boelcke, thanks for the tip.

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

  12. Joe Says:

    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

  13. Mike J. Says:

    thanks !!!!!
    seriously, thanks

  14. Brian Says:

    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.

  15. John Truxton Says:

    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!

  16. Jared Says:

    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!

  17. mark Says:

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

    -m

  18. Andy Says:

    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 :(

  19. Jong Says:

    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…

  20. Andy Says:

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

  21. stephen Says:

    Works a treat!

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

  22. WuMessiah Says:

    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!

  23. jarvz Says:

    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..

  24. Markst Says:

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

    Thanks for the help!

  25. Mr. Atoz Says:

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

  26. eli Says:

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

  27. Jean Says:

    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.

  28. Reg Says:

    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!

  29. Adric Says:

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

    Adric.

  30. Tausche Says:

    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

  31. Kris Rao Says:

    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.

  32. drew Says:

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

  33. iSquared » Ubuntu : Print to XP Shared Printer Says:

    […] http://www.willmer.com/kb/2005/05/printing-to-windows-xp-printer-from-ubuntu/ […]

  34. dennis Says:

    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…

  35. dmparker Says:

    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…

  36. Paul Says:

    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.

  37. Rachel Says:

    Paul, thanks for the karma deposit :-)

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

    Rachel

  38. wieszti Says:

    Thanks man

  39. Janesh Says:

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

  40. lioddities Says:

    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.

Leave a Reply