Page 1 of 1

Shared Printer Problems. Mint-to-XP [SOLVED]

Posted: Sun Aug 26, 2012 11:01 pm
by racepics
Hi all , I'm using Mint 13 MATE 64bit and I have a Canon iP4500 connected by usb and shared. I'm connected via wireless to our Modem/router.
The wife's PC is WinXP64 and connected via eth cable. While the XP PC can see my shared printer, it cannot connect to it. "Windows cannot connect to the printer. The specified printer has lost its connection to the sever.. etc"
Samba file sharing is working fine though, I have shared directories that she has mounted as network-drives and that all works perfectly.
The XP machine does have the correct drivers (they are listed in the search) as the printer has been connected directly to that PC before.

So the printer is enabled and shared and published. XP can see it, but cannot connect to it. Almost seems to be some sort of permissions issue?

Any help greatly appreciated.

Chris

Re: Shared Printer Problems. Mint-to-XP

Posted: Sun Aug 26, 2012 11:08 pm
by heavy metal

Re: Shared Printer Problems. Mint-to-XP

Posted: Sun Aug 26, 2012 11:46 pm
by racepics
This all worked perfectly when I was using Ubuntu so seeing as Mint is derived from that, I would have thought it would still just work.
(installing virtualbox and another os is a really ugly workaround and kinda defeats the purpose of using linux in the first place)

Re: Shared Printer Problems. Mint-to-XP

Posted: Mon Aug 27, 2012 6:55 am
by altair4
First, make sure the printer on Mint is shared and the CUPS server is running and set to publish that shared printer and that Samba is allowing access to the printer. You stated in your post that you did all this but I'm just trying to rule out the basics:

Run the following command:

Code: Select all

system-config-printer
** Publish Shared Printers

Server > Settings > Select the following:

Publish Shared Printers connected to this system
Allow printing from the Internet

** Enable Sharing of the Attached Printer

Right Click the attached printer > Properties > Policies
Check Enabled, Accepting Jobs, and Shared

** To allow guest access through Samba:

Edit smb.conf as root:

Code: Select all

gksu gedit /etc/samba/smb.conf
Look for the [printers] share and change the "guest ok" line from no to yes and add another line:
[printers]
comment = All Printers
browseable = No
path = /var/spool/samba
printable = yes
guest ok = yes
printer admin = @lpadmin
read only = yes
create mask = 0700
Save smb.conf and restart samba:

Code: Select all

sudo service smbd restart 
Second, just to make sure the firewall isn't getting in the way disable it on Mint and see if that it is the issue:

Code: Select all

sudo ufw disable
Third, there is a bug in the latest Ubuntu that follows through to Mint that may or may not affect you. To see if it does open a terminal and run the following command:

Code: Select all

sudo rpcclient localhost
The prompt changes to "rpcclient $>. At that point enter the following command

Code: Select all

enumprinters
You may get an output that looks something like this:
flags:[0x800000]
name:[\\LOCALHOST\]
description:[\\LOCALHOST\,,HP970-Photo]
comment:[HP970-Photo]
Note that the description and the comment contain the correct printer name but the "name" field only contains LOCALHOST. . It's the "name" that Windows needs to connect to and it's empty. To exit the terminal type:

Code: Select all

exit
If the "name" field has the correct printer name then the problem is something else. If it's empty as it is above then see here for how to correct it: http://forums.linuxmint.com/viewtopic.p ... 65#p618065

Re: Shared Printer Problems. Mint-to-XP

Posted: Mon Aug 27, 2012 3:03 pm
by racepics
Thanks for your response. I found that my smb.conf didn't have the printer 'admin = @lpadmin' line so inserted that.

Code: Select all

enumprinters
Gives me this.
flags:[0x800000]
name:[\\LOCALHOST\]
description:[\\LOCALHOST\,,iP4500]
comment:[iP4500]
So I tried to set the printer name

Code: Select all

setprintername iP4500 iP4500
I get this
rpcclient $> setprintername iP4500 iP4500
result was WERR_ACCESS_DENIED
rpcclient $>

Re: Shared Printer Problems. Mint-to-XP

Posted: Mon Aug 27, 2012 3:48 pm
by altair4
That's my fault, sorry. I have in my global section a "force user" which is not the default and I forgot that it was there.

Add one more line to the [printers] section please:
[printers]
comment = All Printers
browseable = No
path = /var/spool/samba
printable = yes
guest ok = yes
printer admin = @lpadmin
force user = altiar
read only = yes
create mask = 0700
Change altair to your own login user name

Restart samba again: sudo service smbd restart

Then do the sudo rpcclient localhost process again.

Re: Shared Printer Problems. Mint-to-XP

Posted: Mon Aug 27, 2012 3:56 pm
by racepics
Thanks - added that line (with my username) but the setprintername process still gives this


rpcclient $> enumprinters
flags:[0x800000]
name:[\\LOCALHOST\]
description:[\\LOCALHOST\,,iP4500]
comment:[iP4500]

rpcclient $> setprintername iP4500 iP4500
result was WERR_ACCESS_DENIED
rpcclient $>

Re: Shared Printer Problems. Mint-to-XP

Posted: Mon Aug 27, 2012 3:59 pm
by altair4
Please post the output of the following command:

Code: Select all

testparm -s
EDIT: Do it this way to bypass everything:

Remove "force user = altair" from the [printers] section and add it to the [global] section - right under the workgroup line:
# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP
force user = altair
Then restart samba and try it again.

Re: Shared Printer Problems. Mint-to-XP

Posted: Mon Aug 27, 2012 4:10 pm
by racepics
testparm -s
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[printers]"
WARNING: The "printer admin" option is deprecated
Processing section "[print$]"
Processing section "[disk-1]"
Processing section "[disk-2]"
Loaded services file OK.
Server role: ROLE_STANDALONE
[global]
server string = %h server (Samba, Ubuntu)
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
usershare allow guests = Yes
panic action = /usr/share/samba/panic-action %d
idmap config * : backend = tdb

[printers]
comment = All Printers
path = /var/spool/samba
printer admin = @lpadmin
force user = chris
create mask = 0700
guest ok = Yes
printable = Yes
print ok = Yes
browseable = No

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

[disk-1]
path = /media/disk-1
read only = No
guest ok = Yes

[disk-2]
path = /media/disk-2
read only = No
guest ok = Yes

Re: Shared Printer Problems. Mint-to-XP

Posted: Mon Aug 27, 2012 4:13 pm
by altair4
Posted past each other - I don't know if you saw my edit:

EDIT: Do it this way to bypass everything:

Remove "force user = altair" from the [printers] section and add it to the [global] section - right under the workgroup line:
# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP
force user = altair
Then restart samba and try it again.

Re: Shared Printer Problems. Mint-to-XP [SOLVED]

Posted: Mon Aug 27, 2012 4:23 pm
by racepics
You Sir, are a Genius! Thankyou :)

rpcclient $> setprintername iP4500 iP4500
Success in setting printername.
rpcclient $>

rpcclient $> enumprinters
flags:[0x800000]
name:[\\LOCALHOST\iP4500]
description:[\\LOCALHOST\iP4500,Canon iP4500 series,iP4500]
comment:[iP4500]

rpcclient $>

Re: Shared Printer Problems. Mint-to-XP

Posted: Mon Aug 27, 2012 4:30 pm
by altair4
Whew ! Sorry for the long path to this.

So the WinXP machine can find and print to the Mint printer?

Re: Shared Printer Problems. Mint-to-XP

Posted: Mon Aug 27, 2012 4:31 pm
by racepics
Yes - tested and working :)
Thanks!

Re: Shared Printer Problems. Mint-to-XP [SOLVED]

Posted: Mon Jan 14, 2013 2:10 pm
by rickyrockrat
force user =
Is not necessary. Use this and it will find the user:
rpcclient -U "WORKGROUP\user" -H server
here's a link to the bug in Samba - see for even more info:

https://bugs.launchpad.net/ubuntu/+sour ... bug/967410