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

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
racepics

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

Post 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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
heavy metal
Level 3
Level 3
Posts: 149
Joined: Mon Jan 25, 2010 11:00 pm
Location: Puerto Rico

Re: Shared Printer Problems. Mint-to-XP

Post by heavy metal »

Debian 12 Gnome on a MSI H61M-P25 (B3) PC & on a Dell Latitude E6410 & HP EliteBook 8540p Laptops.
LMDE 6 on a Panasonic ToughBook CF-C1 Laptop.
Bodhi Linux 7 on a HP Compaq DC5750 Small Form Factor PC.
Windows 11 on a Intel DH55TC PC.
racepics

Re: Shared Printer Problems. Mint-to-XP

Post 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)
altair4
Level 20
Level 20
Posts: 11454
Joined: Tue Feb 03, 2009 10:27 am

Re: Shared Printer Problems. Mint-to-XP

Post 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
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
racepics

Re: Shared Printer Problems. Mint-to-XP

Post 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 $>
altair4
Level 20
Level 20
Posts: 11454
Joined: Tue Feb 03, 2009 10:27 am

Re: Shared Printer Problems. Mint-to-XP

Post 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.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
racepics

Re: Shared Printer Problems. Mint-to-XP

Post 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 $>
altair4
Level 20
Level 20
Posts: 11454
Joined: Tue Feb 03, 2009 10:27 am

Re: Shared Printer Problems. Mint-to-XP

Post 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.
Last edited by altair4 on Mon Aug 27, 2012 4:13 pm, edited 2 times in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
racepics

Re: Shared Printer Problems. Mint-to-XP

Post 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
altair4
Level 20
Level 20
Posts: 11454
Joined: Tue Feb 03, 2009 10:27 am

Re: Shared Printer Problems. Mint-to-XP

Post 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.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
racepics

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

Post 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 $>
altair4
Level 20
Level 20
Posts: 11454
Joined: Tue Feb 03, 2009 10:27 am

Re: Shared Printer Problems. Mint-to-XP

Post by altair4 »

Whew ! Sorry for the long path to this.

So the WinXP machine can find and print to the Mint printer?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
racepics

Re: Shared Printer Problems. Mint-to-XP

Post by racepics »

Yes - tested and working :)
Thanks!
rickyrockrat

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

Post 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
Locked

Return to “Printers & Scanners”