Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Having jumped through several hundred hoops I've finally managed to get Centos 5.8 to mount a VirtualBox shared folder (which is not read-only), which now appears at:


This is a folder on my host machine (Mac OS X 10.8.2) containing sites.

The directory and its subfolders are all owned by user root and group vboxsf

I have added the user apache to the group vboxsf

However httpd doesn't let me use my shared folder as Document root. My vhost is set up as:

DocumentRoot /media/sf_sites/mysite/public

On Apache restart I get this:

Starting httpd: Warning: DocumentRoot [/media/sf_sites/mysite/public] does not exist
                                                           [  OK  ]

And, unsurprisingly, when viewing the site in my browser I get a 403 error. ("You don't have permission to access / on this server.")

Any ideas whether it's possible to make this work?

I want to develop on my Mac but use Linux in VirtualBox as my development server. Is there an alternative way to do this?

share|improve this question

Create a mount point in your Linux, install sshfs if you don't have it yet.

Do the following in CentOS

sudo su - apache
sshfs root@< your OS X IP >:< web folder path > < mount point >

For example:

  • OS X IP:
  • OS X web folder path: /Users/me/webOSX
  • CentOS mount point: /var/www/webLinux

The sshfs command will be: sshfs root@ /var/www/webLinux

share|improve this answer
This mounts successfully, but same problem: DocumentRoot [/var/www/sites/mysite/public] does not exist – Adrian Nov 4 '12 at 9:48
Update: got it to work with user_allow_other set in /etc/fuse.conf and sshfs -o allow_other me@ /var/www/sites. But Apache throwing "unexpected end of file" errors into error_log. – Adrian Nov 4 '12 at 10:37
@Abe, did you sudo su - apache before doing the sshfs mount? – John Siu Nov 4 '12 at 16:56
Yes I did. It seemed to be basically working, but PHP is having problems with file lengths (unexpected end of file errors). Coming to the conclusion that back-end code is better off local on the server! – Adrian Nov 5 '12 at 15:01
up vote 0 down vote accepted

I never solved the 'unexpected end of file' issues, but then Vagrant came along and that does all the hard work for you.

share|improve this answer

Your Answer


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.