I followed (among other related threads) in order to mount a shared folder in my Ubuntu 20.04 VM.
Auto-mounting
I created an entry under VirtualBox Ubuntu 20.04 VM Settings -> Shared Folders and completed the Folder Path to a valid Windows(host) location, the Folder Name (called shared) and checked Auto-mount and Make Permanent. I left Mount point empty.
After the above setup I boot the Ubuntu 20 VM and I was expecting to see the mount under /media/sf_shared and I did see it however it was empty even though on the host machine there are several files.
Manual mounting
From VirtualBox In Settings -> Shared Folders dialog I unchecked Auto-mount checkbox and added a valid value in Mount point (eg.
/home/myuser/shared). However the same behavior as for Auto-mounting happens. The share does not work, cannot see the files under the shared folder from the host machine.From VM Ubuntu terminal
sudo mount -t vboxsf -o uid=$USER,gid=vboxsf shared /home/myuser/sharedBut I get the following error:
/sbin/mount.vboxsf: mounting failed with the error: Invalid argument
Maybe the last error that I got in terminal is a hint for the root of the problem. However I couldn't find any relevant information of how to solve it. Does anyone has any idea of what's going on here?
Also must mention that on the same VirtualBox I have another VM installed (Ubuntu 18.04) on which the auto-mounting is working as a charm.
31 Answer
I also had this problem, but it turned out that I was using an outdated version of the guestadditions. I mounted version 6.1.32 of guestadditions in the guest and then I reinstall the additions, reboot the guest and it worked.