You need to have the Guest Additions installed first, then you can setup a shared folder in the settings, let’s say Websites and mount it to /var/www/html/.
Then, inside the virtual machine, add that shared folder Websites to the fstab by adding the line
Websites /var/www/html vboxsf rw,uid=33,gid=33 0 0
and giving the right permissions.
If you get the following error during boot:
keys:Press S to skip mounting or M for manual recovery
Then, you’ll have to add vboxsf on a line of its own in /etc/modules to force loading it early.
Solution found on askubuntu.com