4
votes

I have problem with accessing the shared folder.

My host OS is Windows 7 Enterprise Edition SP1, and the guest OS is Ubuntu Linux 10.04 Desktop Version. I'm using Virtual Box 4.2.10, and I have installed VBox guest add-on and Oracle VM VirtualBox Extension Pack.

When I put commend: mat@mat-desktop:~$ cd /media/sf_MAT/ bash: cd: /media/sf_MAT/: Permission denied

again with sudo: sudo cd /media/sf_MAT/ sudo: cd: command not found

What could be the solution?

6

6 Answers

20
votes

The issue is that your user "mat" is not in the same group as "vboxsf". This group "vboxsf" is the group which has read/write permissions to that folder. Also the root has permission to that folder because its in the group "vboxsf".

What you need is to add your user "mat" to the same group. Start your terminal and write the following line:

sudo usermod -aG vboxsf mat
  • sudo - because you need root permission
  • usermod - the command to change the user properties
  • -a means append to the group
  • -G means you will supply the group name now
  • vboxsf is the group name that you want your user to be in
  • mat is your username

A reboot, or a logout, may be required for changes to take affect.

After this operation you can verify that your user is indeed in the vboxsf group by doing this:

cat /etc/group | grep "vboxsf"

you will see your username there. Now you shall be able to access that folder. If any issue, just comment here and I will tell you alternative methods.

Also, if all of this sounds too geeky, you can do the same thing using the graphical tools. One guide is here http://www.howtogeek.com/75705/access-shared-folders-in-a-virtualbox-ubuntu-11.04-virtual-machine/

Also, in new virtual box - 4.3.20 I guess, they have this new feature of drag and drop where you can just drag files and folders to your virtual machine just by dragging. Isn't that nice. :)

1
votes

I have this problem to. The problem seems to be with your user account not having permission to use the folders. The only solution I have is to enter root using the su command. You can then read, write, and navigate freely. You might have to set a root password first using sudo passwd root.

1
votes

Open your Virtual Machine's Terminal. Type sudo su then enter your password.

Write the following commands

sudo usermod -a -G vboxsf your_account_name 

sudo chown -R your_account_name:users /media/your_share_folder_name/    

Example sudo usermod -a -G vboxsf mat

Example sudo chown -R mat:users /media/sf_MAT/

Now reboot your Virtual Machine and check the shared folder again

0
votes

You only need to follow these steps:

  1. in the terminal execute:

sudo adduser yourUserName vboxsf

  1. enter your root password, expect the following message:
Adding user `yourUserName' to group `vboxsf' ...
Adding user yourUserName group vboxsf
Done.
  1. Log out and back in.

You now can access your shared folders (with the limitations you set for them via VirtualBox)

0
votes

Reason : sudo cd will not work as sudo works on program and not command. cd is an inbuilt command.

Soluiton: try sudo -i ..this will elevate you to super user.

Now you will be logged in as root and use any command you wish

eg.

 sudo -i
 cd folder/path

use exit to return back to normal user.

0
votes

For all other just add new optical drive in storage(Via setting) and add ISO manually(It is inside installed directory) in Host OS. Now click on mounted drive and install in Guest OS.

Reboot enjoy