smbclient stopped working, returns NT_STATUS_BAD_NETWORK_NAME

No config changes on the VM or host occurred; results from Google and SE didn't solve issue


I have been using a script to backup some stuff from a Debian VM onto a Windows 7 host (the Debian VM sits on the same Windows 7 host) that worked fine until a couple of days ago, with one of the commands being:

smbclient //MYWINPC/myShare -U=myusername -c "put $2.sql.gz db/$2.sql.gz"
  • The script suddenly stopped working yesterday, returning the following error:
    tree connect failed: NT_STATUS_BAD_NETWORK_NAME


Troubleshooting:

  1. Reverted to a VM snapshot of when the script was still working: now it no longer works and produces the error above
  2. Since Windows Event Viewer was throwing out the following error, I changed /etc/samba/smb.conf to prevent the Debian VM from participating in master browser elections, to no avail
    The master browser has received a server announcement from the computer <my Debian VM> that believes that it is the master browser for the domain on transport NetBT_Tcpip_{<NetBT_Tcpip_ID>.
    The master browser is stopping or an election is being forced.
  3. Tried accessing the Debian VM from the Windows 7 host via Samba (successful)
  4. Disabled Windows Firewall: no change
  5. smbclient log shows smbclient is trying to access the share locally rather than on the Windows 7 host:
    [2020/08/17 11:06:46.714698, 0] ../source3/param/loadparm.c:3362(process_usershare_file)
    process_usershare_file: stat of /var/lib/samba/usershares/myShare failed. Permission denied
    [2020/08/17 11:06:46.715915, 0] ../source3/param/loadparm.c:3362(process_usershare_file)
    process_usershare_file: stat of /var/lib/samba/usershares/myShare failed. No such file or directory
  6. smbclient still works when I replace the hostname with its IP address, so somehow the VM is no longer able to resolve the NetBIOS name:
    smbclient //192.168.1.24/myShare -U=myusername -c "put $2.sql.gz db/$2.sql.gz"
  7. From a different Windows PC, I can browse the Windows 7 host and its shares directly by browsing via Network in File Manager, so there should be no name resolution issues per se
  8. nbtstat -r returns the following, so I am not sure why the NetBIOS name for the Windows 7 machine is not included:
    NetBIOS Names Resolution and Registration Statistics
    ---------------------------------------------------- Resolved By Broadcast = 4 Resolved By Name Server = 0 Registered By Broadcast = 18 Registered By Name Server = 0
    NetBIOS Names Resolved By Broadcast
    --------------------------------------------- <ROUTERNAME> <DEBIANVM> <ROUTERNAME> <DEBIANVM>
  9. Running smbtree -b produces unexpected results: all shares enumerated point to the Debian VM where Samba is installed, rather than displaying the actual shares for each machine (shares enumerated are incorrect for all machines except DEBIANVM):
    WORKGROUP \\DEBIANVM Samba 4.9.5-Debian \\DEBIANVM\IPC$ IPC Service (Samba 4.9.5-Debian) \\DEBIANVM\homedir \\DEBIANVM\webdir \\DEBIANVM\print$ Printer Drivers \\MYWINPC-2 \\MYWINPC-2\IPC$ IPC Service (Samba 4.9.5-Debian) \\MYWINPC-2\homedir \\MYWINPC-2\webdir \\MYWINPC-2\print$ Printer Drivers \\MYWINPC MYWINPC \\MYWINPC\IPC$ IPC Service (Samba 4.9.5-Debian) \\MYWINPC\homedir \\MYWINPC\webdir \\MYWINPC\print$ Printer Drivers
    ROUTERNAME \\ROUTERNAME Router Gateway \\ROUTERNAME\IPC$ IPC Service (Samba 4.9.5-Debian) \\ROUTERNAME\homedir \\ROUTERNAME\webdir \\ROUTERNAME\print$ Printer Drivers
  10. Upgraded VirtualBox to v. 5.2.44 (added for tracking purposes only)


Any idea as to what the problem is?

6 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like