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 system in your laptop or PC. Since I run most of Java program in Linux, VirtualBox gives me a nice interface to run UNIX commands right from Windows box. This blog post is about the mounting of shared folder failed error in Oracle's Virtualbox VM. It was working fine 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 as Windows 8.

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

No comments :

Post a Comment