I have VirtualBox installed in my windows host machine and I have installed Ubuntu in VirtualBox. I created a folder in windows to share it with Ubuntu, the folder in windows is located in D:/webroot and in Ubuntu it is /web.
So I followed this tutorial How To - Create Shared folder in Ubuntu under Virtual Box and basically I created a new shared folder in windows, created a file /etc/rc.local and I put in it this code:
sudo mount -t vboxsf -o uid=33,gid=33 Webroot /web/
exit 0
then I run these as specified in the tutorial:
sudo mount /dev/cdrom /mnt
cd /mnt
sudo ./VBoxLinuxAdditions.run
sudo reboot
I can see that it works, if I create a file inside /web or D:/webroot it reflects on both sides but the problem is, as soon as I set this sharing system, the entire content of the folder /web in Ubuntu is cleared. This is a problem because I tried with sharing the apache files location in /var/www/ and I ended up with all html files deleted when I start sharing that folder?
Is this a normal behavior for sharing files in VirtualBox, does this mean that sharing is done first from host to guest, that is why Ubuntu folder is cleared because the windows folder is empty or am I missing something here please?
Thanks.