- How to share files between Ubuntu and Mac OS X [closed]
- 4 Answers 4
- Configure Samba to Work Better with Mac OS X
- Option details
- File Permission issues
- How to set up Samba in Ubuntu/Linux, and access it in Mac OS and Windows
- Now, your turn!
- Sharing ubuntu 16.04 vm folder with mac os (with samba)
- 1 Answer 1
- Stage 1: Install VirtualBox Guest Additions:
- Stage 2: Shared Folders Setup:
- Stage 3: Auto mounting host_folder into /opt/shared_folder_dir :
- Sharing folder from Linux to Mac, Samba or NFS? [closed]
- 5 Answers 5
- Linked
- Related
- Hot Network Questions
How to share files between Ubuntu and Mac OS X [closed]
Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you’re trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question.
4 Answers 4
Assuming you want to share on a local network
On OS X. Click on System Preferences —> Sharing. Make sure the Services tab is selected. Choose one of the sharing methods, either UNIX sharing or Windows sharing.
On your Ubuntu machine, go to Places —> Connect to server and enter the sharing details.
It’s not the smartest way to share files, but on Ubuntu you can simply use Share Folder option in the context menu, set settings as you wish and thats all. (Relogin may be required.) Then on MAC Ubuntu share should be discoverable.
I’m also using Ubuntu 10.04 and I can connect to my machines using their name. Say I have computers named ernie and bert that are on the same network:
ernie:~$ ping bert.local ernie:~$ echo hello > file.txt ernie:~$ scp file.txt bert.local:~/copied-from-ernie.txt
You can use this in nautilus too. Enter ssh://bert.local into the nautilus location bar in ubuntu (hit Ctrl-L to select the location bar) and hit enter. If you have different user names use ssh://username@bert.local
I think you can do something similar in the Finder location bar.
You have to install/enable sshd for this to work:
- Ubuntu: sudo apt-get install openssh-server (you may need to restart)
- Mac: System Preferences —> Sharing. Check the «Remote Login» box.
Configure Samba to Work Better with Mac OS X
Beware! This configures VFS objects in the global section, setting vfs objects in a share will *overwrite* the globally configured option, it will NOT supplement them.
Option details
Below are suggested parameters to use in smb.conf file of the Samba server to improve operability with Mac OS X clients. Note that some parameters may not work with your version of Samba — read the smb.conf and vfs_fruit man pages (on Linux) for your system. Other than those shown in the [TimeMachineBackup] share below, I recommend you include all parameters in the [Global] section of smb.conf. For ease of copy > paste, a clean smb.conf section is included at the bottom of this page.
Apple extensions («AAPL») run under SMB2/3 protocol, make that the minimum (probably shouldn’t be running SMB1 anyway. ) — defaults to SMB2_2 in Samba 4.11+:
Apple extensions require support for extended attributes(xattr) — defaults to yes in Samba 4.9+:
Load in modules (order is critical!) and enable AAPL extensions:
vfs objects = fruit streams_xattr
How to store OS X metadata:
For additional setting see the manpage vfs_fruit.
Server icon in Finder (added in Samba 4.5):
fruit:veto_appledouble = no . added in Samba 4.3 fruit:posix_rename = yes . added in Samba 4.5 fruit:zero_file_id = yes ..added in Samba 4.8 fruit:wipe_intentionally_left_blank_rfork = yes fruit:delete_empty_adfiles = yes
For Spotlight backend indexing using Elasticsearch (added in Samba 4.12):
[share] spotlight backend = elasticsearch
See smb.conf for 4.12 for other Elasticsearch parameters. Gnome tracker is still available (= tracker) or no indexing (= noindex), the default.
For Time Machine backup share (added in Samba 4.8):
[TimeMachineBackup] vfs objects = fruit streams_xattr fruit:time machine = yes
As far as I know, testparm will not validate vfs_fruit parameters. (my server runs an old version of Samba :-), but after you have built your smb.conf, you can check for errors anyway with #: testparm or #: testparm -v (which will give you the defaults as well.
From Finder, connect to your Samba server using «smb://User@Server» . Note that TM backups over smb may now be possible with your server. Other Mac models can be found in «/System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist». Use «Quick Look», Xcode or plutil to view or convert plist.
File Permission issues
Setting the global option fruit:nfs_aces = no will prevent macOS clients from modifying the UNIX mode of directories using NFS ACEs. An Access Control Entry (ACE) is part of the Access Control List (ACL).
How to set up Samba in Ubuntu/Linux, and access it in Mac OS and Windows
Samba allows to share files and printers with other computers remotely, regardless their operating system (linux, windows, Mac, . ). This guide show how to intall and configure the Samba service in a Ubuntu machine and access it through windows and mac.
Setting up the Samba File Server on Ubuntu/Linux:
- Open the terminal
- Install samba with the following command: sudo apt-get install samba smbfs
- Configure samba typing: vi /etc/samba/smb.conf
- Set your workgroup (if necesary). Go down in the file, until you see :
# Change this to the workgroup/NT-domain name your Samba server will part of workgroup = WORKGROUP
# Adrian's share [MyShare] comment = YOUR COMMENTS path = /your-share-folder read only = no guest ok = yes
- Open finder
- Menu Go -> Connect to server (command-k)
- In the «Server Address» textbox, type: smb://
- Connect
- Select guest and OK
- Your all set, you’ll be able to see / from here.
port type port no udp 137 udp 138 tcp 139 tcp 445
Now, your turn!
- Found a typo? Edit this post.
- Got questions? comment below.
- Was it useful? Show your support and share it.
About the author
Adrian Mejia is a Software Engineer located in Boston, MA. Currently working at Google. Adrian enjoys writing posts about Algorithms, programming, JavaScript, and Web Dev. Also, he likes to travel ✈️ and biking 🚴.
Sharing ubuntu 16.04 vm folder with mac os (with samba)
I tried smb://192.168.0.104/testshare , smb://192.168.0.104/media/testshare
I have no idea how to make it work. Help!
Might help, this is what I get when I run
$ sudo netstat -tulpn | egrep «samba|smbd|nmbd|winbind» : * I know that the ip is different now (192.168.0.104 => 192.168.0.109), its a new vm, don’t pay attention to that.
1 Answer 1
Host OS: macOS El Capitan
VM (guest) OS: Ubuntu Server 16.04.5 LTS
VirtualBox v5.2.18
Both host OS and guest OS must have same user (further in the text: username).
Stage 1: Install VirtualBox Guest Additions:
1.1. Locate the VirtualBox Guest Additions,
$ cd /Applications/VirtualBox.app/Contents/MacOS/ $ cp VBoxGuestAdditions.iso ~/Downloads/
1.3. Click the CD icon in the bottom right task bar
1.4. Select «Choose disk image. «» and search for the VBoxGuestAdditions.iso
1.5. In the guest terminal type (you can also do this from the host terminal if you SSH into it):
$ sudo su $ apt update $ apt upgrade $ apt-get install dkms build-essential linux-headers-generic gcc make $ mount /dev/cdrom /mnt $ cd /mnt $ sh ./VBoxLinuxAdditions.run $ reboot
Stage 2: Shared Folders Setup:
- Stop the VM
- Go to Settings > Shared Folders
- Click in the Add new port forwarding rule green button in the top right of the window.
- Search and select the folder you would like to share (e.g.: /path/to/shared/host_folder)
- Select the Auto-mount and Make Permanent options
- Start the VM
2.2. To mount shared folder on /opt you must create shared_folder_dir subfolder and set appropriate permissions to it:
$ sudo mkdir -p /opt/shared_folder_dir $ sudo chmod ug+w -Rv /opt/shared_folder_dir $ sudo chown username:username -Rv /opt/shared_folder_dir
2.3. Add username to the vboxsf group:
$ sudo adduser username vboxsf $ sudo usermod -a -G vboxsf username
2.4. Reboot VM to apply changes:
Stage 3: Auto mounting host_folder into /opt/shared_folder_dir :
and place following right above exit 0 :
# 'folder_name' = given in the shared folders configuration # 'path/to/shared/folders' = guest path to access the shared folders from # 'id' = prints uid/gid # sudo mount -t vboxsf -o uid=,gid= sleep 5 sudo mount -t vboxsf -o uid=1000,gid=1000 host_folder /opt/shared_folder_dir exit 0 >>
Note: I’ve added sleep 5 to execute mount operation after VirtualBox Guest Additions has started. You can check that by journalctl -b command.
3.2. Reboot VM to apply changes:
Sharing folder from Linux to Mac, Samba or NFS? [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Which one is the recommended one for performance and security point of view?
Have you read: [NFS, AFP, SMB… Advantages and drawbacks on a Mac OS system][1] ? [AFP, SMB, NFS which is the best data transfer protocol?][2] [1]: apple.stackexchange.com/questions/19470/… [2]: superuser.com/questions/106418/…
5 Answers 5
NFS is very performant in closed network and it’s simpler than SMB to setup, SMB share has more configuration about access and permissions and it can be accessed by windows OS.
If you need a simple share that can be accessed only by known machines, I’d recommend NFS especially in LAN network has very good performance. SMB is more secure but it need more configuration ( nothing impossible ) and it can be accessed by almost all operating systems, it’s a must if u need to access it via WAN network.
In your case I suggest NFS but if you have in mind to expand his functionality in the future then go SMB.
You can’t use soft links in Samba, you have a lot of broadcasts too. If you don’t have Windows systems, use NFS !
NFS is the recommended way to go. Five arguments, why NFS might be better in this situation:
- Fast installation and setup
- Simple/easy configuration of a «share»
- Simplet configuratio of security settings, e.g. host-based security
- Fast and reliable without the overhead of the SMB/CIFS protocol
- AFAIK, MAC OS supports NFS better than SMB/CIFS.
Only know that NFS can be confused when you are exporting a folder which is a bind mount. Youse fsid=xxx in /etc/exports then.
One argument against NFS is that clients (users) have more control over file permissions since they are accessing the file share directly as a user on the server system. Samba allows user mappings for clients and shares as well as the ability to force umasks for files.
So, if you care about having nice and neat permissions for shares accessed by multiple users, Samba may be a little easier to use, once it’s setup. If you are the only one sharing, use whichever you find easier to setup.
- easier to setup
- better performance
- security wise — it is better to be invisible for Windows machines. For example if you hook up an infected Windows machine to the network, if is Samba share, it will start infecting the share or in case of the latest middle east trojan- wiping out the shared drive
- NFS has more features- like sym links, handles better network issues (it is client-server)
Linked
Related
Hot Network Questions
Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.14.43533
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.