How-to: Network Printer Sharing

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
altair4
Level 20
Level 20
Posts: 11426
Joined: Tue Feb 03, 2009 10:27 am

Re: How-to: Network Printer Sharing

Post by altair4 »

If you can't access the Mint printer either by machine name or ip address then my first thought would be a firewall is in the way. Temporarily disable a windows firewall and see if you can connect with that machine. On the mint side if you've done nothing with the firewall then you should be ok but if you have then disable whatever you've done to it.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
JaceMan

Re: How-to: Network Printer Sharing

Post by JaceMan »

I went back and re-read some of the other comments noting what one Minter had said about workgroup names. I just changed the workgroup name on my laptop and my wife's laptop from "JACEMAN" back to the default workgroup of "WORKGROUP" and rebooted them. I was then able to browse for and see my Mint printer on both as well as print test pages.

Perhaps the workgroup name shouldn't matter, but it did in my case. Firewall-wise no issues there in Windows or Mint. Is it possible that the router is only allowing file and print sharing between machines on the same workgroup? Or that maybe CUPS/Samba are set to first search for "WORKGROUP" or "MSHOME"?

I dunno... just spit-balling here to maybe give those of you who know what you're doing the necessary brainstorming power to figure out what's going on to help future users. Mine seems to be working now, so I'm a happy camper. I just have to wait for the kids to show their faces so I can see if changing the workgroup name and rebooting gets them settled as it did with the other 2 notebooks. Either way (success or failure), I'll report back here so that future readers will know.

Thanks.
altair4
Level 20
Level 20
Posts: 11426
Joined: Tue Feb 03, 2009 10:27 am

Re: How-to: Network Printer Sharing

Post by altair4 »

The only time a workgroup would matter is if the different machines are in different subnets. If all of your machines are connected to the same router you're all in the same subnet so it shouldn't matter. My network depends on it. I have a couple of corporate laptops here and couldn't change the workgroup names ( which are all different ) if I wanted to.

But I'm an ordained minister in the Church of Whatever Works - so if it works for you ..... :wink:
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
AbeFreeman

Re: How-to: Network Printer Sharing [solved]

Post by AbeFreeman »

Great tutorial, very step by step. I did everything you said, BUT my xp machine still can't find the printer on my mint machine. I try to browse for the network printer and it shows "workgroup" and "Dell" (the mint machine), but no printer (printer is plugged in to usb port and turned on. Now what?
Thanks in advance.
Last edited by AbeFreeman on Tue Sep 28, 2010 11:21 pm, edited 1 time in total.
altair4
Level 20
Level 20
Posts: 11426
Joined: Tue Feb 03, 2009 10:27 am

Re: How-to: Network Printer Sharing

Post by altair4 »

If you're using Mint9, Ubuntu (10.04) introduced a whole mess of bugs in how services are started at boot and two of them might account for your dilemma.

BUG1: nmbd is not started:

See if nmbd is running:

Code: Select all

sudo service nmbd status
If it's not running start it:

Code: Select all

sudo service nmbd start
BUG2: CUPS starts after smbd starts

Restart the cups service:

Code: Select all

sudo service cups restart
Restart the smbd service:

Code: Select all

sudo service smbd stop

Code: Select all

sudo service smbd start
In both cases always verify that the machine that has the printer attached to it can see it from the networks perspective by issuing the following command:

Code: Select all

smbtree
If it's one of the above bugs I can provide workarounds for those problems. If it's not one of those bugs then it's likely that a firewall on either windows or linux is in the way.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
AbeFreeman

Re: How-to: Network Printer Sharing

Post by AbeFreeman »

I'm a bit confused now. You mentioned CUPS starting, but in the tutorial there's instructions for "the MINT way" and then "the CUPS way". I assumed that I should just do "the MINT way" since I'm running MINT (and since by looking around the control center I had already done what it told me to do), but now I'm wondering if I was supposed to do "the CUPS way" in addition to that. Was I? Sorry, I'm a serious noob.
altair4
Level 20
Level 20
Posts: 11426
Joined: Tue Feb 03, 2009 10:27 am

Re: How-to: Network Printer Sharing

Post by altair4 »

The "Mint Way" and the "CUPS Way" both point to the same cups service. It's the service itself and not the method that we have to make sure is running. Sorry for the confusion.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
AbeFreeman

Re: How-to: Network Printer Sharing

Post by AbeFreeman »

Getting there.... I did what you said and now my xp machine can "see" the printer, but when I try to add it, windows tells me:

The server for the printer does not have the correct printer driver installed. If you want to search for the proper driver, click OK. Otherwise click Cancel and contact your network administrator or original equipment manufacturer for the correct printer driver.

Which of course is bosh, since the printer works way better on my mint machine (with whatever driver mint is using by default) than it ever did on my xp machine. But anyway, I try to humour it and click "OK" to let it look for a driver it's happy with. But do you think it can find one???? I put in the manufacturers disk and let it do it's thing but it just tells me "unable to find any drivers for this device".
Of course the driver has been installed a long time ago, since I used to only have this xp machine, and it's the same printer that was always plugged into it.

So, what am I doing wrong???
altair4
Level 20
Level 20
Posts: 11426
Joined: Tue Feb 03, 2009 10:27 am

Re: How-to: Network Printer Sharing

Post by altair4 »

I'll be honest with you, I've never come across this situation before.

It's normal for Windows to say that the remote printer has the wrong driver and ask you if you want to install one locally. In reality Windows has no idea what driver linux is using and even if it did it's not in a position to determine if it's the right one or not. But ( and I'm doing this from memory so ... ) you should have had a dialog box pop up in Windows with the heading of "Select the manufacturer and model of your printer" or words to that effect. That's where you specify the driver and since you already have it installed it should be in the list.

If you have it search for the driver it will never find it because it has no way to connect the correct driver ( or any driver ) to the remote machine. You have to explicitly specify that this driver belongs to that remote printer.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
AbeFreeman

Re: How-to: Network Printer Sharing

Post by AbeFreeman »

Yes, there's a "select the manufacturer and model" screen that comes up (good memory!), but under the manufacturer (HP) there is no PSC 1318 (the model) option listed. I don't really care which driver it uses, as long as it works, and I'd imagine that mint just has some default HP driver installed that works just fine (used it with CHinese fonts, etc. and the printing is great). So how do I know which driver mint is using, so I can just choose that from the list and make my xp machine happy?

Sorry, one more question: will I need to enter those terminal commands (cups and smbd restart) after every restart of the mint computer if I want to print with the xp one? That would be a pain. Less of a pain than transferring files with a usb drive or over the network and then printing them, but still a pain.
altair4
Level 20
Level 20
Posts: 11426
Joined: Tue Feb 03, 2009 10:27 am

Re: How-to: Network Printer Sharing

Post by altair4 »

This is the part I don't understand:
but under the manufacturer (HP) there is no PSC 1318 (the model) option listed.
Yet you had the printer installed on Windows first:
since the printer works way better on my mint machine (with whatever driver mint is using by default) than it ever did on my xp machine
The driver exists on your XP machine so you need to find a way to point it there. It should be on the list or on the HP printer install disk.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
AbeFreeman

Re: How-to: Network Printer Sharing

Post by AbeFreeman »

Yes, the driver exists on my machine, but windows is too stupid to look there, instead it looks in one of it's CAB or DLL or sth. files, and there's no appropriate driver listed. I can manually browse the disk and find the .inf driver file it's looking for, look at it and see that the printer I want is in there (one possible snag, though, windows calls the printer an "hp psc 1310" and linux calls it "hp-psc-1310" --dashes instead of spaces -- so maybe that's the problem?), but when I point the installer to that file it says it can't find a driver for the printer. Meanwhile, though, I had to restart cups and smbd, since I had shut down and restarted my computer since the last time I tried to "look" for the network printer. This all seems so hopeless. I guess I'll just live with transferring files via usb disk, etc. and then printing them that way. Sigh.
I don't blame you if you give up. I have.
altair4
Level 20
Level 20
Posts: 11426
Joined: Tue Feb 03, 2009 10:27 am

Re: How-to: Network Printer Sharing

Post by altair4 »

Reinstall the driver on Windows. Now from windows install the remote linux printer. It now should have a driver in the "Select the manufacturer and model of your printer" list.

If that doesn't work you've got some problem with windows. Do a google search on accessing a remote Windows printer from Windows. You would have the same problem Windows-to-Windows that you are having with Windows-to-Linux.

The old standby is to go through the same process you've been going through and when it asks for a driver - for Manufacturer select "Generic" and for model select "MS Publisher Color Printer". That driver has been on the list since NT3.51 and should give you basic printing capability.

I'm afraid that's all I have to offer.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
AbeFreeman

Re: How-to: Network Printer Sharing

Post by AbeFreeman »

I did re-install the driver and it didn't make any difference as to the drivers that windows includes in it's list. But your solution of using the generic printer driver sounds good. But now when I tried to implement it I've run into the old problem of the xp machine not being able to "find" the mint machine. Last time I had that problem, the solution was what you called "Bug #2" (ie. when I did a "status" command I found smbd running, so I did a cups restart then smbd stop and restart). So I did all that again, but this time the xp machine still can't find the mint machine. When I type "smbtree" it comes up with

WORKGROUP
\\DELL dell server (Samba, LinuxMint)
\\DELL\downloads
\\DELL\Print_to_PDF Print to a PDF File
\\DELL\psc-1310-series- hp psc 1310 series
\\DELL\IPC$ IPC Service (dell server (Samba, LinuxMint))
\\DELL\print$ Printer Drivers
HOME
\\TRUSTY laptop computer
[and at this point it waits for awhile, and then gives me this error message:]
cli_start_connection: failed to connect to TRUSTY<20> (0.0.0.0). Error NT_STATUS_UNSUCCESSFUL

If I go to "network" in the file browser, open the windows network, and try to open "Home" to look at the XP machine I get a window that says:
unable to mount location
Failed to retrieve share list from server

I've run into this a few other times, but it seems to be completely random: sometimes I get this message, and sometimes the computers can "see" each other no problem. What can I do?
altair4
Level 20
Level 20
Posts: 11426
Joined: Tue Feb 03, 2009 10:27 am

Re: How-to: Network Printer Sharing

Post by altair4 »

So I did all that again, but this time the xp machine still can't find the mint machine.
If WinXP can't see the Mint box the problem is either with Windows or the network itself because the output of smbtree indicates that everything on the Mint side of this in working order and shows the printer.

Temporarily disable the Windows firewall to see if it's in the way.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Roy Dixon

Re: How-to: Network Printer Sharing

Post by Roy Dixon »

I need a little help on this.

I followed the directions in this "How to" (very well written I might add), for sharing a windows printer with Linux Mint on the network. Using Windows thru Samba, I was able to see the network computers but not the printers attached to them. I checked "File Sharing" in Linux Mint and it is not enabled, but grayed out. It says the software needed is not installed (but does not tell you how or where to get it). Could this be the reason why I cannot see the printers on the Windows Network? All printers are enabled for sharing and work fine on the Windows computers.

I also tried CUPS, but the web address you gave requires and ID & Password.

Roy Dixon
altair4
Level 20
Level 20
Posts: 11426
Joined: Tue Feb 03, 2009 10:27 am

Re: How-to: Network Printer Sharing

Post by altair4 »

And instead of browsing for the printer what happens when you connect to it directly using one of these formats:
smb://WORKGROUP_NAME/MACHINE_NAME/WinPrinter
smb://MACHINE_NAME/WinPrinter
smb://192.168.0.100/WinPrinter
If you still can't connect then from the Mint machine post the output of the following command:

Code: Select all

smbtree
And if you can't get access to the printer even by ip address then you have a problem with your network in general.
I checked "File Sharing" in Linux Mint and it is not enabled, but grayed out. It says the software needed is not installed (but does not tell you how or where to get it). Could this be the reason why I cannot see the printers on the Windows Network?
No. "Personal File Sharing" creates a minimal apache file server that shares just one folder in your home directory and uses avahi to announce it's presence. It's for sharing a folder to others not the other way around and has nothing to do with printers or Samba.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Roy Dixon

Re: How-to: Network Printer Sharing

Post by Roy Dixon »

Here is the smbtree printout. There seems to be some problem with the host computer (Windows Vista 32) blocking access from the linux machine.

abcs@abcs-desktop ~ $ smbtree
Enter abcs's password:
WORKGROUP
\\SHOP AMD Athlon-II X2
cli_start_connection: failed to connect to SHOP<20> (0.0.0.0). Error NT_STATUS_CONNECTION_REFUSED
\\ROY-PC
cli_start_connection: failed to connect to ROY-PC<20> (0.0.0.0). Error NT_STATUS_CONNECTION_REFUSED
\\ABCS-DESKTOP abcs-desktop server (Samba, LinuxMint)
\\ABCS-DESKTOP\Print_to_PDF Print to a PDF File
\\ABCS-DESKTOP\Stylus-Photo-R280 EPSON Stylus Photo R280
\\ABCS-DESKTOP\IPC$ IPC Service (abcs-desktop server (Samba, LinuxMint))
\\ABCS-DESKTOP\print$ Printer Drivers
abcs@abcs-desktop ~ $
ROY-PC is the host computer for the Epson Stylus CX9400Fax Series

Roy Dixon
altair4
Level 20
Level 20
Posts: 11426
Joined: Tue Feb 03, 2009 10:27 am

Re: How-to: Network Printer Sharing

Post by altair4 »

This isn't a printing problem. I don't think it's even a samba problem. I think it's a network problem and is really beyond the scope of this HowTo as I stated at the end of the HowTo.

My first suggestion would be to disable any firewall you have on the Windows machine to see if it's in the way. Then disable anything you've done to the Linux firewall. If you haven't done anything to the Linux firewall then it should be OK.

You did not say if using the ip address worked around your problem:

Code: Select all

smb://192.168.0.100/WinPrinterName
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
AbeFreeman

Re: How-to: Network Printer Sharing

Post by AbeFreeman »

Hi Altair,
I had some time to attack the printer problem again. With restarting CUPS and smbd stop and restart, the windows machine showed up on smbtree, and on the windows machine I was once again able to "see" the mint printer. So I installed it, using the Generic, MS Publisher Color Printer driver that you suggested. That seemed to make windows happy. BUT now the mint printer appears as an installed printer, but with an "Access denied, unable to connect" message under it. I turned off the windows firewall, and double checked to see that I had correctly done the 2 steps involved in making the printer available on the mint machine, and I had, and I haven't done anything with the mint firewall, so what could the problem be now?
So close, and yet so far away.
Post Reply

Return to “Tutorials”