My setup

enter image description here

I want to setup a ubuntu vm to act as a web server for development.


I want to have a development environment as close to the actual production environment as possible.


The above setup failed. I keep getting a File Not Found when I navigate to http://project1.localhost:8888

What I tried

I did add www-data to the group vboxsf using

sudo adduser www-data vboxsf

before trying any of the below.

  1. As mentioned, I tried the above setup. File not found error on webpage.
  2. I tried the above setup but symlink from /var/virtual/project1 to /media/sf_WebApps/project1. File not found error on webpage.
  3. I tried to chown the /media/sf_WebApps from root:vboxsf to www-data:vboxsf. Not possible.
  4. I tried to chmod the /media/sf_WebApps to 755. Not possible.
  5. I made a copy of /media/sf_WebApps/project1 and place the copy inside /var/virtual. This works, but this is not what I want. Why not? Because I want to easily use my host programs like github mac app and sublime text editor to make changes to the code base and see it reflected when I visit on browser.

The answer is found here from serverfault.

Basically, you need to mount the (already mounted) shared folder as another user.


mount -t vboxsf SHARE_NAME -o rw,dmode=777,gid=GROUP_ID,uid=USER_ID /path/on/guest

In this case, it will be

mount -t vboxsf WebApps -o rw,dmode=777,gid=GROUP_ID,uid=USER_ID /var/virtual/some_folder_name

If you want to do this mount every time you turn on the guest OS, create a file on /etc/init/SOMETHING.conf, with something like this:

description     "SOME DESCRIPTION"

start on starting

exec mount -t vboxsf WebApps -o rw,dmode=777,gid=GROUP_ID,uid=USER_ID /var/virtual/some_folder_name

To find out what is your uid or gid

 id -u username
 id -g username


Always remember to first create the mount point first.

Always remember to install the GuestAdditions first. You can refer to http://docs-v1.vagrantup.com/v1/docs/base_boxes.html under Install Guest Additions.

sudo apt-get install linux-headers-$(uname -r) build-essential
sudo apt-get install dkms -y

sudo mount /dev/cdrom /media/cdrom
sudo sh /media/cdrom/VBoxLinuxAdditions.run
  1. To edit /etc/group
  2. To find the line contains "vboxsf"
  3. To Add account after the colon (like www-data). If you need to add multiple accounts, you can separate them by commma
  4. Relogin or reboot

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.