I've fixed mine using the following way:
1) Update system's packages
$ sudo apt-get update
2) install virtual box guest additions (referenced from here)
$ sudo apt-get install virtualbox-guest-additions-iso
3) Now install guest additional package (Crucial step! People generally miss this which creates an error “Unknown file type “vboxsf”)
$ apt-get install virtualbox-guest-utils
NOTES:
You might face the following problems:
No such device:
root@packer-virtualbox-iso:~/new# mount -t vboxsf new ~/new
/sbin/mount.vboxsf: mounting failed with the error: No such device
-> YOU HAVE TO RESTART TO ALLOW CHANGES TO TAKE EFFECT.
you might experience the following error:
vagrant@packer-virtualbox-iso:~$ sudo mount -t vboxsf new ~/new
/sbin/mount.vboxsf: mounting failed with the error: Protocol error
-> TO RESOLVE THIS, YOU MIGHT HAVE TO CHANGE THE NAME OF THE MOUNTING DEVICE/FOLDER (e.g. here is new)
-> OR FOLLOW THIS if NOT FIXED (REF)
- Made shared folder on host system, D:\Virtual Box\shared;
- Ran VirtualBox;
- Ran virtual machine;
- Linux finished booting, I logged in;
- I added shared folder D:\Virtual Box\shared, named it “shared”;
- I made guest shared folder being logged as a user, called it “shared_folder”. /home//shared_folder;
- $su;
- Being logged as a root I mounted the shared folder: #mount -t vboxsf shared /home//shared_folder;
- And all began to work.
May be the problem was host and guest folders should be the same names?