Vagrant error when mount synced folder #6769

Closed
lisi4ok opened this Issue Dec 30, 2015 · 19 comments

Comments

Projects
None yet
@lisi4ok

lisi4ok commented Dec 30, 2015

Hi when i write vagrant up i got this error:

==> default: Mounting shared folders...
    default: /var/www => /home/user/vagrant/www

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` var_www /var/www
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` var_www /var/www

The error output from the last command was:

mount: unknown filesystem type 'vboxsf'

Here it is my Vagrantfile:

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.vm.box = "centos/7"

  config.vm.provider "virtualbox" do |v|
    v.name = "lisi4ok"
  end

  config.vm.network "private_network", ip: "192.168.33.22"

  config.vm.synced_folder "./www", "/var/www"

  config.vm.provision "shell", name: "provision", path: "provision.sh"

end

Here it is the screen:

http://i.imgur.com/Zt5zrGt.png

P.s. the machine is running but my provision scripts are not applied.

@sevengo8378

This comment has been minimized.

Show comment
Hide comment
@sevengo8378

sevengo8378 Jan 4, 2016

I get the same error, here is my environment.
Host: OSX 10.11.2
Guest: ubuntu/trusty64
VirtualBox and extension pack: v5.0.12 r104815
vagrant: 1.8.1

I get the same error, here is my environment.
Host: OSX 10.11.2
Guest: ubuntu/trusty64
VirtualBox and extension pack: v5.0.12 r104815
vagrant: 1.8.1

@sethvargo

This comment has been minimized.

Show comment
Hide comment
Contributor

sethvargo commented Jan 12, 2016

@Revisor

This comment has been minimized.

Show comment
Hide comment
@Revisor

Revisor Feb 12, 2016

@lisi4ok, @sevengo8378 How did you solve the problem?

Revisor commented Feb 12, 2016

@lisi4ok, @sevengo8378 How did you solve the problem?

@lisi4ok

This comment has been minimized.

Show comment
Hide comment
@lisi4ok

lisi4ok Feb 13, 2016

We didin`t :)

lisi4ok commented Feb 13, 2016

We didin`t :)

@aanm

This comment has been minimized.

Show comment
Hide comment
@aanm

aanm Feb 23, 2016

@sethvargo Same error here with vagrant-1.8.1-1.fc23.noarch. Version vagrant-1.7.4-2.fc23.noarch was working fine.

aanm commented Feb 23, 2016

@sethvargo Same error here with vagrant-1.8.1-1.fc23.noarch. Version vagrant-1.7.4-2.fc23.noarch was working fine.

@aanm

This comment has been minimized.

Show comment
Hide comment
@aanm

aanm Feb 23, 2016

@Revisor, @lisi4ok as a workaround I would suggest to add nfs: true. For example: config.vm.synced_folder '/home', '/home/vagrant', nfs: true

aanm commented Feb 23, 2016

@Revisor, @lisi4ok as a workaround I would suggest to add nfs: true. For example: config.vm.synced_folder '/home', '/home/vagrant', nfs: true

@alfiedotwtf

This comment has been minimized.

Show comment
Hide comment
@alfiedotwtf

alfiedotwtf Feb 28, 2016

I'm getting the same issue. Setting "nfs: true" didn't work either.

Edit: I should have read the following:

==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.

To repeat: Guest Additions are needed for shared folders

I'm getting the same issue. Setting "nfs: true" didn't work either.

Edit: I should have read the following:

==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.

To repeat: Guest Additions are needed for shared folders

@alfiedotwtf

This comment has been minimized.

Show comment
Hide comment
@alfiedotwtf

alfiedotwtf Feb 28, 2016

At the very least, I think https://www.vagrantup.com/docs/synced-folders/virtualbox.html should be updated to note that it's not going to work out of the box.

At the very least, I think https://www.vagrantup.com/docs/synced-folders/virtualbox.html should be updated to note that it's not going to work out of the box.

@sethvargo

This comment has been minimized.

Show comment
Hide comment
@sethvargo

sethvargo Feb 29, 2016

Contributor

Hi @alfiedotwtf

The Vagrant documentation for building boxes requires the base box install the virtualbox guest additions, so it should work just fine out of the box. Perhaps you are using a third-party box that did not properly install the guest additions? What version of Virtualbox are you using?

Contributor

sethvargo commented Feb 29, 2016

Hi @alfiedotwtf

The Vagrant documentation for building boxes requires the base box install the virtualbox guest additions, so it should work just fine out of the box. Perhaps you are using a third-party box that did not properly install the guest additions? What version of Virtualbox are you using?

@alfiedotwtf

This comment has been minimized.

Show comment
Hide comment
@alfiedotwtf

alfiedotwtf Feb 29, 2016

I'm on 1.6.5, from Debian Jessie non-free. The box I'm using is Hashicorp's debian/jessie64. Should I be using a different guest?

btw: thanks for helping out!

I'm on 1.6.5, from Debian Jessie non-free. The box I'm using is Hashicorp's debian/jessie64. Should I be using a different guest?

btw: thanks for helping out!

@sethvargo

This comment has been minimized.

Show comment
Hide comment
@sethvargo

sethvargo Feb 29, 2016

Contributor

Hi @alfiedotwtf

The latest version of Vagrant is 1.8.1 and is available from https://www.vagrantup.com/downloads.html. We do not recommend using the os packages because they are typically very out and contain and outdated version of Vagrant. Can you please try upgrading to Vagrant 1.8 and see if the issue persists?

Contributor

sethvargo commented Feb 29, 2016

Hi @alfiedotwtf

The latest version of Vagrant is 1.8.1 and is available from https://www.vagrantup.com/downloads.html. We do not recommend using the os packages because they are typically very out and contain and outdated version of Vagrant. Can you please try upgrading to Vagrant 1.8 and see if the issue persists?

@alfiedotwtf

This comment has been minimized.

Show comment
Hide comment
@alfiedotwtf

alfiedotwtf Mar 2, 2016

Thanks @sethvargo. Will try it out on the weekend and get back to you.

Thanks @sethvargo. Will try it out on the weekend and get back to you.

@gadelkareem

This comment has been minimized.

Show comment
Hide comment
@gadelkareem

gadelkareem Mar 8, 2016

Getting same here with debian/jessie64
vagrant --version
Vagrant 1.8.1

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` var_application /var/application
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` var_application /var/application

The error output from the last command was:

stdin: is not a tty
mount: unknown filesystem type 'vboxsf'

Getting same here with debian/jessie64
vagrant --version
Vagrant 1.8.1

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` var_application /var/application
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` var_application /var/application

The error output from the last command was:

stdin: is not a tty
mount: unknown filesystem type 'vboxsf'
@alfiedotwtf

This comment has been minimized.

Show comment
Hide comment
@alfiedotwtf

alfiedotwtf Mar 13, 2016

[FIXED]

@sethvargo pulling from upstream didn't fix the issue.

It looks like the issue was actually the guest and not the host. I was using "debian/jessie64" which didn't work with shared folders as the image did not include vboxsf. Switching to "debian/contrib-jessie64" fixed the issue (it seems obvious now):

debian/contrib-jessie64 - Vanilla Debian 8 "Jessie" build with contrib vboxsf kernel module

[FIXED]

@sethvargo pulling from upstream didn't fix the issue.

It looks like the issue was actually the guest and not the host. I was using "debian/jessie64" which didn't work with shared folders as the image did not include vboxsf. Switching to "debian/contrib-jessie64" fixed the issue (it seems obvious now):

debian/contrib-jessie64 - Vanilla Debian 8 "Jessie" build with contrib vboxsf kernel module
@syaifulsz

This comment has been minimized.

Show comment
Hide comment
@syaifulsz

syaifulsz Jun 29, 2016

This issue happen because vagrant box does not have VirtualBox Guest Additions installed. Just follow documentation here https://www.vagrantup.com/docs/virtualbox/boxes.html works for me.

I'm using vagrant box debian/jessie64.

sudo su -
apt-get install linux-headers-$(uname -r) build-essential dkms
wget http://download.virtualbox.org/virtualbox/4.3.8/VBoxGuestAdditions_4.3.8.iso
mkdir /media/VBoxGuestAdditions
mount -o loop,ro VBoxGuestAdditions_4.3.8.iso /media/VBoxGuestAdditions
sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run
rm VBoxGuestAdditions_4.3.8.iso
sudo umount /media/VBoxGuestAdditions
sudo rmdir /media/VBoxGuestAdditions

The documentation uses VBoxGuestAdditions_4.3.8 but the version depends on the version of your VirtualBox, mine is 4.3.36, so I changed it into VBoxGuestAdditions_4.3.36. Hope this help.

This issue happen because vagrant box does not have VirtualBox Guest Additions installed. Just follow documentation here https://www.vagrantup.com/docs/virtualbox/boxes.html works for me.

I'm using vagrant box debian/jessie64.

sudo su -
apt-get install linux-headers-$(uname -r) build-essential dkms
wget http://download.virtualbox.org/virtualbox/4.3.8/VBoxGuestAdditions_4.3.8.iso
mkdir /media/VBoxGuestAdditions
mount -o loop,ro VBoxGuestAdditions_4.3.8.iso /media/VBoxGuestAdditions
sh /media/VBoxGuestAdditions/VBoxLinuxAdditions.run
rm VBoxGuestAdditions_4.3.8.iso
sudo umount /media/VBoxGuestAdditions
sudo rmdir /media/VBoxGuestAdditions

The documentation uses VBoxGuestAdditions_4.3.8 but the version depends on the version of your VirtualBox, mine is 4.3.36, so I changed it into VBoxGuestAdditions_4.3.36. Hope this help.

Superbil added a commit to lowiki-org/localwiki-backend-server that referenced this issue Jul 24, 2016

Superbil added a commit to lowiki-org/localwiki-backend-server that referenced this issue Jul 24, 2016

Superbil added a commit to lowiki-org/localwiki-backend-server that referenced this issue Jul 24, 2016

Superbil added a commit to lowiki-org/localwiki-backend-server that referenced this issue Jul 24, 2016

New task fix_vbox to fix vm can't mount problem
from hashicorp/vagrant#6769

Install virtualbox guest additons and ignore error, because
X.Org isn't installed.

Superbil added a commit to lowiki-org/localwiki-backend-server that referenced this issue Jul 24, 2016

New task fix_vbox to fix vm can't mount problem
from hashicorp/vagrant#6769

Install virtualbox guest additons and ignore error, because
X.Org isn't installed.
@luvejo

This comment has been minimized.

Show comment
Hide comment
@luvejo

luvejo Oct 7, 2016

You can also install the vagrant-vbguest plugin so it adds the VirtualBox Guest Additions for you.

vagrant plugin install vagrant-vbguest
vagrant destroy && vagrant up

And that works for me.

luvejo commented Oct 7, 2016

You can also install the vagrant-vbguest plugin so it adds the VirtualBox Guest Additions for you.

vagrant plugin install vagrant-vbguest
vagrant destroy && vagrant up

And that works for me.

@maxiaoxiong

This comment has been minimized.

Show comment
Hide comment

@luvejo Thank you!!

@selukov

This comment has been minimized.

Show comment
Hide comment
@selukov

selukov Apr 22, 2017

I had the same problem when updated virtual machine to 5.1.20 and installed new VBoxGuestAdditions_5.1.20
The /sbin/mount.vboxsf became unavailable because
mount.vboxsf -> /opt/VBoxGuestAdditions-5.1.20/other/mount.vboxsf
/opt/VBoxGuestAdditions-5.1.20/other/mount.vboxsf -- Does not exist

I fix it:
ln -sf /usr/lib/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf

I think it would be fixed in new releases https://www.virtualbox.org/ticket/16670

selukov commented Apr 22, 2017

I had the same problem when updated virtual machine to 5.1.20 and installed new VBoxGuestAdditions_5.1.20
The /sbin/mount.vboxsf became unavailable because
mount.vboxsf -> /opt/VBoxGuestAdditions-5.1.20/other/mount.vboxsf
/opt/VBoxGuestAdditions-5.1.20/other/mount.vboxsf -- Does not exist

I fix it:
ln -sf /usr/lib/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf

I think it would be fixed in new releases https://www.virtualbox.org/ticket/16670

@rudeshko-treefrog

This comment has been minimized.

Show comment
Hide comment
@rudeshko-treefrog

rudeshko-treefrog Oct 4, 2017

For me two things fix the problem - One of them is @luvejo's comment above, and the other one is to use NFS:

Instead of
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=777"]
Use the following:
config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=666"] }

The first solution is cleaner though, it doesn't cause any warnings later on, but the second one is faster because in the first you'd have to back up your database, and other files you might have that are not shared on your computer.

For me two things fix the problem - One of them is @luvejo's comment above, and the other one is to use NFS:

Instead of
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=777"]
Use the following:
config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=666"] }

The first solution is cleaner though, it doesn't cause any warnings later on, but the second one is faster because in the first you'd have to back up your database, and other files you might have that are not shared on your computer.

@gdha gdha referenced this issue in gdha/rear-automated-testing Jan 30, 2018

Open

virtualbox: filesystem "vboxsf" is not available. #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment