Vagrant was unable to mount VirtualBox shared folders

Current setup: Virtualbox 5.1.20 with Vagrant 1.9.3

Previous working setup: Virtualbox 5.1.18 with Vagrant 1.9.3

I installed the latest version of Virtualbox and tried to start my virtual machine. Folder installation has stopped working. The same folder setting works fine in Virtualbox 5.1.18 . The following error message appears:

Vagrant was unable to install VirtualBox shared folders. This usually happens because the "vboxsf" file system is not available. This file system is available through VirtualBox guest add-ons and the kernel module. Make sure these guest add-ons are installed in the guest system. This is not a bug in Vagrant and is usually caused by a faulty Vagrant box. For context, the command tried:

mount -t vboxsf -o uid=1000,gid=1000 keys /keys 

The result of the error was the command:

 mount: wrong fs type, bad option, bad superblock on keys, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so. 

I tried to manually install the vagrant-vbguest plugin (via the vagrant-vbguest vagrant plugin install vagrant-vbguest ), but that didn't fix anything. Going to 5.1.18 allows it, but this is not an ideal forward movement.

How can I get the installation of folders working with Virtualbox 5.1.20 and Vagrant 1.9.3 ?

+63
vagrant virtualbox vagrant-plugin
Apr 19 '17 at 9:56 on
source share
7 answers

Refresh

Fixed in VirtualBox 5.1.22.

( https://www.virtualbox.org/ticket/16670 )

Original answer

In my case, the symbolic link inside the virtual machine was wrong. Log in to VM:

 $ vagrant ssh 

Then:

 $ ls -lh /sbin/mount.vboxsf lrwxrwxrwx 1 root root 49 Apr 19 14:05 /sbin/mount.vboxsf -> /opt/VBoxGuestAdditions-5.1.20/other/mount.vboxsf 

This link does not work. When you look inside /opt/VBoxGuestAdditions-5.1.20/, you see that the subfolder "other" does not exist. This line fixes this:

 $ sudo ln -sf /opt/VBoxGuestAdditions-*/lib/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf 

Now exit the VM:

 $ exit 

And check if it works for you:

 $ vagrant reload 

But I can’t fix the link because /sbin/mount.vboxsf does not exist inside my box!

If the link /sbin/mount.vboxsf does not exist in the first place, then VBoxGuestAdditions cannot be installed. This can happen if you did not download the corresponding VirtualBox extension pack after updating VirtualBox (v5.2.18 and higher should download it automatically during Virtualbox updates). You can do it now:

  • Stop all your running virtual machines.
  • Open the VirtualBox program.
  • Launch the VirtualBox extension package download and install it.
  • If you are not asked if you want to download the VirtualBox extension pack, open β†’ File β†’ Check for Updates to bring up the download dialog.

If there was no update for the VirtualBox extension, it is possible that VBoxGuestAdditions cannot be installed because the installer displays a message and the vagrant vbguest plug-in cannot request a response (this is β€œfixed” in vbguest v0.15.0 ). You can see this in the output of "vagrant up". There should be a line similar to this:

 Do you wish to continue? [yes or no] 

In this case, you can run the installer manually. To do this, run the window:

 $ vagrant up 

Then run vbguest to retry the installation, but then leave the mounted VBoxGuestAdditions ISO as follows:

 $ vagrant vbguest --do install --no-cleanup 

Enter the box:

 $ vagrant ssh 

Launched the installer manually:

 $ sudo /mnt/VBoxLinuxAdditions.run 

Last hope: do it yourself!

If none of the above helps, try installing the guest add-ons manually:

 cd /opt sudo wget -c http://download.virtualbox.org/virtualbox/5.1.28/VBoxGuestAdditions_5.1.28.iso -O VBoxGuestAdditions_5.1.28.iso sudo mount VBoxGuestAdditions_5.1.28.iso -o loop /mnt sudo sh /mnt/VBoxLinuxAdditions.run 
+117
Apr 19 '17 at 13:38 on
source share

Installing the vbguest plugin worked in my case with VirtualBox 5.2.6 and Vagrant 2.0.1:

vagrant plugin install vagrant-vbguest

+27
Feb 01 '18 at 18:01
source share

This worked for me ... follow these steps:

 vagrant plugin repair 

then

 vagrant plugin expunge --reinstall 

then

 vagrant reload 
+2
May 12 '18 at 23:29
source share

Type of removal: "nfs" from homestead.yaml fixed it for me. Win 10, Vagrant 1.9.7, laravel 5.4, manor.

+1
Aug 6 '17 at 0:03
source share

For me, the problem was fixed in the following conditions:

Wednesday:

  • VirtualBox version 6.0.4r128413
  • Wandering version 2.2.3

Steps:

Go to your project directory from the terminal or command line ( cd ) and run the following commands:

  1. vagrant plugin install vagrant-vbguest to install the Vagrant VB guest plugin

  2. vagrant up

If you get a vboxsf missing vboxsf . Then maybe your VirtualBox Guest Additions are not installed properly. We hope that the commands below will solve your problem.

 vagrant ssh sudo yum -y install kernel-devel sudo yum update -y exit vagrant halt vagrant up --provision 
+1
Mar 05 '19 at 11:06
source share

For me, the following commands, followed by a reboot of the guest system, helped:

 cd /opt/VBoxGuestAdditions-*/init sudo ./vboxadd setup 

I found a solution here . Referring to this message, you need to stop vboxadd before running the commands (I did not do this because I do not know what vboxadd is).

0
Dec 19 '17 at 12:50
source share

For those who land here with almost the same problem as me, below is the solution

TL; DR

  • Error guest system is currently not set up to build kernel modules VirtualBox due to system is currently not set up to build kernel modules
  • The solution is to remove kernel-headers.x86_64 0:3.10.0-862.9.1.el7
  • Then install kernel-devel-3.10.0-327.el7.x86_64

Decision

  1. vagrant ssh

  2. sudo rpm -e kernel-devel-3.10.0-862.9.1.el7.x86_64

  3. sudo wget ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/7.0/x86_64/updates/security/kernel-devel-3.10.0-327.el7.x86_64.rpm // upload a file

  4. sudo rpm -Uvh kernel-devel-3.10.0-327.el7.x86_64.rpm // use the file downloaded in step 3

  5. exit

  6. vagrant reload

Details: problem

  1. Do wander, but fail with a similar error, except

The result of the error was the command:

/sbin/mount.vboxsf: installation error with error: no such device

  1. Keep reading magazines and I noticed below keywords

Installing Virtualbox 5.2.16 Guest Add-Ons - Guest Version - 5.1.10

An error occurred while installing VirtualBox Guest Add-ons

This system is not currently configured to build kernel modules.

Please install the Linux kernel header files corresponding to the current kernel.

packages containing headers, probably: kernel-devel kernel-devel-3.10.0-327.el7.x86_64

  1. Read magazines further

The kernel-headers.x86_64 0: 3.10.0-862.9.1.el7 package will be installed

The kernel-devel-3.10.0-327.el7.x86_64 package is not available.

  1. My guest - I need kernel-devel-3.10.0-327.el7.x86_64 to work

Details: My environment

  • bento /CentOS-7.2
  • roaming version: 2.0.4
  • virtual box version: 5.2.16

sources

0
Aug 03 '18 at 12:01
source share



All Articles