LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-31-2014, 09:00 PM   #1
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Rep: Reputation: 265Reputation: 265Reputation: 265
Can't print to Windows printer, suspect Samba issue


Hi,
I've been trying to fix the printing on my Arch netbook and laptop for a while, and I'm stuck. There is a HP Photosmart printer attached to a Windows XP desktop that I would like to print to. I have a Debian server that has no problem printing to it.

When I try to add the printer, I use the exact same device URI that I used for the Debian box. The CUPS web interface tells me that it's a bad device URI.

I haven't managed to get Samba to actually run on the Arch computers, and I can't figure out why. All I did was comment out the default shares in the smb.conf. Testparm shows that the file is OK. However, when I try to start the service, it gives this error:
Code:
[anthony@anthony-eee ~]$ systemctl status samba -l
● samba.service - Samba AD Daemon
   Loaded: loaded (/usr/lib/systemd/system/samba.service; disabled)
   Active: failed (Result: exit-code) since Fri 2014-10-31 22:07:14 EDT; 46s ago
  Process: 26494 ExecStart=/usr/bin/samba $SAMBAOPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 26495 (code=exited, status=1/FAILURE)

Oct 31 22:07:14 anthony-eee samba[26494]: [2014/10/31 22:07:14.657008,  0] ../source4/smbd/server.c:370(binary_smbd_main)
Oct 31 22:07:14 anthony-eee samba[26494]: samba version 4.1.12 started.
Oct 31 22:07:14 anthony-eee samba[26495]: [2014/10/31 22:07:14.815088,  0] ../source4/smbd/server.c:475(binary_smbd_main)
Oct 31 22:07:14 anthony-eee samba[26495]: At this time the 'samba' binary should only be used for either:
Oct 31 22:07:14 anthony-eee samba[26495]: 'server role = active directory domain controller' or to access the ntvfs file server with 'server services = +smb' or the rpc proxy with 'dcerpc endpoint servers = remote'
Oct 31 22:07:14 anthony-eee samba[26495]: You should start smbd/nmbd/winbindd instead for domain member and standalone file server tasks
Oct 31 22:07:14 anthony-eee samba[26495]: [2014/10/31 22:07:14.815915,  0] ../lib/util/become_daemon.c:124(exit_daemon)
Oct 31 22:07:14 anthony-eee samba[26495]: STATUS=daemon failed to start: Samba detected misconfigured 'server role' and exited. Check logs for details, error code 22
Oct 31 22:07:14 anthony-eee systemd[1]: samba.service: main process exited, code=exited, status=1/FAILURE
Oct 31 22:07:14 anthony-eee systemd[1]: Unit samba.service entered failed state.
Another reason that I suspect that samba is the issue is the output of smbtree. On my Debian machine, it properly lists all of the shares of all the machines:
Code:
anthony@maples-server:~$ smbtree
Enter anthony's password: 
WORKGROUP
	\\PANTHERSPRIDE  		
		\\PANTHERSPRIDE\Printer        	Microsoft XPS Document Writer
		\\PANTHERSPRIDE\my-book        	
		\\PANTHERSPRIDE\C$             	Default share
		\\PANTHERSPRIDE\N$             	Default share
		\\PANTHERSPRIDE\ADMIN$         	Remote Admin
		\\PANTHERSPRIDE\Printer2       	Microsoft Office Document Image Writer
		\\PANTHERSPRIDE\HPPhotosmart C4200	HP Photosmart C4200 series
		\\PANTHERSPRIDE\M$             	Default share
		\\PANTHERSPRIDE\my-book-3.0    	
		\\PANTHERSPRIDE\SharedDocs     	
		\\PANTHERSPRIDE\print$         	Printer Drivers
		\\PANTHERSPRIDE\IPC$           	Remote IPC
	\\MAPLES-SERVER  		maples-server server
		\\MAPLES-SERVER\IPC$           	IPC Service (maples-server server)
		\\MAPLES-SERVER\srv            	Server Files
	\\ANTHONY-EEE    		Netbook
		\\ANTHONY-EEE\IPC$           	IPC Service (Netbook)
However, the netbook only lists the machines, but not any of the shares:
Code:
[anthony@anthony-eee ~]$ smbtree
Enter anthony's password: 
WORKGROUP
	\\PANTHERSPRIDE  		
	\\MAPLES-SERVER  		maples-server server
	\\ANTHONY-EEE    		Netbook
The smb.conf of the netbook:
Code:
[global]
	server string = Netbook
	log file = /var/log/samba/%m.log
	max log size = 50
	printcap name = /etc/printcap
	dns proxy = No
	idmap config * : backend = tdb
Thanks!

Last edited by maples; 10-31-2014 at 09:02 PM.
 
Old 10-31-2014, 09:21 PM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
Quote:
I've been trying to fix the printing on my Arch netbook and laptop for a while, and I'm stuck. There is a HP Photosmart printer attached to a Windows XP desktop that I would like to print to.
You do not need Samba to print to a shared printer on a Windows machine.
This link to the Arch documentation shows the necessary steps to add a Windows shared printer to CUPS. https://wiki.archlinux.org/index.php..._web_interface
 
Old 10-31-2014, 11:03 PM   #3
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,800

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
I'm inclined to agree with allend with regards to using alternative remote printing protocols (ie IPP or LPD). (However, if you decide to pursue samba printing, then you should compare your working Debian smb.conf with the Arch smb.conf.)
 
Old 11-01-2014, 06:25 PM   #4
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Original Poster
Rep: Reputation: 265Reputation: 265Reputation: 265
I checked with the Arch wiki link that you provided. The symlink was already in place. I checked the device URI that it suggested, and it didn't work either. (I've been doing "smb://PANTHERSPRIDE/HPPhotosmart C4200", without the quotes. Changing it to "smb://Windows Username@PANTHERSPRIDE/HPPhotosmart C4200" didn't help. Windows is setup not to need a password.) It still keeps giving this error:
Code:
Bad device-uri "smb://PANTHERSPRIDE/HPPhotosmart C4200".
I tried replacing PANTHERSPRIDE with the IP of the XP desktop (it has a static IP), and that didn't help either.

You mentioned using other printing methods. How would I go about setting those up?

Thanks!

Last edited by maples; 11-01-2014 at 06:27 PM.
 
Old 11-01-2014, 06:56 PM   #5
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,800

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
The link that was given describes sharing via IPP and LPD.
 
Old 11-01-2014, 07:03 PM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,800

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
The 'Bad device-uri' error is probably because the CUPS smb backend is missing.
Code:
lpinfo -v
or check if the smb backend is present via
Code:
dir /usr/lib/cups/backend/
Can you confirm that you have the samba client installed?
 
Old 11-02-2014, 07:18 AM   #7
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Original Poster
Rep: Reputation: 265Reputation: 265Reputation: 265
It looks like the backend is present:
Code:
[anthony@newerLaptop ~]$ lpinfo -v
network ipp
network ipps
network https
network lpd
network http
network socket
network smb
direct hp
direct hpfax
[anthony@newerLaptop ~]$ dir /usr/lib/cups/backend/
dnssd  hp  hpfax  http	https  ipp  ipps  lpd  parallel  serial  smb  snmp  socket  usb
I just reinstalled the package smbclient, and after restarting cups there was still no change.

I checked the Arch Wiki page again. The desktop is running Windows XP, but I tried it anyway with LPD. I replaced smb with lpd, and I still got a bad device URI error.

I'm not sure if I want to add an additional service to run the IPP server for the XP machine. It's my parents' computer, and it's slow enough as it is...

I manage to make it work, though. Since the Debian computer could print with no problem, I enabled printer sharing on the Debian box and pointed the Arch computers to print through it. It's a roundabout way, but it works.

Thanks for the help and patience!
 
Old 11-02-2014, 01:03 PM   #8
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,800

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
If your workaround is acceptable to you then all is fine. However, I didn't notice the URI has a space in the printer name. That could well be the cause of the error
Code:
Bad device-uri "smb://PANTHERSPRIDE/HPPhotosmart C4200".
Instead, you should try renaming the printer name in the windows machine to 'HPPhotosmart_C4200' or similar, and then do the same in the Linux machine. You'll probably reach it okay after that.
 
Old 11-02-2014, 04:03 PM   #9
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Bad device-uri "smb://PANTHERSPRIDE/HPPhotosmart C4200".
Could it be that you're using "//" instead of "\\"?
 
Old 11-02-2014, 05:14 PM   #10
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,800

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
No, the URI should look something like
Code:
smb://server/printer
smb://workgroup/server/printer
smb://username:password@server/printer
smb://username:password@workgroup/server/printer
 
Old 11-03-2014, 05:56 AM   #11
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Original Poster
Rep: Reputation: 265Reputation: 265Reputation: 265
Quote:
Originally Posted by ferrari View Post
If your workaround is acceptable to you then all is fine. However, I didn't notice the URI has a space in the printer name. That could well be the cause of the error
Code:
Bad device-uri "smb://PANTHERSPRIDE/HPPhotosmart C4200".
Instead, you should try renaming the printer name in the windows machine to 'HPPhotosmart_C4200' or similar, and then do the same in the Linux machine. You'll probably reach it okay after that.
I noticed that too, when I set it up on the Debian computer. I looked around, and from what I found, CUPS can handle spaces in device URIs. The Debian CUPS handles it fine, at least.

Thanks for the suggestion. I'll probably just stick with it the way it is, since other Windows computers on the network still expect the space in the name.
 
Old 11-03-2014, 11:53 AM   #12
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,800

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Quote:
I noticed that too, when I set it up on the Debian computer. I looked around, and from what I found, CUPS can handle spaces in device URIs. The Debian CUPS handles it fine, at least.
Yes, I think you may be right, but maybe the space should be replaced with %20 so that the URI looks like
Code:
smb://PANTHERSPRIDE/HPPhotosmart%20C4200
There seems to be a lot of old bug reports and threads discussing this behaviour when one searches
https://bugzilla.redhat.com/show_bug.cgi?id=702526
http://ubuntuforums.org/showthread.php?t=1770014
https://bugs.launchpad.net/ubuntu/+s...in/+bug/909769
 
1 members found this post helpful.
Old 11-03-2014, 01:28 PM   #13
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Original Poster
Rep: Reputation: 265Reputation: 265Reputation: 265
Interesting... I might try that when I get home.

Thanks!

I find it unusual that the Debian version of CUPS handles it just fine, while the Arch version (that's most likely newer, since Arch is rolling-release) can't.

Last edited by maples; 11-03-2014 at 01:31 PM.
 
Old 11-03-2014, 03:02 PM   #14
maples
Member
 
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Original Poster
Rep: Reputation: 265Reputation: 265Reputation: 265


It was the %20 that did it.

Thanks! The two Arch computers now have no issues at all with printing!
 
Old 11-03-2014, 03:28 PM   #15
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,800

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
Great! Good to know.
 
  


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
Can't print from windows 7 - Samba Printer Share djsmiley2k Linux - Networking 4 09-06-2010 09:30 PM
Samba Printer - Windows Print Queue Popsicle-Pete Linux - Server 0 09-04-2008 06:12 PM
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 - Newbie

All times are GMT -5. The time now is 12:24 AM.

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