[linux] How to access share folder in virtualbox. Host Win7, Guest Fedora 16?

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?

This question is related to linux windows-xp fedora virtualbox vbox

The answer is


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".


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 'mount' and where to find mounted shared folder


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"

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...


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


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


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


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.


Examples related to linux

grep's at sign caught as whitespace How to prevent Google Colab from disconnecting? "E: Unable to locate package python-pip" on Ubuntu 18.04 How to upgrade Python version to 3.7? Install Qt on Ubuntu Get first line of a shell command's output Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running? Run bash command on jenkins pipeline How to uninstall an older PHP version from centOS7 How to update-alternatives to Python 3 without breaking apt?

Examples related to windows-xp

installing JDK8 on Windows XP - advapi32.dll error How to Create a script via batch file that will uninstall a program if it was installed on windows 7 64-bit or 32-bit How do I find files with a path length greater than 260 characters in Windows? Apache Maven install "'mvn' not recognized as an internal or external command" after setting OS environmental variables? How to access share folder in virtualbox. Host Win7, Guest Fedora 16? How to create ls in windows command prompt? How to fix an UnsatisfiedLinkError (Can't find dependent libraries) in a JNI project How to use random in BATCH script? How to delete or change directory of a cloned git repository on a local computer How do I manually create a file with a . (dot) prefix in Windows? For example, .htaccess

Examples related to fedora

curl: (6) Could not resolve host: google.com; Name or service not known Permission denied on accessing host directory in Docker How do I check my gcc C++ compiler version for my Eclipse? What's the default password of mariadb on fedora? How do I install g++ for Fedora? How to view unallocated free space on a hard disk through terminal How do I enable --enable-soap in php on linux? How to access share folder in virtualbox. Host Win7, Guest Fedora 16? Could not reliably determine the server's fully qualified domain name How to list installed packages from a given repo using yum

Examples related to virtualbox

virtualbox Raw-mode is unavailable courtesy of Hyper-V windows 10 VirtualBox Cannot register the hard disk already exists how to get the ipaddress of a virtual box running on local machine How to install Guest addition in Mac OS as guest and Windows machine as host How to connect to a docker container from outside the host (same network) [Windows] Failed to open/create the internal network Vagrant on Windows10 VT-x is disabled in the BIOS for both all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED) VirtualBox: mount.vboxsf: mounting failed with the error: No such device Shared folder between MacOSX and Windows on Virtual Box Virtualbox shared folder permissions

Examples related to vbox

How to access share folder in virtualbox. Host Win7, Guest Fedora 16?