Ubuntu on Oracle VirtualBox: Shared folders

6

2

I looked at this question, but it didn't help.

I'm running Windows 7 as a host with Ubuntu 10.10 as a guest with VBox 4.0. I want to have a shared directory between the two. I have installed Guest Additions.

I went to the VBox control panel in Windows, added a Shared Folder (sharename Shared_Folder), and chose "Auto Mount". A directory named "sf_Shared_Folder" appeared in /media on Ubuntu, but when I put files in that directory from an OS, I can't see them on the other one.

I then tried to create a directory without automounting (sharename collectivefiles), and to run the following command:

foo@foo-VirtualBox:~$ sudo mount -t vboxsf collectivefiles FileShare
/sbin/mount.vboxsf: mounting failed with the error: No such device

What is causing this error? I rebooted both the VM and VBox itself, but I'm still observing this.

Nick Heiner

Posted 2011-01-09T19:30:40.413

Reputation: 1 382

Do you have samba installed? – Benny – 2011-01-10T06:46:58.973

Answers

4

At least on my Win7 host with Ubuntu 10.10 guest running under VirtualBox 4.0.2, I didn't have the problems you mention. Something to be aware of though is that the shared folder is mounted with permissions set with the root account user and vboxsf group as owners.

The best thing to do is to add your normal user account to the vboxsf group. You can do that by either directly editing the /etc/group file and adding your account at the end of the group definition like so (replacing goyuix with your user account):

vboxsf:x:1001:goyuix

Or you can use the GUI: System -> Administration -> Users and Groups. Click the manage groups button, scroll pretty much to the bottom of the list and find the vboxsf group, select it and click the Properties button. You can then tick the check box for each user account you want to be part of the group.

Goyuix

Posted 2011-01-09T19:30:40.413

Reputation: 6 021

+1 Do you know how to add the user to vboxsf from the command line? – Amelio Vazquez-Reina – 2011-08-06T19:01:02.737

1@AmV vboxsf is a group, not a user. You can use the groupadd and useradd commands from the command line. – Goyuix – 2011-08-07T15:50:23.427

1

I had exactly the same problem and came to the conclusion it was kernel-related. If I would start my guest OS with an older kernel, it was no problem. The solution for me was in the re-installation of the guest additions. Apparently, VirtualBox runs different guest additions for different kernels; so a re-installation forces the guest addtitions to take another look at the kernel.

GJ Bogaerts

Posted 2011-01-09T19:30:40.413

Reputation: 11