Share a directory between Ubuntu and a virtualbox instance

23rd Aug, 2012 | unix

With ubuntu the shared folder is placed in the /media directory on the

vdi with a name of sf_XXXX where XXXX is the name you have given it.

on the vdi in /var/www type

ln -s /media/sf_XXXX /var/www/XXXX

this creates the symlink between the two directories, with

/var/www/XXXX being the doc root for apache

you need to add vboxsf into the apache group with

addgroup -a -G vboxsf www-data

and then restart apache

apache2ctl restart