LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't print to Windows printer, suspect Samba issue (https://www.linuxquestions.org/questions/linux-newbie-8/cant-print-to-windows-printer-suspect-samba-issue-4175523962/)

maples 10-31-2014 09:00 PM

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!

allend 10-31-2014 09:21 PM

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

ferrari 10-31-2014 11:03 PM

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.)

maples 11-01-2014 06:25 PM

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!

ferrari 11-01-2014 06:56 PM

The link that was given describes sharing via IPP and LPD.

ferrari 11-01-2014 07:03 PM

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?

maples 11-02-2014 07:18 AM

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!

ferrari 11-02-2014 01:03 PM

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.

EDDY1 11-02-2014 04:03 PM

Quote:

Bad device-uri "smb://PANTHERSPRIDE/HPPhotosmart C4200".
Could it be that you're using "//" instead of "\\"?

ferrari 11-02-2014 05:14 PM

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


maples 11-03-2014 05:56 AM

Quote:

Originally Posted by ferrari (Post 5263453)
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.

ferrari 11-03-2014 11:53 AM

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

maples 11-03-2014 01:28 PM

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.

maples 11-03-2014 03:02 PM

:doh: :banghead:

It was the %20 that did it.

Thanks! The two Arch computers now have no issues at all with printing!

ferrari 11-03-2014 03:28 PM

Great! Good to know. :)


All times are GMT -5. The time now is 01:42 AM.