User avatar
sapnho
Posts: 157
Joined: Sun Sep 14, 2014 3:49 pm
Location: Frankfurt am Main
Contact: Website

RPi File Sharing for both Windows and macOS

Mon Feb 04, 2019 6:38 pm

I have worked with TightVNC and Netatalk for file sharing with a Mac. Now I am looking to set up a fresh RPi with file sharing working for both Windows and Mac. I believe Windows requires SMB and Mac AFP? Is there a way to install a straightforward solution that works for both operating systems? I don't need screen sharing but the basic file sharing setup. I am a bit confused by various posts because they address sharing with either Mac or PC, but I need both. Any guidance on this subject? Thanks!
www.thedigitalpictureframe.com
Build a really great digital picture frame with the Raspberry Pi.
With lots of great tips from this forum.

Andyroo
Posts: 1479
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: RPi File Sharing for both Windows and macOS

Mon Feb 04, 2019 6:52 pm

Use SAMBA for folder sharing and create SMB shares.

You may want to issue the following on the MAC

Code: Select all

defaults write com.apple.desktopservices DSDontWriteNetworkStores true
This will stop Windows users complaining about the .DS_Store files all over the place.

To access from the MAC use Finder with smb://<Pi IP address>/share-name

Depending on the version of Windows you may need to enable the older version of SMB
Need Pi spray - these things are breeding in my house...

User avatar
sapnho
Posts: 157
Joined: Sun Sep 14, 2014 3:49 pm
Location: Frankfurt am Main
Contact: Website

Re: RPi File Sharing for both Windows and macOS

Mon Feb 04, 2019 8:31 pm

Thanks, Andy, can you point me to a tutorial for SAMBA installation? There are so many out there, but they all seem to be slightly different.. :?
www.thedigitalpictureframe.com
Build a really great digital picture frame with the Raspberry Pi.
With lots of great tips from this forum.

gkaiseril
Posts: 521
Joined: Mon Aug 08, 2016 9:27 pm
Location: Chicago, IL

Re: RPi File Sharing for both Windows and macOS

Mon Feb 04, 2019 8:55 pm

SAMBA: SET UP A RASPBERRY PI AS A FILE SERVER FOR YOUR LOCAL NETWORK

You do not need to install NOOBS, Raspbien should be enough.

See also SAMBA/CIFS for making a shared folder for Windows.

hortimech
Posts: 223
Joined: Wed Apr 08, 2015 5:52 pm

Re: RPi File Sharing for both Windows and macOS

Mon Feb 04, 2019 9:17 pm

Try reading Samba's documents:
https://wiki.samba.org/index.php/Main_Page

Specifically:
https://wiki.samba.org/index.php/Settin ... one_Server

You should also investigate the various vfs modules written specifically for MAC & SMB interoperability:

vfs_Catia vfs_fruit vfs_streams_xattr

User avatar
sapnho
Posts: 157
Joined: Sun Sep 14, 2014 3:49 pm
Location: Frankfurt am Main
Contact: Website

Re: RPi File Sharing for both Windows and macOS

Mon Feb 04, 2019 9:42 pm

Thanks. Yes, I had stumbled across the same documents earlier but found them rather complex for my level.

I had set up the sharing with a Mac so simply with this guide: https://github.com/HackerShackOfficial/ ... Pi-VNC-Mac. It says screen sharing but it does the filesharing as well.

So, I guess SAMBA is a bit more complex..
www.thedigitalpictureframe.com
Build a really great digital picture frame with the Raspberry Pi.
With lots of great tips from this forum.

LTolledo
Posts: 1000
Joined: Sat Mar 17, 2018 7:29 am

Re: RPi File Sharing for both Windows and macOS

Mon Feb 04, 2019 10:00 pm

At first it may look complex....
I too was a beginner at that time and was overwhelmed by the set of steps needed to do in order to complete the setup.

My first setup took about a bit over an hour, reading each step twice before actually doing it.
then testing the connections between RPi to RPi, RPi to winpc, winpc to RPi, RPi to Mac.
until the sharing works.

Now all my RPis (and other SBCs) have samba sharing, setup usually takes less than 5 minutes.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
sapnho
Posts: 157
Joined: Sun Sep 14, 2014 3:49 pm
Location: Frankfurt am Main
Contact: Website

Re: RPi File Sharing for both Windows and macOS

Mon Feb 04, 2019 10:04 pm

LTolledo wrote:
Mon Feb 04, 2019 10:00 pm
At first it may look complex....
I too was a beginner at that time and was overwhelmed by the set of steps needed to do in order to complete the setup.
Are your steps to success summarized somewhere by any chance? ;)
www.thedigitalpictureframe.com
Build a really great digital picture frame with the Raspberry Pi.
With lots of great tips from this forum.

LTolledo
Posts: 1000
Joined: Sat Mar 17, 2018 7:29 am

Re: RPi File Sharing for both Windows and macOS

Tue Feb 05, 2019 12:41 pm

sapnho wrote:
Mon Feb 04, 2019 10:04 pm
LTolledo wrote:
Mon Feb 04, 2019 10:00 pm
At first it may look complex....
I too was a beginner at that time and was overwhelmed by the set of steps needed to do in order to complete the setup.
Are your steps to success summarized somewhere by any chance? ;)
Well pretty much the same as what was linked by gkaiseril

except for the smb.conf file, I've enabled some of ones with the commented out by ";"
and the folder (or drive) I want to share is already defined.

most of the time I forget setting the smb password, wondering why I cant connect only to realize later. So dont skip on this one.
also make sure you setup a samba user that corresponds to the same user at your Mac and/or winpc.

Do try it. If you stumble into some roadblock(s), we'll try to assist you in any which way we can.

Oh before trying out "new things" on your RPi, I do suggest you back up your microSD first to your winPC's HDD (using Win32DiskImager) or Mac's HDD (using tool similar to Win32DiskImager [ApplePiBaker?]).
if something goes wrong, you can just restore from the backed up image to the microSD card using Etcher, and not go thru the time consuming zero-start setup again.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
DarkPlatinum
Posts: 702
Joined: Thu Nov 02, 2017 2:30 pm
Contact: Website

Re: RPi File Sharing for both Windows and macOS

Tue Feb 05, 2019 1:10 pm

If you want to setup a NAS, you should get OMV (OpenMediaVault).

https://www.openmediavault.org/
1 * Raspberry Pi Zero W, 1 * Raspberry Pi 2, 1 * Raspberry Pi 3 1 * Raspberry Pi 3B + :mrgreen:

Check Out My Raspberry Site (Run on a Raspberry Pi 3B :) ): Https://Html.dynu.net

LTolledo
Posts: 1000
Joined: Sat Mar 17, 2018 7:29 am

Re: RPi File Sharing for both Windows and macOS

Tue Feb 05, 2019 1:25 pm

DarkPlatinum wrote:
Tue Feb 05, 2019 1:10 pm
If you want to setup a NAS, you should get OMV (OpenMediaVault).

https://www.openmediavault.org/
I've used OMV before on other SBCs as OMV is not very fond of the RPi family...
to me OMV is much more cumbersome to setup than "plain SAMBA"

anyway, to each his/her/its own....
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

User avatar
sapnho
Posts: 157
Joined: Sun Sep 14, 2014 3:49 pm
Location: Frankfurt am Main
Contact: Website

Re: RPi File Sharing for both Windows and macOS

Tue Feb 05, 2019 2:55 pm

Thanks for the feedback, guys.
Is it actually possible to only install Samba and have both PCs and Macs access it? I suppose Macs can work with SMB as well, can they?

EDIT: It actually works fine on a Mac so one thing less to worry about!
www.thedigitalpictureframe.com
Build a really great digital picture frame with the Raspberry Pi.
With lots of great tips from this forum.

Andyroo
Posts: 1479
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: RPi File Sharing for both Windows and macOS

Tue Feb 05, 2019 4:16 pm

sapnho wrote:
Tue Feb 05, 2019 2:55 pm
Thanks for the feedback, guys.
Is it actually possible to only install Samba and have both PCs and Macs access it? I suppose Macs can work with SMB as well, can they?

EDIT: It actually works fine on a Mac so one thing less to worry about!
Glad you got sorted - apologies for not giving samples - got distracted with an upgrade mess that turned into a re-install :oops: :lol:

If anything its better to use SMB rather than AFP - Apple have not removed it but support is dwindling as the High Sierra / Mojave APFS drives (default for clean installs) does not support being shared over AFP and I'm not sure it ever will https://support.apple.com/en-gb/HT207828 and https://support.apple.com/en-gb/HT208018

Given how much is being removed out of the server version of macOS https://support.apple.com/en-gb/HT208312 I honestly do not see AFP being around in new sites and it dropping to legacy package status very quickly.
Need Pi spray - these things are breeding in my house...

Andyroo
Posts: 1479
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: RPi File Sharing for both Windows and macOS

Tue Feb 05, 2019 8:48 pm

The simplest set up (smb.conf) I have on one Pi for dropping bits from my Mac to the home folder is:

Code: Select all

[global]
   workgroup = WORKGROUP
   dns proxy = no
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d
   server role = standalone server
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   usershare allow guests = yes
[homes]
   comment = Home Directories
   browseable = yes
   read only = no
   create mask = 0644
   directory mask = 0755
   valid users = %S
It relies on only the password as security but thats fine for this box at the mo - ufw next :lol:

:oops: Need to have a look at usershare vs valid users now I read it :oops:
Need Pi spray - these things are breeding in my house...

LTolledo
Posts: 1000
Joined: Sat Mar 17, 2018 7:29 am

Re: RPi File Sharing for both Windows and macOS

Wed Feb 06, 2019 9:54 am

Here's the contents of my smb.conf that I have on a just completed setup of another SBC running Stretch

Code: Select all

[global]
	workgroup = MYWORKGROUP
	log file = /var/log/samba/log.%m
	max log size = 1000
	syslog = 0
	panic action = /usr/share/samba/panic-action %d
	usershare allow guests = Yes
	map to guest = Bad User
	obey pam restrictions = Yes
	pam password change = Yes
	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
	passwd program = /usr/bin/passwd %u
	server role = standalone server
	unix password sync = Yes
	dns proxy = No
	wins support = Yes
	idmap config * : backend = tdb

[home]
	comment = Home Directories
	path = /home/pi
	create mask = 0775
	directory mask = 0775
	read only = No

[printers]
	comment = All Printers
	path = /var/spool/samba
	browseable = No
	printable = Yes
	create mask = 0700

[print$]
	comment = Printer Drivers
	path = /var/lib/samba/printers

[hddshare]
	comment = hddshare
	path = /media/pi/M2tb
	create mask = 0775
	directory mask = 0775
	read only = no
	browsable = yes
	only guest = no

this is basically the same smb.conf that I used in all my linux installations (Raspbian, Armbian, Linux Mint, Ubuntu, etc)
do note that I have deleted the "s" in [homes] (the original written in the smb.conf).
If I don't delete that, my home directory does not show up in the share list.

the last group [hddshare] (shown here as an example) is the share setting for the attached hard disk (spinning rust, as somebody else calls it)
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Return to “Troubleshooting”