92

I'm running Ubuntu 11.04 (guest) on Windows 7 (host) with the guest additions installed. I have an auto-mount folder that maps to my D: drive on the host which I can access using sudo ls /media/sf_D_DRIVE - however, even when my user (ross) is a member of the vboxsf group I get a permission denied error when attempting to explore it. I have restarted since adding my user to the vboxsf group.

This should work because I am a member of the group (which has rwx rights), so why doesn't it?

ross@panther:~$ ls -l /media
total 8
drwxrwx--- 1 root vboxsf 8192 2011-07-03 22:24 sf_D_DRIVE

ross@panther:~$ ls -l /media/sf_D_DRIVE/
ls: cannot open directory /media/sf_D_DRIVE/: Permission denied

ross@panther:~$ id ross
uid=1000(ross) gid=1000(ross) groups=1000(ross),4(adm),20(dialout),24(cdrom),46(plugdev),112(lpadmin),120(admin),122(sambashare),1001(vboxsf)

ross@panther:~$ sudo ls -l /media/sf_D_DRIVE/
total 84
drwxrwx--- 1 root vboxsf  4096 2011-07-06 14:46 Development
# ...snip...
drwxrwx--- 1 root vboxsf     0 2011-05-25 19:13 Videos

5 Answers 5

140

I had added my user to the vboxsf group:

sudo usermod -aG vboxsf $(whoami)

I did do a restart, but after logging out and in again, I got access! Restarting after this and it still works. Go figure.

7
  • 1
    why is the need for a restart? Oct 19, 2011 at 2:15
  • 1
    Not sure, it just seemed to correct itself.
    – Ross
    Oct 19, 2011 at 7:50
  • 16
    See here why a restart is required. A logout/login would do. Oct 19, 2011 at 14:01
  • 4
    This answer command has to be run on the GUEST machine!
    – KrisWebDev
    Apr 2, 2016 at 22:08
  • 6
    I tried a simple logout login but it didn't work. I had to restart.
    – Waqleh
    Apr 21, 2017 at 15:40
2

Apparently logging out is insufficient, which seems strange if it was just a matter of being a member of a group. However, this seems to do the trick, without a system reboot:

sudo usermod -aG vboxsf $(whoami)
sudo systemctl restart vboxadd-service.service

which suggests that it is not simply a matter of being a member of the appropriate group.

1

I followed this procedure: Check that your user account is in the vboxsf group. Click on the bird icon, select Users and Groups → Manage Groups → vboxsf → Properties. Your user account should have a checkmark next to it. Check it if it is unchecked. When prompted for a password, enter secret.

Then a restart on the virtual machine (Power of the Machine) and this allowed for the shared folder to work.

1
1

Go to your kali linux terminal then run the command below:

sudo usermod -a -G vboxsf (your-kali-username)

sudo chown -R (your-kali-username):users /media/(your-share-folder-name)

Below is a sample use:

sudo usermod -a -G vboxsf tahmid

sudo chown -R tahmid:users /media/sf_pen_drive
1
  • The sudo chown -R was necessary for me too.
    – icecream
    Feb 8, 2023 at 7:32
0
$ sudo apt-get install virtualbox-guest-dkms
2
  • 1
    The OP has already said they have guest additions installed.
    – user118967
    Jun 5, 2020 at 22:07
  • I hadn't and this made it work
    – citynorman
    Mar 15, 2022 at 1:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .