I have the following setup:

HOST MACHINE: openSUSE LEAP (KDE) Linux GUEST MACHINE: CentOS 7 (no GUI, command line only) VM: VirtualBox 5.1.4

I have a directory on my host machine called ~/development/webfiles and on my CentOS VirtualBox server, I have /webapps/apps/webtest/public_html.

I want the files for /webapps/apps/webtest/public_html to actually be from my host machine's ~/development/webfiles directory.

How would I do this?

EDIT: After installing guest additions, I now have a folder:


How do I:

  1. Point my public_html directory at that
  2. Make it so it happens on startup

I solved by doing the following:

  1. Install guest additions in the CentOS server
  2. Find the actual name of the shared folder: ls -l /media
  3. Remove the existing "public_html" directory: rm /webapps/apps/webtest/public_html (You may need to be root)
  4. Create a symlink to that directory: ln -s /media/sf_webfiles /webapps/apps/webtest/public_html

EDIT: This does not work for apache!

A symlinked folder did not work - apache wouldn't read it no matter what permissions I gave the directory. Instead I had to mount it like this:

sharedfoldername /webapps/apps/destfolder    vboxsf  rw,uid=48,gid=48    0   0

I put that in /etc/rc.d/rc.local

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.