Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I followed the steps for sharing folders between windows 7 and Ubuntu in virtual box. but the folder appear with X sign and give me the following message when open it "the folder conent could not be displayed"

and when choose "shared folder" from "Device" menu the following is written below "on the system page , you have asigned more than 50% of your computer's memory (2.93) to the virtual machine ...

share|improve this question

4 Answers 4

Access to shared folders in Virtual Box

Command line

By default Virtual Box shared folders are created with read/write permission for the guest. This can be done from the command line with:

VBoxManage sharedfolder add "VM name" --name "sharename" --hostpath "C:\test"

By adding the option --readonly we can restrict these for read only access. Use the --transient option if you only want the shares to appear in the present session but not persistent for follwing sessions. There are some limitations for shared folders (see this question for details). If prerequisites are met we may mount these shared folders manually by running the following commands in the guest:

mkdir /home/<user>/vboxshare
sudo mount -t vboxsf -o uid=1000,gid=1000 share /home/<user>/vboxshare

Of course we can also use different mount options to mount as read/only or mount with read access only to root.

Auto-Mount through Virtual Box Manager

In case we enabled auto-mounting on creating a shared folder from the Virtual Box Manager those shared folders will automatically be mounted in the guest with mount point /media/sf_<name_of_folder>. To have access to these folders users in the guest need to be a member of the group vboxsf.

Source and further reading: Virtual Box User Manual

share|improve this answer
1  
i set a shared folder in the GUI and also set the Auto-Mount. restarted the VM, went to /media but still nothing there –  amphibient Aug 19 '13 at 20:11

Actually there is an easy way to do that. First you have to install the extension pack for VirtualBox. After that and restart your virtual machine, install in your guest Ubuntu GuestAdditions (you can do it mounting the iso which is on /media or LeftControl+D).

After that, reboot and try to access to /media/sf_your_shared_folder_name. If you still don't have access, that's mean you don't belong to the vboxsf group, as Nilo points earlier.

That command will solve your problem:

sudo adduser your_username vboxsf

share|improve this answer
    
THIS. I wasn't in the user group. Seems like that should have been automated by the gest additions or at least stated clearly. –  AwokeKnowing Jun 17 at 0:39
    
seems the problem for me is that my username is not root. That should have been mentioned somewhere –  AwokeKnowing Jun 17 at 0:47

Add the shared folder to the virtual machine using vBox graphical interface Make sure to select automount and make permanent

Login to the virtual machine using a root account

Check vboxsf group exists

~$ grep vboxsf /etc/group
vboxsf:x:125:

Check user is not already in vboxsf group

~$ id nilo
uid=1000(nilo) gid=1000(nilo) groups=1000(nilo),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare)

Add user nilo to vboxsf group

~$ sudo usermod -a -G vboxsf nilo

Check again user groups

~$ id nilo
uid=1000(nilo) gid=1000(nilo) groups=1000(nilo),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare),125(vboxsf)

Reboot and login as nilo

Shared folder is now accesible in /media/sf_dropbox (dropbox is the name I gave to the share)

share|improve this answer
  1. Install the program called 'Programs and Group' from the Software Center
  2. Choose the current user and click on Manage Groups
  3. Choose vboxsf and click 'Add'
  4. Reboot
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.