Having just acquired a Raspberry Pi Model 3, I am attempting to set it up as an NAS. So far I have set up the Raspberry Pi OS and configured samba. It appears to be working fine except for one minor problem. While I can remote in using TightVNC, I cannot map to any of my media folders from Windows 10 or Windows 11.

So far I have tried

  1. forcing SMB2 protocol on Pi by adding "protocol = smb2" to smb.conf
  2. enabling SMB1 in windows features

The instructions say to use "\raspberrypi\NAS" as the "browse to" folder. NAS is the name I set up in smb.conf. It asks for username/password but just responds with

2023-09-29_122752.jpg

I can browse to \10.0.0.177 or \raspberrypi and it shows my NAS share, but when I try to open NAS I just get the same error. There is probably some setting that needs to be tweaked that all the help sites I've been to are omitting because they are assuming I already know. Any suggestions will be much appreciated.

I already have file and printer sharing enabled (I can map to folders on other machines).

Recommended Answers

All 7 Replies

I set up same a few years ago. There's one more step I did back then but given the time that has passed it may or may not apply. But hey, data freely shared here. What was it?

I had to add one more account on the Pi. The username and password was the same as what I use on my Windows PC. If you want to read longer prior discussions on this, Google "Windows 10 uses Windows account for SMB". There may be more work on the shared folder permissions on the Pi but this area has tripped up far too many so I'll start with this nugget.

Ya gotta love how all the tutorials stress how "easy" it is to do projects on Raspberry Pi, while nor providing enough information to actually get the projects running. And this is certainly not unique to Raspberry Pi. I've gone through several of the step-by-step tutorials on setting up NAS. None of them mention "what can go wrong", or any of the various tweaks that are actually required. For example (problems and advice)

Your version of WIndows has access to remote SMB shares as a guest disabled. This has been the default for some years.

Guest access is enabled on the share but the [global} section has no, or an incorrectly set map to guest and your windows PC is attempting to login to the server with a user name that does not exist.

Permissions on the file system do not permit access by the Linux user/group Samba is mappign your windows user to (for guest access that's usualy nobody anf nogroup)

Ensure that the path /home/media/admin/Media has the right permissions set.

With no mention as to what the right permissions are.

Ensure that the necessary ports for Samba (typically 137-139 and 445) are open on the Raspberry Pi. You can check and adjust this with ufw or iptables depending on what you're using.

With no mention as to how to use these tools or what parameters to give them.

NetBIOS Name: In the [global] section of your smb.conf, set the NetBIOS name to be sure it's recognized: netbios name = raspberrypi.

Not mentioned in any of the tutorials although Windows seemed to have no problem finding \raspberrypi.

I am reminded of the many c/c++ or python code samples that omit what header files or imports re required for the code to compile/parse.

Let us keep in mind that tutorials are for those of us who do not know what they are doing.

I noticed you mentioned the old guest account which has been disabled for maybe a decade because, many reasons.

So for my Pi NAS I went right to "create an account" that matches what I use on the Windows PC. This has to match exactly since we are not using a domain server which would be a whole discussion on its own. By exact I lost time talking about this because folk didn't always understand that the username "Jimmy" on the PC would fail to validate on the NAS with the account name "jimmy".

So again I've brought up the account name issue. The next thing to note is Name Resolution. See if you can ping the Pi to see if basic IP name resolution is working. If it doesn't ping by name, ping by IP. If ping by IP works then check if NETBIOS over TCP/IP is disabled and turn that on (enabled). In some cases I'll just add the Pi to the Windows hosts file. Then reboot and test.

I can ping it both by IP and name.

commented: That means IP name resolution is good. NetBIOS over TCP/IP needs to be checked (that setting) +17

NetBIOS over TCP/IP needs to be checked (that setting)

I have no idea what you mean by that. It was also not mentioned in any of the tutorials I have gone through. Although one helpful comment was that I really have no business even attempting this without first becoming a linux guru.

commented: NetBIOS over TCP/IP is buried somewhere in a Windows setting. Also, all this helps you build guru points. +0

It turns out the problem was something that was not mentioned in any of the tutorials. The way the external drive is auto-mounted is incorrect. The account I set up when I installed the OS was named admin and the default mount point was

/media/admin/Media

I unmounted the drive (identified as sda1) and remounted it as

/srv/media

adjusted the path line in /etc/samba/smb.conf, then restarted samba and everything started working. As seems to be typical of linux, the one thing I needed to do was something that is likely obvious to linux gurus. So obvious that nobody mentioned it.

Update. NAS is still running fine and I was able to add a media server that (wonder of wonders) is usable by Bigscreen Beta on my Oculus.

Had a couple of gotchas. I use TightVNC to remote into my various computers within my home network. I installed TightVNC on the pi and when I first ran it I was asked to provide two passwords, one for full access, and one for view only. After I did this I could no longer log in to the pi, even from a local interface. I had to rebuild it from scratch. This time, instead of using TightVNC I just enabled the native VNC interface. However, now I have to use RealVNC Viewer to connect. Not a big deal.

The second gotcha is that any time I reboot I have to remount my external drive, and restart samba and minidlna. I'd do this automatically but I can't seem to get rc.local to work. Again, not a big deal to do it manually since reboots are infrequent.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.