You are not logged in.

#1 2023-07-25 19:12:56

Ayu2805
Member
Registered: 2023-07-23
Posts: 52

[Solved]Can't connect to printer via samba

I have shared my Epson L130 Series printer(connected via USB) from my Device A(windows) and I want to access that printer from my Device B(Arch), where Device A and B are on the same network. Although I have installed "SAMBA" by following process:

yay -S samba
sudo touch /etc/samba/smb.conf
sudo groupadd -r sambauser
sudo usermod -aG sambauser $(whoami)
sudo smbpasswd -a $(whoami)
sudo ufw allow CIFS
sudo cp samba /etc/ufw/applications.d/
sudo ufw app update Samba
sudo ufw allow Samba
sudo systemctl enable smb
sudo systemctl enable nmb

I have also installed the required driver 1 2, Although I can add the printer via CUPS or system-config-printer, I can't print anything. In printer state(system config printer) it shows:

Processing - Unable to connect to CIFS host: NT_STATUS_NOT_FOUND. Will retry in 60 seconds...

and on CUPS(localhost:631) it shows:

"Connection failed: NT_STATUS_NOT_FOUND"

When I do:

$ sudo systemctl status smb
● smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; preset: disabled)
     Active: active (running) since Tue 2023-07-25 23:39:44 IST; 46min ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 1879 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 4 (limit: 4414)
     Memory: 10.7M
        CPU: 596ms
     CGroup: /system.slice/smb.service
             ├─1879 /usr/bin/smbd --foreground --no-process-group
             ├─1882 "smbd: notifyd "
             ├─1883 "smbd: cleanupd"
             └─3513 "smbd: client [192.168.1.3]"

Jul 26 00:19:29 archlinux smbd[3513]: [2023/07/26 00:19:29.022692,  0] ../../lib/util/debug.c:1261(reopen_one_log)
Jul 26 00:19:29 archlinux smbd[3513]:   reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.windows': No such file or directory
Jul 26 00:22:29 archlinux smbd[3513]: [2023/07/26 00:22:29.168797,  0] ../../lib/util/debug.c:1261(reopen_one_log)
Jul 26 00:22:29 archlinux smbd[3513]:   reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.windows': No such file or directory
Jul 26 00:22:29 archlinux smbd[3513]: [2023/07/26 00:22:29.169289,  0] ../../lib/util/debug.c:1261(reopen_one_log)
Jul 26 00:22:29 archlinux smbd[3513]:   reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.windows': No such file or directory
Jul 26 00:25:29 archlinux smbd[3513]: [2023/07/26 00:25:29.302562,  0] ../../lib/util/debug.c:1261(reopen_one_log)
Jul 26 00:25:29 archlinux smbd[3513]:   reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.windows': No such file or directory
Jul 26 00:25:29 archlinux smbd[3513]: [2023/07/26 00:25:29.303157,  0] ../../lib/util/debug.c:1261(reopen_one_log)
Jul 26 00:25:29 archlinux smbd[3513]:   reopen_one_log: Unable to open new log file '/usr/local/samba/var/log.windows': No such file or directory

Also the smb.conf contains the default conf. I don't know if it can create any issue or not. Or maybe I have much more to do in windows than just share the printer. I don't think its a firewall issue of Linux because I did everything the wiki says and followed this youtube video. Or maybe I am missing some dependency. hmm

I can samba share a folder from linux to windows though, I don't know what to do with this printer issue. BTW I am on cinnamon DE.

Thank you for reading this. smile

Last edited by Ayu2805 (2023-09-01 11:37:07)

Offline

#2 2023-07-25 20:12:57

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: [Solved]Can't connect to printer via samba

https://wiki.archlinux.org/title/Samba# … ork_shares
https://wiki.archlinux.org/title/CUPS/T … nt_servers

I don't think you need the smd daemon, but

I can add the printer via CUPS or system-config-printer

what exact printer URI did you add? Does it match the smbtree finds?

Offline

#3 2023-07-26 05:09:12

Ayu2805
Member
Registered: 2023-07-23
Posts: 52

Re: [Solved]Can't connect to printer via samba

I have given the windows system 192.168.1.3 as IP address.

$ nmap -p 445 "192.168.1.3"
Starting Nmap 7.94 ( https://nmap.org ) at 2023-07-26 10:28 IST
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 3.04 seconds

$ nmap -Pn "192.168.1.3"
Starting Nmap 7.94 ( https://nmap.org ) at 2023-07-26 10:28 IST
Nmap scan report for 192.168.1.3
Host is up (0.00047s latency).
Not shown: 996 filtered tcp ports (no-response)
PORT     STATE SERVICE
135/tcp  open  msrpc
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
5357/tcp open  wsdapi

Nmap done: 1 IP address (1 host up) scanned in 4.90 seconds
seth wrote:

what exact printer URI did you add? Does it match the smbtree finds?

I just added smb://windows/l130 as my windows' device name is windows and I have renamed the shared printer as l130 instead of Epson L130 Series. Also smbtree not showing anything

$ smbtree -U "<windows username>"
smbXcli_negprot_smb1_done: No compatible protocol selected by server.
smbXcli_negprot_smb1_done: No compatible protocol selected by server.

Offline

#4 2023-07-26 05:25:22

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: [Solved]Can't connect to printer via samba

"<windows username>" is a placeholder, just skip the entire "-U …" part.
Can you

ping -c 1 windows

Offline

#5 2023-07-26 06:43:47

Ayu2805
Member
Registered: 2023-07-23
Posts: 52

Re: [Solved]Can't connect to printer via samba

seth wrote:

Can you

ping -c 1 windows
$ ping -c 1 windows
ping: windows: No address associated with hostname

Although by changing windows to it's IP address I get:

$ ping -c 1 192.168.1.3
PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data.
64 bytes from 192.168.1.3: icmp_seq=1 ttl=128 time=1.06 ms

--- 192.168.1.3 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.063/1.063/1.063/0.000 ms

Last edited by Ayu2805 (2023-07-26 06:46:44)

Offline

#6 2023-07-26 06:49:01

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: [Solved]Can't connect to printer via samba

What did you intend to do the hostname resolution?
Avahi? Wins?
Did you check what just "smbtree" finds?

Offline

#7 2023-07-26 07:09:00

Ayu2805
Member
Registered: 2023-07-23
Posts: 52

Re: [Solved]Can't connect to printer via samba

seth wrote:

What did you intend to do the hostname resolution?
Avahi? Wins?

Apologies but I don't understand what u mean. After setting workgroup = WORKGROUP in smb.conf the output changes to the following

$ smbtree
main: This is utility doesn't work if netbios name resolution is not configured.
If you are using SMB2 or SMB3, network browsing uses WSD/LLMNR, which is not yet supported by 
Samba. SMB1 is disabled by default on the latest Windows versions for security reasons. It is still
possible to access the Samba resources directly via \name or \ip.address.

Offline

#8 2023-07-26 07:20:35

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: [Solved]Can't connect to printer via samba

https://wiki.archlinux.org/title/Samba
Domain resolution doesn't work by sheer magic, something has to provide the knowledge that some host called "windows" is reachable by 192.168.1.3
There're multiple ways to achieve that DNS to a static entry in /etc/hosts - or you just use the IP

https://wiki.archlinux.org/title/Samba# … lic_shares

Offline

#9 2023-07-26 16:05:29

Ayu2805
Member
Registered: 2023-07-23
Posts: 52

Re: [Solved]Can't connect to printer via samba

I just can't wrap all these around my head. It will be kind of you to provide me the whole procedure for samba so that i can access my printer. Thanks a lot smile

Last edited by Ayu2805 (2023-07-26 16:05:41)

Offline

#10 2023-07-26 16:25:12

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: [Solved]Can't connect to printer via samba

Delete archlinux and install widows.

Offline

#11 2023-07-26 16:26:11

Ayu2805
Member
Registered: 2023-07-23
Posts: 52

Re: [Solved]Can't connect to printer via samba

hmm dual boot a better choice XD

Offline

#12 2023-07-26 19:24:59

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: [Solved]Can't connect to printer via samba

Feel free to re-open this anytime you're ready to actually explore this, but pelase understand that "I don't want to use my brain, please turn me into a click-drone and configure the system for me" is not an approach you can take with archlinux (nor should with any system, frankly)

Offline

#13 2023-07-27 04:02:29

Ayu2805
Member
Registered: 2023-07-23
Posts: 52

Re: [Solved]Can't connect to printer via samba

I am just tired by doing all the stuff for like past 4 days but can't fix this printer issue. Even though I can file share via samba I can't access the printer via samba. I configured my arch with this script I made. I dont know if it is doing something that it shouldn't do. But yeah I will reopen this when I feel like i should fix this issue for real.

Last edited by Ayu2805 (2023-07-27 04:27:09)

Offline

#14 2023-09-01 11:53:53

Ayu2805
Member
Registered: 2023-07-23
Posts: 52

Re: [Solved]Can't connect to printer via samba

Well I used IP address instead of using "windows", I could have set by doing a static entry like you said but...yeah IP address is simple enough.

Offline

Board footer

Powered by FluxBB