I have set up an Ubuntu 15.04 as a Virtual Machine with Oracle VirtualBox. I am running a LAMP server stack on that machine.

As I want to develop on my host machine, I mounted a local folder on my host machine into the VM, which is /media/myfolder. And I have created a symlink from /var/www/html to that folder.

I get 403 Forbidden errors when I try to modify the permissions of folders or files, but any sudo chmod 644 index.php doesn't do anything (no error message either).

File permissions are

  • For /var/www/html

    lrwxrwxrwx root root myfolder -> /media/myfolder
  • For files in /var/www/html, e.g. index.php

    -rwxrwx--- root vboxsf index.php

Any idea how I can manage to access this proxy-alike workaround?

  • What is the file system type in the host? ExtN, fat32, ...? – MariusMatutiae Jun 16 '15 at 7:23
  • @MariusMatutiae It's NTFS. – Gottlieb Notschnabel Jun 16 '15 at 8:57

It looks like Apache does not have permissions to read index.php.

-rwxrwx--- root vboxsf index.php

In that case only root and users that are in the vboxsf group can read this file. Apache runs as different user (www-data in Ubuntu as fair as I remember), and this user is not in vboxsf group.

You can:

  1. add www-data user to vboxsf group
  2. change mount options to allow also for others (it depends on file system).
| improve this answer | |
  • I do not think this is the problem, because the OP says that file permissions cannot be modified at all, never mind Apache access. – MariusMatutiae Jun 16 '15 at 7:35
  • So adding www-data to vboxsf group might solve the problem. – Krzysztof Sawicki Jun 16 '15 at 7:38
  • Number one looks promising. I'll take a look into that and leave my feedback here. Thanks in advance! – Gottlieb Notschnabel Jun 16 '15 at 8:57

Two steps:

  1. Host > Settings > Shared Folders > Double click the share. Are Read-only and auto mount checked?

Please check this first.

  1. From within the Ubuntu guest, you need to add all potentail users of the share (YourName, root, www-data) to the vboxsf group.

    sudo adduser YourNaame vboxsf

and so on.

| improve this answer | |
  • I had read-only checked but deactivated it later. Will try to add users to group vboxsf. Thanks! – Gottlieb Notschnabel Jun 16 '15 at 9:37
  • That did it. As @Krzysztof Sawicki answered first, I'll reward him with accepted answer. But thanks anyway! – Gottlieb Notschnabel Jun 16 '15 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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