[SOLVED] Can't print to Windows printer, suspect Samba issue
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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
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.)
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?
[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.
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.
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.