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 thoughts on “Printing to Windows XP printer from Ubuntu”

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


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

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

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

    Any ideas?

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

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

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

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

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

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

  11. Works a treat!

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

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

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

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

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

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

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

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


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

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

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

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


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

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

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

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


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


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


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

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

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

  30. 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
    in general

    It works wonderfully; thanks for your guidance

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

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

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

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

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



Leave a Reply

Your email address will not be published. Required fields are marked *