Question

I'm a newbie in linux. I installed Fedora 16 OS as guest in virtualbox on Window 7. Now, I want to access share folder from Fedora. Here is something I did:

  • Install guest addtion [OK]
  • Make share folder link to virtualbox [OK]. Share folder path in Window 7: D:\share_folder_vm
  • In terminal program in fedora, I just run some commands:

    [hoangphi@localhost ~]$ su
    Password: 
    [root@localhost hoangphi]# cd Desktop/
    [root@localhost Desktop]# mkdir share_folder
    [root@localhost Desktop]# sudo mount -t vboxsf D:\share_folder_vm \share_folder
    /sbin/mount.vboxsf: mounting failed with the error: Protocol error
    [root@localhost Desktop]# 
    

I got this message: /sbin/mount.vboxsf: mounting failed with the error: Protocol error

share_folder_vm is the folder in Win7 Host and share_folder is the folder in Fedora Guest.

My question: How can I fix this problem?

Was it helpful?

Solution

Install Oracle Guest Additions:

[host-hotkey (usually right Ctrl)] + [d],

Then:

sudo /media/VBOXADDITIONS_4.*/VBoxLinuxAdditions.run

You can now enjoy:

  • A guest that can run at native screen resolution
  • Ability to share files between host and guest
  • Share the clipboard (allowing you to copy and paste between host and guest).

To share folders set them up to be shared. Consider the permissions. Note that the host file permissions are transient. IOW if you can't write to file on host, the guest can't either.

After setting up the file to be shared create a destination if you don't have one: mkdir -p ~/destination

Now mount it under the name you configured it with:

sudo mount -t vboxsf myFileName ~/destination

As an extra tip you can really exploit this feature to do things like: - Use guest subversion client to create repository to mounted directory (you won't have a full svn client but the repo can be used in an IDE on the host). - I personally use my guest to download and unpack binaries like Tomcat to a targeted mount. Yes you can use Linux to install things on Windows!

To unmount all shares:

sudo umount -f -a -t vboxsf

OTHER TIPS

This thread has some great tips. However....

@GirishB's answer isn't correct - sorry. Jartender's is best.

Also, every post in here seems to assume you're logging in to the Linux guest as root, except for @tomoguisuru. Yuck! Don't use root, use a separate user account and "sudo" when you need root privileges. Then this user (or any other user who needs the shared folder) should have membership in the vboxsf group, and @tomoguisuru's command is perfect, even terser than what I use.

Forget running mount yourself. Set up the shared folder to auto mount and you'll find the shared folder - it's under /media in my OEL (RH and Centos probably the same). If it's not there, just run "mount" with no arguments and look for the mounted directory of type vboxsf.

Terminal showing

For accessing a shared folder, YOU have to have "Oracle VM extension pack" installed.

Look at the bottom of this link, you can download it from there.

http://www.oracle.com/technetwork/server-storage/virtualbox/downloads/index.html

I just figured. You need to add a shared folder using VirtualBox before you access it with the guest.

Click "Device" in the menu bar--->Shared File--->add a directory and name it

then in the guest terminal, use:

sudo mount -t vboxsf myFileName ~/destination

Dont directly refer to the host directory

There's a simpler way I found when running Linux Mint.

  1. Ensure you install the Guest Additions from the command line and that you have the folder(s) shared with "automount" and "make permanent" settings selected within "Shared Folders" tab of the Machine Settings
  2. Launch the User management application from Application/Settings/System Setting/ menu selection (requires sudo) from within the Mint menu
  3. In the "Privileges and Groups" tab, check the box next to the "vboxsf" group, and then apply and ok your way back out.

Any user within the vboxsf group has full access to any shared folders on each boot with no manual mounting or unmounting

I usually do the following in addition to the above just to have quick access

  1. Open the Dolphin file manager and navigate to /media/
  2. Right-Click on the shared folder and click "Add to Places"

You probably need to change your mount command from:

[root@localhost Desktop]# sudo mount -t vboxsf D:\share_folder_vm \share_folder

to:

[root@localhost Desktop]# sudo mount -t vboxsf share_name \share_folder

where share_name is the "Name" of the share in the VirtualBox -> Shared Folders -> Folder List list box. The argument you have ("D:\share_folder_vm") is the "Path" of the share on the host, not the "Name".

May be this can help other guys: I had the same problem, and after looking with Google I found that can be because of the permissions of the folder... So, you need first to add permissions...

$ chmod 777 share_folder

Then run again

$ sudo mount -t vboxsf D:\share_folder_vm \share_folder

Check the answers here: Error mounting VirtualBox shared folders in an Ubuntu guest...

VirtualBox version has many uncompatibilities with Linux version, so it's hard to install by using "Guest Addition CD image". For linux distributions it's frequently have a good companion Guest Addition package(equivalent functions to the CD image) which can be installed by:

sudo apt-get install virtualbox-guest-dkms

After that, on the window menu of the Guest, go to Devices->Shared Folders Settings->Shared Folders and add a host window folder to Machine Folders(Mark Auto-mount option) then you can see the shared folder in the Files of Guest Linux.

There is a really simple tuturial here : http://my-wd-local.wikidot.com/otherapp:configure-virtualbox-shared-folders-in-a-windows-ho

telling to do:

sudo mkdir /mnt/vbox_share
sudo mount.vboxsf nameAddesAsShared /mnt/vbox_share

These are the steps to share a folder from Windows to Linux Virtual Box

Step 1 : Install Virtual Box Extension Pack from this link

Step 2: Install Oracle Guest Additions:

By pressing -> Right Ctrl and d together

Run the command sudo /media/VBOXADDITIONS_4.*/VBoxLinuxAdditions.run

Step 3 : Create Shared Folder by Clicking Settings in Vbox Then Shared Folders -> + and give a name to the folder (e.g. VB_Share) Select the Shared Folder path on Windows (e.g. D:\VBox_Share)

Step 4: Create a folder in named VB_share in home\user-name (e.g. home\satish\VB_share) and share mkdir VB_Share chmod 777 VB_share

Step 5: Run the following command sudo mount –t vboxsf vBox_Share VB_Share

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top