Page 1 of 1

Create shared folder?

Posted: 22. Jan 2012, 00:22
by RFrenette
Hi,

I looked for the directions on how to create a shared folder on an OS X (Lion) and Ubuntu (11.13) Guest, but was unable to find them.

I have done this in the past with an older version of VirtBox, but I'm having trouble with 4.1.8.

I created osx_share on the Host and ubuntu_share on the Guest. However, I'm unable to "connect" them using the following in /etc/rc/local on the Guest:

mount -t vboxsf osx_share /home/me/ubuntu_share

The following doesn't even work:

sudo mount -t vboxsf -o uid=1000 osx_share ubuntu_share

Thanks for any advice!

Rob

Re: Create shared folder?

Posted: 22. Jan 2012, 01:33
by stefan.becker
Guest Additions are installed?

Read the manual how to set up automount of shared folders. Is much easier.

Re: Create shared folder?

Posted: 22. Jan 2012, 21:00
by whisperycat
The advice to "Read the manual" is good... up to a point.

On my host (Mac, OS X Snow Leopard) I created a directory to be the share.
In the VM (Linux, Ubuntu) I configured a connection to this folder (as per the manual) and set it to automount.

Then I logged in to Ubuntu as the only user existing on that system, i.e. the one which installed it. The shared folder is where I expected to find it - in the media directoy on Ubuntu - but the system tells me I have no permissions to access it since I aren't the owner. So, who *IS* the owner? 'root', apparently. So next I enabled root login and logged in as root, thinking I could modify the permissions on the shared folder.

As root I am able to access the shared folder and its contents with no problems, but any attempt to modify the sharing permissions are refused by the system. By this I mean, if I navigate to the shared folder in Ubuntu, as root, and right-click on the shared folder icon, I am presented with a tabbed window. The tabs are labelled 'Basic', 'Permissions' and 'Share'.

In the Permissions tab I *should* be able to set permissions for access by other users - I cannot do this.
I look at the section of Permissions entitled "Others -> Folder Access" and it is set to 'None'.
I select "Access Files" as the desired permissions, but this selection has no effect. "Access Files" is displayed for a split second and then it reverts to 'None'. NOTHING in these permissions can be changed by root!? How bizarre.

Next I think, hmmm, maybe I will check if my user is in the right group 'vboxsf'.

This is where I find there are no tools which will even list what groups a user does belong to - and this is as root user!

So in summary, I can create and access a shared folder only if I log in to the GUI as 'root', but not if I log in as the administrator who installed the OS.

One word - useless!!

One question - am I missing something here?

Re: Create shared folder?

Posted: 22. Jan 2012, 21:37
by Sasquatch
Don't blame VB, get mad at Ubuntu for ditching that part. Open /etc/groups as root and add your username to the vboxsf group, or run the following command in a terminal, ran as root (or with sudo):

Code: Select all

usermod -aG vboxsf <your username>

Re: Create shared folder?

Posted: 22. Jan 2012, 22:11
by whisperycat
Thanks Sasquatch.
Sasquatch wrote:Don't blame VB, get mad at Ubuntu for ditching that part. Open /etc/groups as root and add your username to the vboxsf group, or run the following command in a terminal, ran as root (or with sudo):

Code: Select all

usermod -aG vboxsf <your username>