Printer sharing with Samba

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read this

Printer sharing with Samba

Postby mikeglaz on Sat Nov 17, 2012 7:24 pm

Can someone help me set up a Linux/Windows Vista printer sharing network? The Samba documentation is outdated as it refers to Windows 95/98 and Windows NT. Plus it's constantly assuming things it's referring to that I understand them.

I have a wireless router through which I access the internet with my Linux Mint box and a Windows Vista laptop. I have a printer connected to my Linux machine. I would like to be able to print from the Vista machine. I have Samba installed on my Linux machine.

When I go into the Network and Sharing Center on my Windows laptop and click on the wireless network I can see my Linux machine on there. But when I try to access it it says, "Windows cannot access \\DESKTOP".

I tried adding a printer and pointing to the IP/printer name of my Linux box but no luck.

thanks,
mike
mikeglaz
Level 2
Level 2
 
Posts: 62
Joined: Tue Feb 28, 2012 10:32 pm

Linux Mint is funded by ads and donations.
 

Re: Printer sharing with Samba

Postby altair4 on Sun Nov 18, 2012 10:39 am

You seem to have 2 distinct problems but the most serious is not being able to access by ip address.

I would go though this checklist first: Samba Browsing Problems Checklist: viewtopic.php?f=42&t=88146&start=0

You might also find this some help: Network Printer Sharing: viewtopic.php?f=42&t=28397

If those 2 don't resolve the issue please post the output of the following commands:
Code: Select all
testparm -s
smbtree


BTW, there's a bug that cups / samba have apparently no intention of fixing that prevents access to a cups printer by name. I have a work around ( and a rather complicated one ) in the Printer HowTo above. But the easiest way is to access it by ip address:
Code: Select all
http://192.168.0.100:631/printers/printer-name
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6138
Joined: Tue Feb 03, 2009 10:27 am

Re: Printer sharing with Samba

Postby mikeglaz on Mon Nov 19, 2012 12:24 am

Ok, I'm able to access my Linux Desktop from my Windows Laptop. But when I try to access the printer connected to the desktop via the laptop I get the following error:
"Windows cannot connect to the printer."

My smb.conf looks like this:
Code: Select all
# Global parameters
[global]
        workgroup = WORKGROUP

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

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
   load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
   printing = bsd
   printcap name = /etc/printcap

# CUPS printing.  See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
   printing = cups
   printcap name = cups


testparm -s
Code: Select all
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[printers]"
Global parameter load printers found in service section!
Global parameter printcap name found in service section!
Loaded services file OK.
Server role: ROLE_STANDALONE
[global]
   idmap config * : backend = tdb

[printers]
   comment = All Printers
   path = /var/spool/samba
   create mask = 0700
   guest ok = Yes
   printable = Yes
   print ok = Yes
   browseable = No


smbtree
Code: Select all
WORKGROUP
   \\MOTHER-PC            
   \\DESKTOP              Samba 3.6.3
      \\DESKTOP\ML-2010           Samsung ML-2010
      \\DESKTOP\IPC$              IPC Service (Samba 3.6.3)
mikeglaz
Level 2
Level 2
 
Posts: 62
Joined: Tue Feb 28, 2012 10:32 pm

Re: Printer sharing with Samba

Postby pdc_2 on Mon Nov 19, 2012 1:11 am

you might like to do a bit of homework ....... and read this thread

viewtopic.php?f=198&t=99564

where a couple of experts offer advice on samba issues ............ :D
pdc_2
Level 6
Level 6
 
Posts: 1181
Joined: Mon May 11, 2009 1:21 am

Re: Printer sharing with Samba

Postby altair4 on Mon Nov 19, 2012 8:26 am

[[1]] All of the things that you spent so much time removing from smb.conf were put there for a reason. For example, you can not access any resources on your machine as a guest from Windows because you removed a line that enables it. My recommendation is to rebuild samba on your machine:

(1) Make sure the following file exists:
/usr/share/samba/smb.conf

(2) Make a backup of your current smb.conf
Code: Select all
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

(3) Copy the default:
Code: Select all
sudo cp -a /usr/share/samba/smb.conf /etc/samba/

(4) Correct one mistake in the newly copied smb.conf:
Find the line:
encrypt passwords = false

Could also be listed as "no"

and change it to:
Code: Select all
encrypt passwords = true

(5) Restart samba
Code: Select all
sudo service smbd restart


[[2]] Now you have a choice.

** Access the printer by name using the Mint machines ip address as I describe in the Howto I linked to above. Using Windows Add Printer utility:
Code: Select all
http://192.168.0.100:631/printers/printer-name

** If you happen to have iTunes installed on that Windows machine you can also access it by a qualified hostname:
Code: Select all
http://mint-host-name.local:631/printers/printer-name

** If you still want to browse to the printer by name then you will have to implement a rather nasty work around since cups / samba / Ubuntu have no intention of fixing a bug preventing it. That workaround can be found here: viewtopic.php?f=42&t=28397&start=40#p618065

There is one other option now that your smb.conf has been returned to the factory settings and that is to connect to the printer the way a Mac would by installing a utility on your Windows box: Bonjour Print Services for Windows: http://support.apple.com/kb/DL999
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 16
Level 16
 
Posts: 6138
Joined: Tue Feb 03, 2009 10:27 am

Re: Printer sharing with Samba

Postby Arkon55 on Sun Mar 17, 2013 11:28 am

Altair-4 you are a STAR =!!

That Apple Bonjour Windows Util, is a joy !

I was looking a complete idiot 8) Not difficult. I'd played with the whole Samba .conf , the CUPS. I could see the Linux Mint machine, but Windows wouldn't play.

Brilliant. MANY THANKS.

Arkon_The_<_Invincible
Arkon55
Level 1
Level 1
 
Posts: 1
Joined: Sun Mar 17, 2013 11:19 am


Return to Other networking topics

Who is online

Users browsing this forum: No registered users and 6 guests