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

Abhishek Jain picture Abhishek Jain · May 7, 2014 · Viewed 93k times · Source

How do I go about sharing a folder between the host (Mac) and the guest OS (Ubuntu) in Virtual Box?

Answer

Abhishek Jain picture Abhishek Jain · May 7, 2014

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.<type> 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