A workaround for the following error message if you are using Ubuntu 12.04, Xubuntu 12.04, or Mint13-Gnome:
"Windows cannot connect to the printer. Either the printer name was typed incorrectly or the specified printer has lost its connection to the sever".
On the machine that has the printer attached to it:
[1] Add a line to the [printers] section in smb.conf:
[printers]
comment = All Printers
browseable = hdhd
path = /var/spool/samba
printable = yes
guest ok = yes
printer admin = @lpadmin
; read only = yes
create mask = 0700
And add one more 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
Change altair to your own login user name
[2] Run the following commands just to make sure everything is running in the right order:
Code: Select all
sudo service cups restart
sudo service smbd restart
[3] Then run the following command:
The prompt changes to "rpcclient $>. At that point enter the following command
What you may get is something like this:
flags:[0x800000]
name:[\\LOCALHOST\]
description:[\\LOCALHOST\,,HP970-Photo]
comment:[HP970-Photo]
Note that the comment and the description have the correct printer name but "name:" only shows \\LOCALHOST.
CUPS supplies the printer name to samba and samba in turn displays that name to Windows but when Windows tries to connect to that printer all it sees is \\LOCALHOST not a printer. To fix this:
While in the terminal at the rpcclient $> prompt enter the command like this example:
Code: Select all
setprintername HP970-Photo HP970-Photo
You should get the following if this was successful:
rpcclient $> setprintername HP970-Photo HP970-Photo
Success in setting printername.
Just as a check run the enumprinters command again and you should get this:
flags:[0x800000]
name:[\\LOCALHOST\HP970-Photo]
description:[\\LOCALHOST\HP970-Photo,,HP970-Photo]
comment:[HP970-Photo]
Now it has a name that Windows can deal with.
By the way this also fixes the problem of a Linux client trying to access a printer through Samba and being asked repeatedly for a username and password.
To escape the prompt just enter exit then hit enter:
rpcclient $> exit
Now see if the client machine can connect to the samba printer.