First, create a shared folder using the VirtualBox user interface. For this example, we’ll call it “Data”. Launch Ubuntu.
From within Ubuntu, launch Application > Accessories > Terminal, and at the prompt type
sudo gedit /etc/fstab
Enter your administrative password, and you’ll see a text editor window appear with the fstab file loaded. Add the following single line to the end of the file, but replace “username” with your actual username.
Data /home/username/MyData vboxsf defaults,rw,uid=1000,gid=1000 0 0
Click “Save” and then restart Ubuntu.
Once restarted, go to Places > Home Folder and note the new MyData folder. This is your shared fol