Sbin mount vboxsf mounting failed with the error protocol error

I have Ubuntu 10 as the guest OS on a Windows 7 machine. I have been trying to setup shares through VirtualBox, but nothing is working. First, I create the share in VirtualBox and point it to a W...

I have Ubuntu 10 as the guest OS on a Windows 7 machine. I have been trying to setup shares through VirtualBox, but nothing is working. First, I create the share in VirtualBox and point it to a Windows folder. Then I try to mount the drive in Linux, but I keep getting

/sbin/mount.vboxsf: mounting failed with the error: Protocol error

I have read so many solutions to this, but none seem to work. I have tried:

  • Using the mount.vboxsf syntax
  • Reinstalling VBox additions
  • Rebooting
  • Enabling and trying as root account

I made a share called «Test» in VBox Shared folders. Then I made a directory in ubuntu named «test2». Then I tried to execute this command:

sudo mount -t vboxsf Test /mnt/test2

Any other ideas?

Zanna's user avatar

Zanna

68.2k55 gold badges210 silver badges320 bronze badges

asked Mar 14, 2011 at 23:18

skaz's user avatar

1

In order to use shared folder functionality few prerequisites need to be met:

  • Make sure that Guest Additions are properly installed on the guest OS.
  • Users in a guest Ubuntu must be in the group vboxsf to be able to access shares.
  • Define a directory on the host that will be used in the virtual machine using the settings dialogue of Virtual Box.

Depending on host or guest OS the following may also be needed:

  • Do not share personal folders like /home/username or My Documents
  • Avoid special characters or empty spaces in the path to the shared folder, especially if the host or VM is a Windows machine
  • Use different names for share and mountpoint
  • Create a mountpoint on the guest OS (best in your HOME directory).

Testing shared folders functionality can be done by creating a shared directory on the host (e.g. C:myshare), define this as a shared folder for your guest system in Virtual Box settings (e.g. share), create a mount point in your guest os (e.g. mkdir /home/username/host) and mount this in the guest OS with the command:

sudo mount -t vboxsf -o uid=1000,gid=1000 share /home/username/host

where the option -o makes sure that you will have access to the mount (that will otherwise be owned by root).

For further information on shared folders see also the Virtual Box User Manual.

Files or directories can also be shared over the network by using Samba on the host and the guest.

answered Mar 15, 2011 at 8:13

Takkat's user avatar

TakkatTakkat

139k53 gold badges306 silver badges418 bronze badges

20

I also met this trouble. I found that the shared folder were already mounted at /media/sf_share.

I tried to delete /media/sf_share, but I couldn’t.

So I deleted shared folder «share» in my home directory.

$ rm -r ~/share

And then switch to root user with the following way:

$ sudo -i

Create softlink/shortcut to the /media/sf_share folder that owns by root user modify the ownership of softlink with chown command. Exit from root user to normal user

# ln -s /media/sf_share /home/username/share
# chown username.username /home/username/share
# exit
logout

$ chmod 777 ~/share

You can see the files in Windows through the shared folder.
And username must be a member of group vboxsf.

Community's user avatar

answered Sep 18, 2011 at 7:03

Old Urologist's user avatar

2

Here is what worked for me without any problem

I figured it out that, actually my user name was not in vboxsf group. Following two commands will help to get the group info:

grep "vboxsf" /etc/group    
grep "saurav" /etc/group

So I added saurav (me) to the vboxsf group using following command:

sudo usermod -a -G vboxsf saurav 

Then restarted the virtualbox and then.. Jumped from my placed.. :D :D Everything worked fine without any problem.

Please comment if any one still having any problem..

answered Apr 7, 2016 at 7:00

Saurav Kumar's user avatar

Saurav KumarSaurav Kumar

14.6k15 gold badges62 silver badges75 bronze badges

3

I also struggled a lot with the mounting, and tried everything I come up with in the interwebz but I finally found a very weird workaround to solve it! My guest is Ubuntu 13 and my host is Windows 7.

Change to the media folder and from there type user@os:/media$ sudo mount -t vboxsf share /home/username/folder

Yeah, that’s it. But I don’t understand how come it only works if it’s done from the media folder. If someone knows please kindly explain us below. Thanks.

P.s. Editing my /etc/rc.local to do the automounting at startup doesn’t work for me.

answered Jan 3, 2014 at 14:18

BringBackCommodore64's user avatar

3

With VirtualBox 5.1.20 running on Windows 10, and Ubuntu 16.04 as the guest OS with GuestAdditions 5.1.20 installed, I couldn’t mount the shared folders from the command line. The mount commands failed, with mentions of Protocol Error and sf_read_super_aux err=-22.

Eventually I found https://www.virtualbox.org/ticket/16670 «mount.vboxsf symlink broken». I followed one of the workarounds there, to correct the symlink for mount.vboxsf, and it all worked. My approach was to do:

mv /sbin/mount.vboxsf /sbin/mount.vboxsf-orig
ln -s /opt/VBoxGuestAdditions-5.1.20/lib/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf

The commands need to be done by root. So, because it was Ubuntu, I added «sudo » at the beginning of each line to do the command as root. Other flavors of Linux have other ways of doing that.

As an aside, there was a similar symlink problem reported in virtualbox’s Ticket #12879 «Can’t mount shared folders with guest additions 4.3.10» in 2014, that was fixed the following month.

2017-04-27

answered Apr 27, 2017 at 18:26

J Cumming's user avatar

4

For me, the problem was that I was a goose, and I’d forgotten that I’d removed the entry from my Shared Folders list in VirtualBox (Machine→Settings→Shared Folders).

I’m just throwing this in here, in case anybody else is ever similarly mislead by ‘Protocol error’.

:honk: 😉

answered Aug 7, 2018 at 16:17

Michael Scheper's user avatar

Tried all the aforesaid and nothing worked for me.
Lastly I created a new transient folder «Shared» with «Make Permanent» and «Auto Mount» enabled. And then I run the command

sudo mount -t vboxsf -o uid=1000,gid=1000 Shared /mnt/sharedvm

It worked for me. No error this time.

boardtc's user avatar

answered Jul 6, 2016 at 14:23

Pankaj's user avatar

I tried a few answers and then saw void’s comment saying he restarted the Linux guest OS and re-mounted.

Worked for me. :)

Eliah Kagan's user avatar

Eliah Kagan

115k53 gold badges311 silver badges484 bronze badges

answered Jun 10, 2020 at 14:18

yannick1976's user avatar

My shared folder was working and after rebooting my host, it wasn’t.

By changing the name of the shared folder from Shared to Shared2 it worked.

config.vm.synced_folder "/Users/username/Dropbox/Shared", "/Shared2"

No idea on what happened and why nor how to fix.
System with no global mutable state like Nix do have a point.

answered Feb 15, 2017 at 11:30

nicolas's user avatar

Personally I faced the same error message and the problem was related to the fact I did a typo related to the folder located on the host machine and which I set as a shared folder from within the virtual machine thanks to the guest additions.

So the right command is:

sudo mount -t vboxsf -o uid=$UID,gid=$(id -g) shared_folder_located_in_host_machine path_to_mounting_folder_inside_the_virtual_machine

This fixed the error message.

answered Apr 23, 2018 at 14:49

Billal Begueradj's user avatar

Billal BegueradjBillal Begueradj

5,25910 gold badges38 silver badges54 bronze badges

For me it was the wrong version of guest-additions.

I moved my whole VM from one laptop (which ran VirtualBox 5.8/something) to another laptop with VirtualBox 6.0. Everything worked except the mounting of shared folder.

I just started VM, clicked on Devices -> Insert Guest additions CD image... and followed instructions. It cribbed a bit about presence of older version of guest additions, but then removed it and installed the new one on second attempt. Reboot and works.

answered Aug 27, 2019 at 20:53

Kashyap's user avatar

KashyapKashyap

3513 silver badges10 bronze badges

Virtual box is a great tool for Java developer to run Docker and Linux on Windows Machine, especiall for them who need to develop and debug Java program in Linux environment. I use Oracle’s virtual machine, VirtualBox to run the Linux operating system from my Windows machine. It’s the most simple way to have two operating systems on your laptop or PC. Since I run most of the Java programs in Linux, VirtualBox gives me a nice interface to run UNIX commands right from the Windows box. This blog post is about the mounting of a shared folder failed error in Oracle’s Virtualbox VM. It was working fine the day before yesterday and now, after I restarted my virtual box and tried to mount my shared folder, I was greeted by this error: «/sbin/mount.vboxsf: mounting failed with the error: Protocol error»

I was using the following command to mount my shared folder on VirtualBox:

$ mount -t vboxsf mountfolder /home/devInHost/mountfolder

I was running Oracle’s VirtualBox 6.0 version with the guest operating system as RedHat Linux 8 and host OS like Windows 10.

Solving /sbin/mount.vboxsf: mounting failed with the error: Protocol error VirtualBox

There was nothing different I was trying, I had run this command successfully numerous times, but it was not working today.

I looked all over the internet for a solution and tried things like running this command after doing



or
$ cd ~



but with no luck. After a bit of struggle, I found that my virtual box has no shared folder.

I went to Settings -> Shared Folders and there was nothing on it, even though I had specified shared folder in the previous run. I later realized that I had not made it permanent, that’s why when I restarted my VirtualBox, there was no shared folder.

Once I specified the shared folder the command ran fine, even without restarting the virtual box.

mounting failed with the error: Protocol error VirtualBox

Summary

Here is the summary of what happened, what was the root cause of the error, and how I fixed it.

What I was trying to do: 
mounting shared folder on Linux guest OS inside Oracle VirtualBox.

Command:

$ mount -t vboxsf mountfolder /home/devInHost/mountfolder



Error:
«/sbin/mount.vboxsf: mounting failed with the error: Protocol error»

Cause:
There was no shared folder. I had before the last run but it wasn’t permanent so when I restarted the Virtual box, it got reset.  You can check this by going to Settings -> Shared Folders

Solution:
Specify the new shared folder and re-run the command $ mount -t vboxsf mountfolder /home/devInHost/mountfolder again. It will work fine, no need to restart the Virtual box again.

Thanks, I hope this can save some time for you, when you get this error, don’t forget to check your shared folder settings in the virtual box before looking into the internet for the solution.

Other Tech Debugging and Troubleshooting Guide You May Like

  • How to solve java.lang.UnsatisfiedLinkError: no ocijdbc11 in Java [solution]
  • java.net.SocketException: Failed to read from SocketChannel: Connection reset by peer [fix]
  • How to solve java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver in Java? [solution]
  • java.net.BindException: Cannot assign requested address: JVM_Bind [fix]
  • How to fix java.lang.ClassNotFoundException: org.postgresql.Driver error in Java? [solution]
  • Fixing Unsupported major.minor version 53.0 Error in Java [solution]
  • How to solve java.lang.classnotfoundexception sun.jdbc.odbc.jdbcodbcdriver [solution]
  • How to solve java.lang.ClassNotFoundException in Java [guide]
  • Exception in thread «main» java.lang.ExceptionInInitializerError in Java Program [fix]
  • java.net.SocketException: Too many files open java.io.IOException [solution]
  • 2 ways to solve Unsupported major.minor version 61.0 error in Java [solutions]
  • java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver [solution] 
  • java.io.IOException: Map failed and java.lang.OutOfMemoryError: Map failed  [fix]
  • java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory? [solution]
  • org.hibernate.MappingException: Unknown entity Exception in Java [solution]
  • java.lang.ClassNotFoundException:org.Springframework.Web.Context.ContextLoaderListener [solution]
  • Exception in thread «main» java.lang.ArrayIndexOutOfBoundsException: 1 [solution]
  • How to solve java.lang.ClassNotFoundException: com.mysql.jdbc.Driver in Java MySQL? [solution]

Thanks for reading this  Virtual box debugging tutorial so far. If you find my
solution useful, please share this article with your friends and
colleagues. 

I’ve installed Ubuntu 10.04 as a Virtualbox VM. I’d like to make my entire C drive an always-enabled shared folder under ~ (/home/). I’ve seen this tutorial but I’m unsure of the differences between the commands they give. After creating a new virtual folder called «C» under Virtualbox Settings -> Shared folders, I tried, inside ~,

mkdir C
sudo mount -t vboxsf share ~/C

but I get

/sbin/mount.vboxsf: mounting failed with the error: Protocol error

What is the correct command to achieve what I want to do?

BenMorel's user avatar

BenMorel

8554 gold badges13 silver badges32 bronze badges

asked Jul 1, 2013 at 18:54

1'''s user avatar

According to this blog post, the first argument after vboxsf (share in this case) should be the label you’ve given the folder in the Virtualbox Manager. Since I called my folder «C» in the Virtualbox Manager, I was able to mount the folder with:

mkdir C
sudo mount -t vboxsf C ~/C

However, this method requires the drive to be remounted after start-up. This excellent post suggests putting the command in the /etc/rc.local script, which is run on start-up:

sudo mount -t vboxsf -o uid=1000,gid=1000 virtualbox_share_name /home/my_username/folder_name

The full path is required since it’s running as root.

answered Jul 1, 2013 at 18:55

1'''s user avatar

2191 gold badge4 silver badges15 bronze badges

1

In the past when I ran into a protocol error while mounting a VirtualBox share, I just went into the shared folders configuration in the VirtualBox UI, removed the share configuration that wasn’t mounting properly and re-created it with exactly the same settings, then retried the mount and it worked.

answered Feb 19, 2015 at 7:10

rakslice's user avatar

rakslicerakslice

2,5642 gold badges19 silver badges26 bronze badges

  1. Setup the share from the virtualbox interface in the Host OS. (I would not give myself write permission to C:. or for a short period and then remove it)
  2. Install VirtualBox Additions in the guest OS.
  3. Make your user (in the Guest OS) a member of the vboxsf group that has provileges setup correctly.

    sudo usermod -a -G vboxsf bob
    (if your user is bob)

Depending on your settings as of 1) you’ll get read/access from the «Computer» section showing drives, normally you should.

answered Jan 31, 2017 at 14:34

clement's user avatar

  • Reply with quote

[Solved] mount.vboxsf: Protocol error

os: Windows 10 pro 1709
laptop: Lenovo Thinkpad E570
Virtualbox: 5.2.12

Hello.
When I try to mount the shared folder I get this error:
mount.vboxsf: mounting failed with the error: Protocol error

error.PNG
error.PNG (41.85 KiB) Viewed 7182 times

I have Guest Addition installed
I have shared folder on Desktop but if I try to open an error is displayed.

shared folder.PNG
shared folder.PNG (40.67 KiB) Viewed 7182 times
shared folder permission.PNG
shared folder permission.PNG (64.13 KiB) Viewed 7182 times

I need some help.
Thanks

Edoardo

edx
 
Posts: 12
Joined: 22. May 2018, 11:46


  • Reply with quote

Re: mount.vboxsf: Protocol error

Postby mpack » 30. May 2018, 10:52

You are asking a question about a Linux Guest error message by posting in the Windows Hosts forum — perhaps not the best choice if you wanted a quick answer.

Providing a VM log file would have been a good move too.

I will move the topic. Provide a VM log file by right clicking the VM in the manager (the VM must be fully shut down). Select «Show Log» and save «VBox.log» (no other file) to a zip file. Attach the zip here.

mpack
Site Moderator
 
Posts: 37957
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

  • Reply with quote

Re: mount.vboxsf: Protocol error

Postby edx » 30. May 2018, 11:04

You are asking a question about a Linux Guest error message by posting in the Windows Hosts forum — perhaps not the best choice if you wanted a quick answer.

I’m sorry, you’re right.
Thanks for the answer, here’s the Log file you requested.

edx
 
Posts: 12
Joined: 22. May 2018, 11:46

  • Reply with quote

Re: mount.vboxsf: Protocol error

Postby mpack » 30. May 2018, 12:31

The log shows that everything is correct from the VM side (the GAs are loaded, the folder exists etc):

VBox.log wrote:00:00:31.337917 VMMDev: Guest Log: 00:00:00.028534 automount vbsvcAutoMountWorker: Shared folder ‘VBORACLE’ was mounted to ‘/media/sf_VBORACLE’

So I assume that you have a permissions problem in the guest. I’m not a Linux user, so I can’t tell you what that is. I can see that the user manual «mount» command does not use sudo, and using sudo seems to imply that the folder will only be mounted for root access — so perhaps this has to do with default protections you’ve configured in Oracle Linux.

mpack
Site Moderator
 
Posts: 37957
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

  • Reply with quote

Re: mount.vboxsf: Protocol error

Postby edx » 30. May 2018, 12:41

I don’t know how, but I solved. Probably when I restarted my host… :lol:

edx
 
Posts: 12
Joined: 22. May 2018, 11:46

  • Reply with quote

Re: [Solved] mount.vboxsf: Protocol error

Postby mpack » 30. May 2018, 12:44

I see. Thanks for reporting back.

mpack
Site Moderator
 
Posts: 37957
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

  • Reply with quote

Re: [Solved] mount.vboxsf: Protocol error

Postby Hiro Protagonist » 15. Jan 2020, 19:55

I’ve also had this problem, and it seems to be due to checking «Auto mount», which gives a «BrokenSharedFolder» warning when you close the dialog box, and then «Protocol error» if you try and mount the folder. I found that if you just check «Make permanent» without «Auto mount» and put the command to mount the folderin /etc/rc.local, it works.

Hiro Protagonist
 
Posts: 25
Joined: 4. Jul 2013, 17:46


Return to Linux Guests

Who is online

Users browsing this forum: SJHK, YaCy [Bot] and 8 guests

Setup: VirtualBox 4.3.26, Win 7 SP1 host, Debian jessie 8.0 (stable) guest.

In VirtualBox Manager, select Shared Folders Settings… in the Devices drop-down menu.

In the resulting pop-up window, select Machine Folders in the Folders List and then click the «Add a New Shared Folder Definition» button (the blue folder with a green «+» sign icon to the right of the Folders List).

In the resulting Add Share pop-up form, click on the down-arrow button in the Folder Path field, and then select Other. A Browse For Folder pop-up window will appear.

(In my case, I had just added another hard drive to my workstation to be used for a dedicated share, already formatted for NTFS, with a volume name of «share», and mounted as «G:». So I clicked the arrow next to Computer, selected drive G: and then clicked the OK button.)

(In your case you should select whatever folder or drive you intend to share, then click the OK button.)

When you’ve made your selection and clicked the OK button, VirtualBox Manager will fill in the Folder Path and Folder Name fields of the Add Share form. Leave the Folder Path field alone, but you can change the Folder Name if you like — just be sure to remember it for later.

Finish up the Add Share form by selecting the Make Permanent check box, but be sure to leave the Auto-mount check box cleared — we’re going to take care of mounting later. (And of course, if you want to make the folder or drive read-only, then go ahead and check the Read-only box.) Then click the OK button.

The newly-configured share should now appear as an entry under Machine Folders in the Folders List. Click the OK button.

In order to mount this share during boot (startup) we need to add a mount definition line to /etc/fstab in our Debian jessie guest installation. This edit needs to be done either as root or via sudo, for example:

sudo nano /etc/fstab

(I personally used vi, but because nano is the default editor on Debian jessie I specified it in the above example.)

To mount this share in my home directory, with its ownership and group set to my personal UID and GID, I added the following definition to /etc/fstab:

share /home/conib/share vboxsf comment=systemd.automount,uid=conib,gid=conib,noauto 0 0

(Note that there are no spaces around the «=», «.», or «,» characters.)

An /etc/fstab definition is in the form

<Device> <Mount Point> <Type> <Options> <Dump> <Pass>

(Note that there should be whitespace — space(s) and/or tab(s) — between the fields of the definition, but no whitespace within a field.)

The «Device» field should be set to the Folder Name we specified via VirtualBox Manager Add Share. I had changed the default «G_DRIVE» to «share».

The «Mount Point» is a directory path spec that must already exist but should be empty. (That is, anything already present in that directory will be hidden by what you’re mounting on top of it.) I had created a new, empty subdirectory named «share» in my home directory.

The «Type» is «vboxsf».

The «Options» (comment=systemd.automount,uid=conib,gid=conib,noauto) were the tricky bit, and took a bit of trouble to get working for this setup.

Set «Dump» to 0 unless you know you want it set to something else.

And since we don’t want fsck checking this share, set «Pass» to 0 too.

When you’ve added the definition line to /etc/fstab, reboot your Debian guest and confirm that you can see the files and subfolders of your Share.

HTH.

Понравилась статья? Поделить с друзьями:
  • Sbin mount vboxsf mounting failed with the error no such device
  • Sbin mount vboxsf mounting failed with the error invalid argument
  • Sbie1222 error with security token c0000058 62
  • Sberpay ошибка при оплате
  • Sbds interactive codes ошибка