4

I'm using VirtualBox and I'm trying to run a program (that I wrote in C on my host machine) on a guest machine using Lubuntu 16.04 in CLI. In order to do so I need to share the project folder with the guest machine, but I'm having several problems to access it.

I created a shared folder with the given menu in VBox, with a correct path, naming it "MyProjectFolder". Moving with cd and ls inside the guest OS I managed to find /media/sf_MyProjectFolder but whenever I try to access it I get a permission denied error.

Running:

$ cd sf_MyProjectFolder`

I get:

-bash: cd: sf_MyProjectFolder/: Permission denied

I tried with chmod but I still get permission problems. What am I doing wrong?

1
  • I would update your question to include the output of the ls -ld /media/sf_MyProjectFolder and groups commands.
    – igal
    Commented Oct 24, 2017 at 12:44

1 Answer 1

13

Try adding yourself to the "vboxsf" group within the guest VM:

sudo usermod -a -G vboxsf $(whoami)

Note that you have to log out and log back in for this to take effect. After logging back in, check to make sure that you've been added to the group by running the groups command.

If that doesn't work, try checking the permissions on the directory:

ls -ld /media/sf_MyProjectFolder

The VirtualBox Manual has a chapter on Guest Additions which has a section that covers shared folders.

Also note that this question has been asked elsewhere on StackExchange, e.g. on StackOverflow:

You must log in to answer this question.

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