LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-21-2018, 02:25 PM   #1
PastorJeremyWilson
LQ Newbie
 
Registered: Sep 2018
Location: Idaho
Posts: 5

Rep: Reputation: Disabled
Can print from Windows to CUPS printer. Cannot print from Windows to Samba printer.


First off, thank-you for this wonderful group! This is my first post, but LinuxQuestions.org has been indispensable in getting my file server up and running.

Next, a description of my problem. I have an Intel machine running Ubuntu Server version 18.04.1 LTS, with CUPS 2.2.7 and Samba 4.7.6. The file shares on Samba are working great, no problems there. But I'm having troubles getting the printers to work when they're shared through Samba.

So here's what I've got so far. I have three printers, all of which are connected to the network wirelessly. I was able to install all three into CUPS with no problems, and the Linux machine prints to all with no problems. Sharing those printers through CUPS, my Windows machines can print to all three printers with no problems as well. By the way, the printers are installed in CUPS as Internet Printing Protocol (http) (http://192.168.0.xxx).

But, when I create printer shares in smb.conf, the shares show up on my Windows machines, I can add them to the Windows machines, but they show persistently offline. Plus, whenever I try to make any changes to those printers on the Windows machines, I am met with the Windows error: "The server print spooler service is not running. Please restart the spooler on the server or restart the server machine." This happens whether I install them by double-clicking the printer share in Windows, or I install them by adding them through Control Panel > Devices and Printers > Add a new printer > The printer that I want isn't listed > Select a shared printer by name.

So, of course, I did lots of restarting the smbd and nmbd services as I was trying to get this to work, and lots of reboots. Made sure that the printer name in smb.conf matched the printer name in CUPS. Lots of restarting the Print Spooler on the Windows machines as well. I purged CUPS and reinstalled, copying over the cupsd.conf.defualt file for a fresh start. I also attempted to change the Samba spool directory to a directory in home, as well as change its permissions to 777, in case it was a permissions problem. Finally, I found a site that mentioned activating Samba's built-in spooler by adding "rpc_daemon:spoolssd = fork" and "rpc_server:spoolss = external" to the [global] part of smb.conf, but that didn't work either. Tried installing the printers as IPP instead, with no change.

Any ideas of what I should try next, or what kind of setting I might have wrong? I'll include the dump of my smb.conf from testparm in case any of you might spot something there.

Thanks in advance for your help!

-----

# Global parameters

[global]
dns proxy = No
log file = /var/log/samba/log.%m
map to guest = Bad User
max log size = 1000
obey pam restrictions = Yes
pam password change = Yes
panic action = /usr/share/samba/panic-action %d
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
passwd program = /usr/bin/passwd %u
server role = standalone server
server string = %h server (Samba, Ubuntu)
syslog = 0
unix password sync = Yes
usershare allow guests = Yes
workgroup = LBCNWORKGROUP
rpc_daemon:spoolssd = fork
rpc_server:spoolss = external
idmap config * : backend = tdb

[printers]
browseable = No
comment = All Printers
force user = jeremy
guest ok = Yes
path = /var/spool/samba/
printable = Yes
read only = No

[print$]
comment = Printer Drivers
guest ok = Yes
path = /var/lib/samba/printers

[LBCN]
force user = jeremy
path = /home/jeremy/LBCN
read only = No
valid users = jeremy pasto

[Backup Drive]
force user = jeremy
path = /media/jeremy/TOSHIBAEXT
read only = No
valid users = jeremy pasto

[Brother Color LaserJet (Office)]
force user = jeremy
path = /var/spool/samba/
printable = Yes
printer name = HL3170CDW

[Brother Color InkJet (Home)]
force user = jeremy
path = /var/spool/samba/
printable = Yes
printer name = MFCJ470DW

[Brother B&W LaserJet (Office)]
force user = jeremy
path = /var/spool/samba/
printable = Yes
printer name = MFC7860DW
 
Old 09-21-2018, 04:23 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,842

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Welcome to LinuxQuesions.org. A question to start with - Since these are network-attached printers, why not configure the Windows hosts to reach them directly, rather than via the Linux machines using samba?
 
Old 09-21-2018, 04:57 PM   #3
PastorJeremyWilson
LQ Newbie
 
Registered: Sep 2018
Location: Idaho
Posts: 5

Original Poster
Rep: Reputation: Disabled
I was hoping to centralize them into one server that could handle all the printing tasks. Though Windows is more often than not reliable in reaching the printers directly, I still have problems connecting from time to time, having to reinstall printers, etc. I was hoping Samba would be much more reliable.
 
Old 09-21-2018, 08:03 PM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,750

Rep: Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222Reputation: 2222
I agree with ferrari. If the printers are already connected to the network, then each desktop should connect to them directly rather than try to route jobs through a central server.
Doing the latter just adds an unnecessary level of complexity (if it's even possible) IMO.
 
Old 09-23-2018, 09:20 AM   #5
PastorJeremyWilson
LQ Newbie
 
Registered: Sep 2018
Location: Idaho
Posts: 5

Original Poster
Rep: Reputation: Disabled
Bummer, I thought Samba could handle this. I guess I was wrong. Thanks anyways.
 
Old 09-23-2018, 04:48 PM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,842

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
It's not impossible, but it's not necessary.
 
Old 09-23-2018, 07:11 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
While it may not be of much use in a home environment central print servers are a necessity in the work environment. Although as probably many can a test to my print jobs have become stuck in a queue. cups via samba can be a central print server but it might of been easier to configure in the past...

If your Windows computers are directly connected to cups via its ipp port then you are indeed using it as a print server (at least as far as I know). The printers section is special because if you add the following lines in the global section samba will automatically create a share for all printers that are connected by cups. I do have special "printers" with their own share section but it is not required in your case.


I can't say I've had any problems with Windows connecting to network printers. While it should not be necessary I always assign them a static IP via DHCP reservation.

Code:
  in the global section...
 load printers = yes
   printing = cups
   printcap name = cups



[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700
 
1 members found this post helpful.
Old 09-24-2018, 08:18 AM   #8
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,151

Rep: Reputation: 393Reputation: 393Reputation: 393Reputation: 393
You don't say what version of Windows you are using. There are many documented issues with Windows 10 & samba printing. I gave up trying to use samba to get printers working for my wife's computer off my server. After awhile I just stuck with straight cups using the address
Code:
http://yourserver:631/printers/printername
Works flawlessly now. This admittedly doesn't have the convenience of keeping printer drivers available from the server though, which can be an issue.

Last edited by jmgibson1981; 09-24-2018 at 08:19 AM.
 
1 members found this post helpful.
Old 09-24-2018, 02:06 PM   #9
PastorJeremyWilson
LQ Newbie
 
Registered: Sep 2018
Location: Idaho
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
While it may not be of much use in a home environment central print servers are a necessity in the work environment. Although as probably many can a test to my print jobs have become stuck in a queue. cups via samba can be a central print server but it might of been easier to configure in the past...

If your Windows computers are directly connected to cups via its ipp port then you are indeed using it as a print server (at least as far as I know). The printers section is special because if you add the following lines in the global section samba will automatically create a share for all printers that are connected by cups. I do have special "printers" with their own share section but it is not required in your case.


I can't say I've had any problems with Windows connecting to network printers. While it should not be necessary I always assign them a static IP via DHCP reservation.

Code:
  in the global section...
 load printers = yes
   printing = cups
   printcap name = cups



[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

OK, so I'm seeing that there's a couple of lines that my config doesn't have: "printcap" and "create mask". I'll try including them and see if that makes a difference. Thanks!
 
Old 09-24-2018, 02:11 PM   #10
PastorJeremyWilson
LQ Newbie
 
Registered: Sep 2018
Location: Idaho
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jmgibson1981 View Post
You don't say what version of Windows you are using. There are many documented issues with Windows 10 & samba printing. I gave up trying to use samba to get printers working for my wife's computer off my server. After awhile I just stuck with straight cups using the address
Code:
http://yourserver:631/printers/printername
Works flawlessly now. This admittedly doesn't have the convenience of keeping printer drivers available from the server though, which can be an issue.
Yow, you're right! I didn't mention what Windows I'm using. 4 of my machines are running Windows 10, while one of them is running Windows 7. But it's been just two of the Windows 10 machines I've been using to test the printer setup, so that problem between 10 & Samba might be the core of my troubles.

Funny you mentioned about going through CUPS, because I was able to get them to work reliably through cups by using that same address format. Like you said, they won't be able to pull drivers from the server, but these printers are common enough that it looks like Windows won't have any troubles, driver-wise. That might just be the solution I land on.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CUPS and Samba error trying to print to a Windows shared printer... fcintron Linux - Server 2 12-10-2010 03:49 PM
Adding print driver to CUPS/Samba from Windows - printer doesn't display granny Linux - Server 2 01-08-2009 11:19 AM
Cant print using samba and cups to a windows printer araldit Linux - Networking 5 11-27-2007 09:21 PM
Can't print to Windows shared printer via Samba cdavidson Linux - General 1 04-19-2007 10:37 AM
Windows printer does not print using Samba ZhiYi Linux - Networking 0 02-28-2003 04:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration