Disclosure: This article may contain affiliate links. When you purchase, we may earn a small commission.

How to fix VirtualBox - /sbin/mount.vboxsf: mounting failed with the error: Protocol error [Solution]

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 4.1 version with the guest operating system as RedHat Linux 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
$ cd / 
$ 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


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.

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

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

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

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.

1 comment :

oktbabs said...

Thanks. It worked for me. I didnt know when the shared folder dropped off from the virtuabox.

Post a Comment