Page 1 of 1

Shared Folder - How to Mount

Posted: 11. Jan 2010, 06:10
by whtrabit
I am running Mac OS X 10.6.2 and VirtualBox 3.1.2 and Ubuntu 9.10. On the Mac side I am using my Public folder so the path would be /Users/<name>/Public. I have read the manual and a sticky on the Linux Guest page but I am still not understanding what I should be entering in the terminal to have the shared folder mount in Ubuntu. Please help. Thanks.

Re: Shared Folder - How to Mount

Posted: 11. Jan 2010, 16:42
by Perryg
Steps to create a share in Ubuntu and most Linux Debian Distros

First you must share the folder in the VBox GUI.
  • It makes not difference what it is call only what you give it for a name in VBox so lets name it shared.
    Now let's start the process in the guest. Open a terminal and type sudo -i and press enter type in your password and press enter again.
    Then type the following to setup the mount point.

    mkdir /home/<your login name>/shared - and press enter
    mount -t vboxsf shared /home/<your login name>/shared - and press enter
At this point you should be able to see the share and files that you have in it. But what do I do to make this permanent?
  • Well you would then need to edit your /etc/rc.local file and add the following:
    While in terminal and still in Sudo mode type gedit /etc/rc.local - press enter.

    Add this to the bottom of the rc.local file
    mount -t vboxsf -o rw,gid=1000,uid=1000 shared /home/<your login name>/shared
Notes:
  • The gid and uid must match you user id and group id. For most of us the 1000 is the right one.
    If you see this "/sbin/mount.vboxsf: mounting failed with the error: Protocol error" you typed the shared and or the shared path wrong. Also remember that it is case sensitive and you really should not use special characters or spaces.
    What if I want this on my desktop? Open the file browser and drag the folder to the desktop. This will create a copy for you there.

Re: Shared Folder - How to Mount

Posted: 13. Jan 2010, 06:51
by whtrabit
Thank you for all your help I do appreciate it but I still must be doing something wrong. I will post my results later after I try again.

Re: Shared Folder - How to Mount

Posted: 13. Jan 2010, 10:45
by flump
Also having issues with this. Mac 10.5.8 and Vbox 3.1.2 with XP

Installed the guest additions and the mouse is moving around nicely

However, whether I access shared folders from the menu bar bottom right, or go through settings before booting the VM, the window that opens permits me to choose the path to the sharing folder (created in home folder and designated a share folder) but will not let me OK the choice, only the Cancel button is active. So I am unable to even choose the folder to share let alone start mapping anything.

Other than this everything appears to be working fine, so if someone can help me sort this one out. I have searched all over, but there appears to be no solution yet that I can find.

Thanks

Re: Shared Folder - How to Mount

Posted: 13. Jan 2010, 13:10
by flump
OK, looks like I have it sorted, but it seems a bit daft!

The only folder that I am allowed to share is the machines folder - home/library/virtualbox/machines/shared which since it is in library is a pain.

So I have added it to the Mac sidebar and and short cuts in XP too.

Whatever, I can now share, shame I am unable to share whatever I want!

Re: Shared Folder - How to Mount

Posted: 13. Jan 2010, 17:12
by rpmurray
flump wrote: Whatever, I can now share, shame I am unable to share whatever I want!
Did the folders you were trying to share contain spaces in their names? VirtualBox seems to be particular about the naming of the shared folders. If you have anything other than letters or number in the name, try removing them and see if VirtualBox will let you OK the choice.