Error mounting VirtualBox shared folders in an Ubuntu guest

1

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

0 0
2

by

skaz

Last Updated April 27, 2017 19:02 PM

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?

Answers 8

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

Updated on 13/March/2014: Corrected the use of the incorrect /media/cdrom path. Please note that the screenshots date from 2010 and are probably out of date.

Shared folders is a nifty way that VirtualBox allows guest operating system to access files stored on your host system. I find it very convenient to share my host’s download directory with my guest servers. So that way I do not need to type out long, sometimes cryptic URLs for software downloads packages I might want to install onto my guest systems.

In this example I will be creating a shared folder within VirtualBox that will link my c:\users\ben\downloads directory with one on the Linux box.
cd
Now let’s start;

Within VirtualBox, select the guest machine you wish to contain the shared folder.

Press the Settings button.

In the Settings dialog, press Shared Folders tab. Click the Add Shared Folder button. In the popup dialog, select the directory you want to share with the guest...
0 0
4

I know this is not strictly a question about programming but I need to mount the shared folder in order to continue my coding.

I've got a Windows 7 OS with a guest Ubuntu 12.04 OS inside VirtualBox.

I have been trying to mount a shared folder created in VirtualBox. The virtual folder is basically the C:\ file system on Windows 7. In VirtualBox the shared folder appears as:

Folder Path: C:\

Folder Name: Windows7

# sudo mount -t vboxsf Windows7 /windows7

But the VirtualBox shared folder filesystem type is not recognized by the "mount" command. The error I get is:

mount: unknown filesystem type 'vboxsf'

Conversely, if I try it from the DOS prompt I also get an error after a long pause:

> net use x: \\vboxsvr\Windows7

(the error which is in my locale basically says: it is impossible to find the network path).

So, what should I do. I've been able to do this operation in the past a previous version of Ubuntu and VirtualBox by...

0 0
5

we have shown you how to access shared folder in VirtualBox with Linux host and Windows guest. If you want to access shared folder in Ubuntu guest (running Ubuntu as virtual machine), here is how you can do so.

1. In VirtualBox, select the Ubuntu VM and go to “Settings -> Shared Folders”. Select the local folder that you want to share with the Linux VM.

2. Boot into the Ubuntu VM. Open the file manager and navigate to the “/media” folder. You should see the shared folder with a “sf_” prefix.

3. Now when you try to access it, it will give you a “you do not have the permission necessary to view the contents of…” error. The trick to fix this is to add yourself to the “vboxsf” group.

Open a terminal and type:

Replace “username” with your login username.

4. Restart the Ubuntu VM. This time, you should be able to access the shared...

0 0
6

The regular way of getting access to the files now, is to allow VirtualBox to automount the shared folder (which will make it show up under /media/sf_directory_name) and then to add your regular Ubuntu user to the vboxsf group (as root #).

# usermod -aG vboxsf

By default, without manual action, the mounts look like this,

drwxrwx--- 1 root vboxsf 40960 Oct 23 10:42 sf_

so the vboxsf group has full access. By adding your user to that group, you gain full access. So you wouldn't worry about changing their permissions (which don't make sense on the Windows host), you just give yourself access.

In this specific case, this is the automounted Shared Folder,

Ubuntu 214153212 31893804 182259408 15% /media/sf_Ubuntu

and it is that directory that should be used to access to the Shared Folder, by putting the local user into the vboxsf group. If you want a 'better' link under your user's home directory, you could always create a symbolic link.

ln -s...
0 0
7

If you use VirtualBox in your data center, you've probably run into a situation where you needed to move a file from guest to host or vice versa. When you can't figure that out, you wind up having to use Dropbox or some other third-party solution. You don't have to.

VirtualBox has the ability to share folders between guest and host to make moving files back and forth much more efficient. Although there are a few steps involved, it doesn't take long to set up. Let's do just that.

SEE: Virtualization Policy (Tech Pro Research)

Installing the Guest Additions

First, you must install the Guest Additions. Without installing this software, your guest will not be able to recognize the necessary vboxsf file system, thus rendering your guest/host unable to share folders.

The steps for installing the Guest Additions will vary depending upon the host operating system. I'll demonstrate how to do this using a Ubuntu Linux 16.04 host. Here are the steps.

...
0 0
8

I am writing to ask what the effect of the auto-mounting process is in VirtualBox, and where the folders can be accessed within a guest Linux system if auto-mount is used.

I have VirtualBox 4.0.4 installed on Mac OS 10.6.7, with Guest Additions apparently running correctly. The guest OS is Ubuntu 10.04, and I observe no apparent problems with it. I find that if the shared folders have "auto-mount" unchecked in the VirtualBox settings, they can then be mounted using the prescribed syntax

sudo mount -t vboxsf folder_name path_to_mount_point

and all works as it is supposed to.

But if the auto-mount option is checked, then I find that I can no longer mount the shared folders manually. I get the error

mounting failed with the error: Invalid argument

and the folders also do not appear to mount anywhere else accessible to me. Using the syntax

sudo mount -t vboxsf

without specifying a path installs them in /media, with their names prefixed with sf_, but...

0 0
9

Last night I was trying to get shared folders working using VirtualBox. I have the host as Ubuntu 12.04 and a guest using Ubuntu 11.04. For the life of me I couldn’t get them to work. I followed the instructions on installing the Linux Guest Additions from VirtualBox’s site and set up shared folders the same way many tutorials/blogs suggested, but every time I went to mount the shared folder I would get this error:

/sbin/mount.vboxsf: mounting failed with the error: No such Device

I finally found a post explaining that the issue was the installation of modules while installing the Guest Additions. VirtualBox’s website instructs to install just dkms before running the Guest Additions script, but this was incorrect. One indication that this is the issue is to run ls mod | grep vbox. You shouldn’t see vboxsf.

In order to build the modules necessary for shared folders, the following three packages need to be installed before running the Guest Additions installation...

0 0
10

If you want to share a folder between your host machine and your virtual machine, this is the right post for you.

If you are wondering how to see in Ubuntu (guest) your shared folders you need to do the following steps:

In VirtualBox select your virtual machine (Ubuntu), click on settings, go to Shared Folders and add one folder from your host machine (physical machine).

Well, the next thing is start your Ubuntu VM (Virtual Machine). You need to install the Guest Additions tools if you don’t have already installed.

Create a new folder inside of mnt, in this case I called winhost (you can name it as you prefer), type the following command in a terminal:

sudo mkdir /mnt/winhost

Now you need to mount the shared folder in the new folder (created above).

sudo mount.vboxsf Shared /mnt/winhost

Notice that Shared is the name of the folder that I’ve selected in host system.

If you go to winhost...

0 0
11

On Thu, Dec 8, 2011 at 8:40 AM, Colin Law

[hidden email]

> wrote:

>

> I hope someone can help with mounting shared folders in VirtualBox

> (4.1.2). I am using this for the first time, running a Precise

> virtual machine in Ubuntu 11.10 host. I have installed the Guest

> Additions which seem to be working ok except that I cannot get shared

> folders to work.

> In the guest os I added the user to group vboxsf.

> In Devices > Shared Folders I added a share with path /home/colinl

> (which is on the host) named it host_colinl, checked Auto mount and

> Make Permanent.

> I re-booted the guest.

> I see that it has correctly created the folder /media/sf_host_colinl

> but it shows as empty (even with sudo) and in nautilus it does not

> show the mounted icon on the folder.

> I removed the share from Devices > Shared Folders and added a new one

> with a different path and...

0 0
12
Sponsored Link

This tutorial will explain How to access windows host shared folders from ubuntu guest in Virtualbox.


Procedure to follow

Step 1 : Install Guest Additions

You can install Guest Additions from From the VirtualBox's menu Devices ? Install Guest Additions...

This will mount a virtual CD on your /media/cdrom.Now open terminal (Applications menu -> Accessories -> Terminal) and run the following command

sudo sh VBoxLinuxAdditions-x86.run

After completing installation you need to restart your virtualbox guest machine

Step2: Define Share folders

From the VirtualBox's menu go to Devices ? Shared Folders

A dialog will show up as below. In this dialog you can specify which folder from your Windows system you want to share with your Ubuntu system.Press the button with the + symbol to add a new shared folder in the list.

You will have to specify a Folder Name for each folder you add.You...

0 0
13

After released a post on installing VirtualBox guest additions on Ubuntu 10.10, a question asked about shared folders, which I didn’t check that time. It is one of the feature should work after guest additions installation on guest with any host Operating Systems. This is the time to post a small guide shows how to set up VirtualBox shared folders in Ubuntu 10.10 guest with Windows 7 host or any Windows OS.

Yes, it’s important to transfer data between Linux ubuntu guest and any host OS. As of today, VirtualBox does not support latest Ubuntu 10.10 as guest officially, so installing guest additions is not straight forward. Our earlier post on installing guest additions worked for all users to get more screen resolutions, seamless and full screen mode with mouse integration. Let me show how to use the same packages to setup shared folders and easily transfer data between virtual machine and physical computer.

Follow the Steps to Configure VirtualBox Shared Folders in...

0 0
14

THE ISSUE

I installed vagrant on Windows 10 so I can create a personal local development environment in a virtual machine. Everything I've read about Vagrant said I can even spin up multiple systems and test communication between them with NAT port forwarding. But first, I just want to get one development environment virtual machine created before I go too far with the rest of it.

I installed VirutalBox, Vagrant, PuTTy, and PuTTYGen, per this SitePoint tutorial: https://www.sitepoint.com/getting-started-vagrant-windows/. Next I created a vagrant project folder on C: drive, did vagrant init, deleted the Vagrantfile, and finally, vagrant init ubuntu/trusty64. Then I did vagrant up, but the process failed with the error:

Vagrant was unable to mount VirtualBox shared folders. This is usually because the filesystem "vboxsf" is not available. This filesystem is made available via the VirtualBox Guest Additions and kernel module. Please verify that these guest...

0 0
15

VirtualBox is a powerful virtualization product that allows an unmodified operating system with all of its installed software to run in a special environment, on top of your existing operating system. Since I became a full time independent software developer, I have frequently found myself working on very different software environments. VirtualBox has helped me to setup an environment for each of my clients and easily manage them.

In this tutorial, I will show you how to setup a virtual machine instance with shared folders and SSH from your host to the guest. This tutorial assumes you have already setup an Ubuntu server virtual machine.

SSH from Host into Guest Machine Setup:

SSH is a protocol used to securely log onto remote systems. It is the most frequent way to access remote Unix-like servers.

Instructions:

Start the VMGo to Settings > Network > Advanced > Port ForwardingClick in the...
0 0
16

Setup Virtualbox Shared Folders Ubuntu 10.04

Diy Computer Repairs will show you how to use the Ubuntu 10.04 Virtualbox Shared Folders. when they install Ubuntu 10.04 operating system inside the Virtual Box free software, with screen shots. For example, if you are not confident of using Ubuntu totally, you can install Ubuntu inside Virtual Box software first. Fool around with this alien Operating System and get the hang of it before you get real. Being able to transfer files in and out is very important, since sometimes, you really want to test a file or a movie inside Ubuntu when it is running inside the Virtual box free software. For those who do not know what I am talking about, you can read up about Virtual Box fre software here.

By now, you should have installed Ubuntu operating system and already have it running inside of Virtual Box free software. The first step after you have installed Ubuntu operating system is to always, always and always reload the...

0 0
17

VirtualBox has a feature where a folder on the host machine can be shared with a guest VM. VirtualBox can also mount these shared folders automatically when the user logs into the guest OS. For Linux guests, these auto-mounted shared folders are mounted into the /media directory, along with the prefix sf_. For example, the shared folder sharedfiles will be mounted to /media/sf_sharedfiles.

As only the user group vboxsf is granted permissions to the auto-mounted shared folders, you’ll need to add your user to the group to access the shared folder. Otherwise you’ll get a “Permission denied” error when trying to navigate to the shared folder.

sudo gpasswd -a username vboxsf

Make sure you log out of the guest OS, then log in again for the group membership to take...

0 0
18

Enabling Symlinks (optional)

If you need Symlinks in your guest, run this command before you start your VM. This gotcha was a pain. Switch out "webroot" for your share's name, and VM_NAME for the actual name you give your VM.

VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/webroot 1

Start & Prep Your VM

Start your VM, log in via SSH, and then:

insert the Guest Additions CD image (Devices > Insert Guest Additions CD image in the menu)mount the CD with: sudo mount /dev/cdrom /media/cdrombefore we can install what's on the CD, we need to build a few requirements: sudo apt-get install -y dkms build-essential linux-headers-generic linux-headers-$(uname -r)now we can use what's on the CD, install with: sudo /media/cdrom/VBoxLinuxAdditions.run

Because you are on Ubuntu Server, it'll crap out at the last step where it tries to install X11 dependencies - but don't worry about it - it'll still work. (Could not find the X.Org or...

0 0
19

From VirtualBox’s guest machines you can directly access the host computer shared folders. This is made possible by VirtualBox host folder sharing feature. With shared folders, you can easily share files among virtual machines and the host computer. Folder sharing exposes the host computer files and folders to the virtual machines.

To use shared folders, you must have the current version of VirtualBox Guest Additions… installed on the guest operating system and you must configure your guest machines settings to specify which directories are to be shared.

This brief tutorial shows students and new users how to enable VirtualBox host folder sharing so guest machines can directly access folders shared on the host computer. Without this folder sharing feature, it would be very difficult getting huge files or folders to the guest machine.

With it, all you have to do is share the folder to the guest machine and from the virtual machine access the folder content...

0 0
20

I have some issues with Vagrant shared folders, my base system is Ubuntu 13.10 desktop.

I do not understand why I have this error is something that is not right configured ? Is a NFS issue or Virtualbox Guest Additions ? I have tried with different many boxes but the same issue.

Failed to mount folders in Linux guest. This is usually because the "vboxsf" file system is not available. Please verify that the guest additions are properly installed in the guest and can work properly. The command attempted was: mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` /vagrant /vagrant mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` /vagrant /vagrant

Here is the complete process after vagrant up :

$ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'u131032'... ==> default: Matching MAC address for NAT networking... ==> default: Setting the name of the VM:...
0 0
21

VirtualBox is an Open Source x86 and AMD64/Intel64 virtualization product. Using VirtualBox you can install many x86 32bit and 64bit operation systems in a virtual machine. The computer that you install VirtualBox on is commonly called the host machine and the virtual machine is called the guest machine. You can find out more about VirtualBox and download the software from http://www.virtualbox.org

This document will detail how to share a folder residing on the host machine with the guest. This document assumes VirtualBox is already installed on the host and a guest VM with Linux has been created with the Guest Additions installed.

Creating the Shared Folder

If you have more than one virtual machine created select the VM that you wish to set up the shared folder and then click the Settings gear.

On the VM Settings page, click the Shared Folders section.

On the Shared Folders settings page there is a green folder with a plus on the...

0 0
22

Add the shared folder to the virtual machine using vBox graphical interface Make sure to select automount and make permanent

Login to the virtual machine using a root account

Check vboxsf group exists

~$ grep vboxsf /etc/group vboxsf:x:125:

Check user is not already in vboxsf group

~$ id nilo uid=1000(nilo) gid=1000(nilo) groups=1000(nilo),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare)

Add user nilo to vboxsf group

~$ sudo usermod -a -G vboxsf nilo

Check again user groups

~$ id nilo uid=1000(nilo) gid=1000(nilo) groups=1000(nilo),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare),125(vboxsf)

Reboot and login as nilo

Shared folder is now accesible in /media/sf_dropbox (dropbox is the name I gave to the...

0 0
23
...
0 0
24

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

0 0
25

Ubuntu 16.04.

In the comments to the question there are a bit confusing but useful links.

Same exact problem solved by purging 5.2.8 and installing 5.1.34_Ubuntu r121010 from repo:

$ grep virtualbox /etc/apt/sources.list deb https://download.virtualbox.org/virtualbox/debian xenial contrib

Installation of guest additions completed without "VirtualBox Guest Additions: modprobe vboxsf failed" error.

sudo purge virtualbox* sudo apt-add-repository "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - sudo apt-get update sudo apt-get install virtualbox

Thanks to Justin for the link https://askubuntu.com/a/846142 but had to use

sudo apt-get install VirtualBox

rather than

sudo apt-get install VirtualBox-*

cause the last one gave me a whole mess of tricky unmet...

0 0
26

You have to mount your folder on your VM.

First you need to install Guest Additions (although I already did this during the installation).

Start your VM Devices > Insert Guest Additions CD image... I had to manually mount the CD: sudo mount /dev/cdrom /media/cdrom Install the necessary packages: sudo apt-get install make gcc linux-headers-$(uname -r) Install the Guest Additions: sudo /media/cdrom/VBoxLinuxAdditions.run

Now you can mount your share using:

mkdir ~/new sudo mount -t vboxsf New ~/new

Where New is the name of your shared folder.

Now you can access the shared folder at ~/new.

Note: this is not permanent. To permanently mount your folder you should add the following line to /etc/fstab (sudo nano /etc/fstab):

New /home/user/new vboxsf defaults 0 0

Obviously you should replace user in /home/user/new by your own...

0 0