Linux – mounting viirtualbox shared folder on debian

debianlinuxvirtualbox

i try mount VB shared filder (host is windows)

mount -t vboxsf share ~/host
/sbin/mount.vboxsf: mounting failed with the error: Protocol error

1) the operating systems on both host and guest machine
Host : windows 7
Guest : debian

2) How you are sharing the folder.
i setup it on Devices/shared folders settings – virtualbox configuration.
i setup E:/ as Tansient Folder

3) Have you installed Virtual Box Guest Additions on the guest?
yes

4) Which version of virtual box you are using
4.3.8

5) Have you installed the Virtual Box extension pack from their website? We need more information to be able to help.

i not install extension pack, only from menu quest additions then in virtual debian as root install it.

Best Answer

OK, just experimented with Debian Wheezy guest on a Windows XP host (VirtualBox 4.3.8).

Prerequisites:

  • Host:

    • Create a shared folder (using the UI or the vboxmanage command).
    • Notice that it has both the pathname and the "shortname".

      For instance, I might share the folder C:\Documents and settings\User making it available under the name user.

  • Debian guest:

    • Have virtualbox-guest-dkms installed, compiled for the current kernel (done automatically; if not, install the matching linux-headers package and run dpkg-reconfigure virtualbox-guest-dkms).
    • Have virtualbox-guest-utils to make mount.vboxsf available.

Now on your guest you can do

# mkdir /tmp/foo
# mount.vboxsf user /tmp/foo

or, alternatively, the last step can be spelled as

# mount -t vboxsf user /tmp/foo

Notice the usage of the short name for the "device" argument in the call to mount.

The answer is based on this comment in the thread dealing with the similar issue elsewhere on SO.

Related Question