Mac shared folder with linux

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.

Источник

Permanently share a folder between host (Mac) and guest (Linux) OS using VirtualBox

Sparkly lights silhouette of a person.

Ryan Sechrest

This is mainly for my own reference, but here it goes.

Share a folder on the host OS

  • In VirtualBox, click your OS on the left and click on Settings.
  • Click on the Shared Folders tab.
  • Click on the folder with the plus on the right.
  • Browse to a folder of your choice in the folder path.
  • Enter a folder name with no spaces e.g. “Share”.
  • Check Auto-mount and Make Permanent, if available.
  • Click on OK.

Mount the folder in the guest OS

  • Create a folder in your guest OS that you want to share.
  • Open up Terminal.
  • Type in id and press ENTER— remember that ID.
  • Switch to the root user using sudo su and enter your password.
  • Browse to the etc folder using cd /etc .
  • Edit the rc.local file using vi rc.local .
  • Move your cursor right above exit 0 and press the letter “i” on your keyboard to insert text.
  • Type in the following: sudo mount -t vboxsf -o uid=1000,gid=1000 Share /home/username/Documents/Share
  • 1000 should match the ID you noted down earlier.
  • Share should match the folder name from step 1.
  • username should match your Linux username.
  • /Documents/Share should be the absolute path of the new folder you created.
  • Now hit “ESC”, type :wq and hit ENTER to save and quit the file editing.
Читайте также:  Php создать папку linux

After you restart the guest OS, your shared folder will be automatically mounted.

Comments (31)

Previously posted in WordPress and transferred to Ghost.

Dave
July 10, 2015 at 2:00 pm

suri
December 10, 2015 at 1:28 pm

Siti
August 21, 2017 at 4:57 am

I’m totally lost when it comes to “2. Mount the folder in the guest OS”. I’m using mac – sierra as a host and windows 10 in Virtual box. I’m stuck from point 2.2 “open up Terminal” onwards. What is Terminal? How do I move on to the rest. DO you by any chance has a picture as an example to summarise these steps? Many thanks in advance for your help.

Chris
February 3, 2017 at 10:27 am

I needed to make 2 small changes in order to get shared folders to work with my Linux guest:

1. In VirtualBox VM shared folder settings, do not enable Automount.

2. As root on Linux guest, do chmod +x /etc/rc.d/rc.local without which the rc.local commands will not be executed.

Ryan Sechrest
February 3, 2017 at 12:53 pm

Jun
February 10, 2017 at 11:37 am

I followed every step correctly.

Where do i check if it shared in guest OS?

Ryan Sechrest
February 10, 2017 at 1:32 pm

I believe it’s mounted as a disk, so you can use the file explorer that came installed with the guest OS.

Paul
March 14, 2017 at 2:35 pm

hello, i followed all the steps correctly but i still cant see me “shared” folder mounted anywhere what should i do?

Sampath
March 21, 2017 at 11:43 pm

Ram
May 29, 2017 at 1:16 am

Very helpful. For those who might not see the files in the shared folder, try from terminal ls /home/username/Documents/Share and now if you see the data but not in the file viewer, then go to /home/username/Documents/Share in the file viewer and on the top menu go to view tab and select reload folder or F5.

Mikel
June 9, 2017 at 1:38 am

If you want to add a user to a group in Fedora, do the following:

Open a terminal.
Enter su — , hit Enter.
Enter the root password, hit Enter.
Type in usermod -a -G vboxsf username , replacing username with the user you want to add to the group, hit Enter.
You may have to reboot to remount the share, the easiest way to do this is probably to reboot the VM.

Farah
June 23, 2017 at 10:06 am

Tamari
July 18, 2017 at 4:54 am

thanks – works great.
addition:
to find your shared folder run df -H
in my case it’s mounted on /media/sf_NAME

Patricia Grubel
December 11, 2017 at 4:40 pm

Works great. Just one note, look for links to rc.local and make sure the file has the execute permission.
In my case: sudo chmod +x rc.d/rc.local

Anish
December 17, 2017 at 6:25 am

Fabregas
January 3, 2018 at 6:00 am

In addition to the above steps I had to install GuestAdditions using sudo apt-get install virtualbox-guest-utils

Abhishek Roy
August 15, 2018 at 11:19 am

Ajay Gopi
January 18, 2018 at 2:19 pm

Hi I tried to mount the file to my guest OS (Mac OS Sierra) but I got a blue screen when I tried to restart the Ubuntu OS (it is Ubuntu 16.04). Do you know why this might be happening?

harneet
July 15, 2018 at 8:53 am

Читайте также:  Linux copy folders to another folder

Santosh
September 28, 2018 at 4:21 am

Thanks a lot, Tried hard to share and found this, both Bidirectional Drag & Drop and Clip board sharing were not working. This really helped a lot.

Sankar
November 24, 2018 at 9:49 pm

pankaj
February 15, 2019 at 1:45 am

Amy
March 31, 2019 at 10:56 pm

Gabriela
September 9, 2019 at 8:10 am

Kimseng
October 7, 2019 at 5:30 pm

I am not sure I could follow your instruction well.
How can I verify that rc.local running without any error?
Could you help print screen rc.local as reference? since your topic match to my condition.
I use Oracle Linux 6 (Guest) with Mac OS (Host)

Kimseng
October 7, 2019 at 6:30 pm

Dear Friend, it is working for me after I fixed by install Guest Additional CD successfully.
If anyone who did has problem with Guest Addition CD like virtualbox additions module not loaded
For my case I run this command:
# yum install kernel-uek-devel.x86_64
# /sbin/rcvboxadd quicksetup all
and Then restart your guest os.
after login with user that map in rc.local, share folder will appear on user desktop.

Ryan Sechrest
October 9, 2019 at 10:25 am

Dev
February 6, 2020 at 10:12 pm

Totally late for this post, but glad I found it!

Using Catalina (Host) to Mojave(Guest). After some testing, I realized that I didn’t have to change the rc.local file at all.

– I got this to work by changing Network Adapter (specifically, adapter 1) settings related to VB specific, Mojave (Guest) preferences in VirtualBox Manager area.

– Under “attached to” change from Default NAT to Bridged Adapter & for “name” dropdown, used the very first: en0: Wifi (Airport) which produced an 192 .etc.etc.etc (IP) in place of the 10.etc.etc.etc for the default connection in the Guest , re: Ethernet. Makes sense.

– SMBed to Mojave(Guest) VB env via Catalina (Host, my non-virtual environment) using the Finder->Go->Connect to Server

Ryan Sechrest
February 7, 2020 at 11:43 am

Jayashree
September 25, 2020 at 6:20 am

Four different styles of blank gift tags.

Hide specific posts from homepage in Ghost

I recently became a dad and plan to occasionally write about my experience. That said, since my blog is primarily about technology, I don’t want those posts surfacing on the homepage, because they’re not written for my target audience. The first step is to group all of the Parenting posts

Woman holding baby in her arm while bottle feeding.

Breastfeeding, bottle feeding, pumping, and diaper log

My wife and I started keeping a log since day 1, because the hospital told us that within a 24 hour period, the number of wet and dirty diapers, plus the number of times our baby eats, is a good indication on whether she’s getting enough to eat. Here’s what

Woman, with her back to a river, studying a paper map.

Include year and month in Ghost blog post permalinks

This is especially useful if you migrated your posts from WordPress to Ghost and want to keep most of your blog post URLs the same. If you go to Settings > Labs, click on Download current routes.yaml within the Beta Features > Routes section at the very bottom. Open that file

Источник

Share folders from the host Mac OS to a guest Linux system in VirtualBox [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.

Читайте также:  Ssh with proxy linux

1 Answer 1

You’ll need the latest version of VirtualBox (4.3.10) with Guest Additions installed in Ubuntu.

  • With the Virtual Machine powered off and selected in VirtualBox, go to: Machine > Settings . > Shared Folders
  • For “Folder Path”, click the icon to browse for the folder you want to share.
  • For “Folder Name”, enter a name to describe the share.
  • Click “OK” and start the virtual machine again.
  • Create a mount point which is basically an empty folder.
  • Fire up the terminal and type: sudo mount -t vboxsf folder_name path_to_mount_point folder_name is the name you typed in earlier to describe the share
  • You should be able to browse the shared folder now.

In case of difficulties mounting the same, such as the following error:

mount: wrong fs type, bad option, bad superblock on mydata, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount. helper program) In some cases useful info is found in syslog - try dmesg | tail or so 

perform the following steps:

sudo rm /sbin/mount.vboxsf sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf 

Источник

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!

enter image description here

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:

Источник

Оцените статью
Adblock
detector