Windows – Ubuntu on Oracle VirtualBox: Shared folders

Ubuntuvirtualboxvirtualizationwindows 7

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.

Best Answer

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.

Related Question