Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vagrant can't mount shared folder in VirtualBox 4.3.10 #3341

Closed
wsouto opened this issue Mar 27, 2014 · 152 comments
Closed

Vagrant can't mount shared folder in VirtualBox 4.3.10 #3341

wsouto opened this issue Mar 27, 2014 · 152 comments

Comments

@wsouto
Copy link

wsouto commented Mar 27, 2014

I got VirtualBox updated to 4.3.10 via ppa last night (which I'll downgrade to 4.3.8 and disable this PPA so I can manually control upgrades) and Vagrant is failing to mount shared folder with this new version. The guest additions was upgraded too in an already working VM, I also tried to install it in a new VM with no previous guest additions installed but no success...

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 80 => 8080 (adapter 1)
    default: 3000 => 3000 (adapter 1)
    default: 5432 => 5432 (adapter 1)
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Error: Connection timeout. Retrying...
==> default: Machine booted and ready!
GuestAdditions 4.3.10 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /home/wsouto/Projetos/printo
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
$ lsmod
Module                  Size  Used by
vboxsf                 42558  0 
vesafb                 13500  1 
nfsd                  247847  2 
auth_rpcgss            48552  1 nfsd
nfs_acl                12733  1 nfsd
nfs                   156370  0 
microcode              18894  0 
lockd                  78549  2 nfs,nfsd
sunrpc                230213  6 nfs,nfsd,auth_rpcgss,lockd,nfs_acl
fscache                55868  1 nfs
vboxguest             219348  2 vboxsf
ahci                   25579  2 
libahci                26619  1 ahci

It is a problem with VB 4.3.10 for sure, but I'm reporting here to others can know about this issue.

@jbernard
Copy link

Some additional info: In dmesg you'll see a lot of sf_read_super_aux = -71. This error is generated from the vboxsf kernel module on the guest. It breaks on a Debian 7.4 guest with a 3.2.0 kernel, but not on a Fedora 20 guest with a 3.13 kernel. I suspect there's a bug in the guest modules code but I don't have time to look any further at the moment.

I don't see any mention of this on Virtualbox's Trac, that might be a good place to start.

@babumuralidharan
Copy link

Try giving gem install vagrant-vbguest and then do an up command to see if your problem goes away

@pcfens
Copy link

pcfens commented Mar 28, 2014

@babumuralidharan I tried installing that just to be sure, and it didn't make a difference. As @jbernard mentioned, it seems like it's a bug in VirtualBox rather than in Vagrant.

I created vagrant boxes with Ubuntu 12.04, 13.10, and 14.04 and all of them worked fine when v4.3.8 of guest additions were installed, and all failed when v4.3.10 of guest additions were installed. All were running under VirtualBox 4.3.10 on a Linux host.

I submitted a bug report to VirtualBox's trac since there wasn't already one there.

@babumuralidharan
Copy link

@pcfens guess you did vagrant destroy and then installed this gem and did vagrant up right? it's an issue with virtual box as it needed some guest additions.

@boekkooi
Copy link

Quick fix is to do the following in the guest:

sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions

This solution was provided in https://www.virtualbox.org/ticket/12879 so it's not a vagrant bug

@analytik
Copy link

Thanks @boekkooi - that helped.

@japiber
Copy link

japiber commented Mar 28, 2014

Thanks @boekkooi - Now it´s working

@wsouto
Copy link
Author

wsouto commented Mar 28, 2014

@babumuralidharan what do you mean with gem install vagrant-vbguest? vagrant-vbguest is a plugin and it's installed. The output of vagrant up reported above shows it saying that the guest additions is running...

Thanks @boekkooi for found this fix in the VB issues and report it here.

I'm closing this issue since it's a problem with VB. I'm glad that this has led to a solution anyway.
I hope VB fixes that so we don't need to mind with this symbolic link anymore, it's not a big deal tho...

@wsouto wsouto closed this as completed Mar 28, 2014
@Neo23x0
Copy link

Neo23x0 commented Mar 28, 2014

major feature not working ... awesome

@leopoiroux
Copy link

Thanks @boekkooi - Now it´s working

@renanvaz
Copy link

Fix Step by step:

If you not have vbguest plugin, install it:

$ vagrant plugin install vagrant-vbguest

Run Vagrant

It is show a error.

$ vagrant up

Login on VM

$ vagrant ssh

Fix!

In the guest (VM logged).

$ sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions

Back on the host, reload Vagrant

$ vagrant reload

@paparomeo
Copy link

For commodity all in a single command line:

vagrant up; vagrant ssh -c 'sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions'; vagrant reload

@dmourati
Copy link

dmourati commented Apr 1, 2014

What about 64 bit guests? For me, I needed:

sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib64/VBoxGuestAdditions

@christofferholmstedt
Copy link

@dmourati are you sure that you needed that one? ...I have a precise 64 guest and I didn't need the lib64 path. Also note that the bug report for virtualbox at https://www.virtualbox.org/ticket/12879 is about a saucy 64 guest system with a non-lib64 path in the workaround.

For me @renanvaz step-by-step workaround worked like a charm.

@dmourati
Copy link

dmourati commented Apr 1, 2014

@christofferholmstedt, yes. VirtualBox 4.3.10 broke all my existing Ubuntu 12.04 64 bit VMs. I was already running the vagrant-vbguest. Destroy'ing the vms seems to put the guest additions in the right place.

Also seeing this error:

Could not find the X.Org or XFree86 Window System, skipping. An error occurred during installation of VirtualBox Guest Additions 4.3.10. Some functionality may not work as intended. In most cases it is OK that the "Window System drivers" installation failed.

@christofferholmstedt
Copy link

@dmourati the key part is if you needed the "lib64" path or only the "lib" path. As the "lib" path was enough for me.

@dmourati
Copy link

dmourati commented Apr 1, 2014

64 was needed for my existing vms

@jmacd3
Copy link

jmacd3 commented Apr 1, 2014

Thanks @boekkooi! Super helpful.

@hkim823
Copy link

hkim823 commented Apr 1, 2014

@dmourati @christofferholmstedt i did not need to use lib64 for my precise64 vm but I also don't X11

@skratchdot
Copy link

Thanks @boekkooi - the fix you posted worked for me as well

@yveshwang
Copy link

Here's an alternative approach to the one liner symlink fix. This is based on the fixed VBoxGuestAdditions ISO as outlined in https://www.virtualbox.org/ticket/12879

Essentially boils down to copying the fixed ISO to the VirtualBox folder and letting vbguest plugin do its usual magic.

wget https://www.virtualbox.org/download/testcase/VBoxGuestAdditions_4.3.11-93070.iso
sudo cp VBoxGuestAdditions_4.3.11-93070.iso /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso

voila. works for all ubuntu vms.

@wsouto
Copy link
Author

wsouto commented Apr 4, 2014

vbguest plugin here are not happy with version mistmatch between host (4.3.10) and guest additions (4.3.11) and by doing like so, I mean, copying the new guest additions over the old one, everytime you vagrant up the vbguest plugin will recompile the modules.

Maybe, for now, or until a new version of VirtualBox comes out, the best and simple way to handle this is symlinking the directory.

@darrenmonahan
Copy link

If you continue to get this message on Windows after fixing up your guest additions, it may be related to missing NFS support. Using vagrant-winnfsd currently doesn't work (at least for me) with Vagrant 1.5.1, but may with Vagrant 1.4.3.

@kevinmeredith
Copy link

Using Vagrant 1.3.5I tried @renanvaz's fix with both
sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions

and

sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib64/VBoxGuestAdditions

on separate runs, but I'm still getting the following when running vagrant reload running either of those commands:

[default] -- /vagrant
Failed to mount folders in Linux guest. This is usually beacuse
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

@renanvaz
Copy link

@kman007us what is the box you are using?
Have you installed vagrant vbguest plugin?

gmacario added a commit to gmacario/vagrant-ubuntu1404 that referenced this issue Apr 20, 2014
See hashicorp/vagrant#3341

This should fix a known issue of VirtualBox 4.3.10

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
@TheMetalCode
Copy link

I'm experiencing this today with Vagrant 1.8.1 and Virtualbox 5.0.14, right out of the blue. No solution listed here has helped so far.

@unfulvio
Copy link

unfulvio commented Mar 4, 2016

hey found out that the issue for me was the number of shared folders

I was working at a setup with over 70 mounted folders - this will trigger that error with VirtualBox 4 or 5 if you use vboxsf - I switched to NFS and the problem solved

it was hard to pin down since the error wasn't pointing in this direction

@towens
Copy link

towens commented Mar 4, 2016

The important lines that consistently work for us...
In the Vagrantfile

config.vm.provision "shell", path: "cloud_init.sh"
config.vbguest.auto_update = false

In the shell provisioning script

yum update -y
yum install -y kernel-devel.x86_64

Back to the Vagrantfile
config.vbguest.auto_update = true then vagrant reload
Which should get the guest additions on track. Then, one more time
config.vbguest.auto_update = false then vagrant reload

As mentioned ☝️ having the kernel development headers installed before anything else is the trick. Installing the guest additions and syncing folders after has been working on CentOS 6.6 - 7.1.

@TheMetalCode
Copy link

In my case it was exactly the number of folders being synced. Thanks @unfulvio!

@creamdog
Copy link

creamdog commented Mar 7, 2016

Encountered this problem with Windows 7, Vagrant 1.8.1 and Virtualbox 5.0.14 and launching Ubuntu/Trusty64

Fixed when updating to Virtualbox 5.0.16

@ghost
Copy link

ghost commented Mar 8, 2016

I'm getting this, tried so many solutions.

Ubuntu 15.10 / Vagrant 1.8.1 / Virtualbox 5.0.16
ubuntu/wily64

mesg: ttyname failed: Inappropriate ioctl for device


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 www-data | cut -d: -f3`,dmode=775, fmode=664 vagrant-B05032-Magento-Box /vagrant-B05032-Magento-Box
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g www-data`,dmode=775, fmode=664 vagrant-B05032-Magento-Box /vagrant-B05032-Magento-Box

vagrant vbguest --status

GuestAdditions 5.0.16 running --- OK.

In vagrant ssh I did

sudo ln -s /opt/VBoxGuestAdditions-5.0.16/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions

I replaced VBoxGuestAdditions.iso in tmp

Copy iso fileC:\Program Files/Oracle/VirtualBox/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso

Still unsolved.
Somebody has solution, plz?

@gkollengode
Copy link

Tried all the fixes and none of them worked. This is what has worked for me finally

CentOS release 6.7 box

vagrant ssh
wget  ftp://ftp.pbone.net/mirror/dl.central.org/dl/linuxdev/centos6/x86_64/kernel-devel-2.6.32-431.3.1.el6.x86_64.rpm
sudo yum install kernel-devel-2.6.32-431.3.1.el6.x86_64.rpm -y
wget http://download.virtualbox.org/virtualbox/5.0.4/VBoxGuestAdditions_5.0.4.iso
sudo mount -o loop VBoxGuestAdditions_5.0.4.iso /mnt
sudo /mnt/VBoxLinuxAdditions.run

logout and
vagrant reload

Hope this helps

@abgaryanharutyun
Copy link

@voltol +1

@gordienkotolik
Copy link

gordienkotolik commented Apr 26, 2016

@voltol same on VirtualBox-5.0.18 and 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:

PASSWORDHIDDENmPASSWORDHIDDENoPASSWORDHIDDENuPASSWORDHIDDENnPASSWORDHIDDENtPASSWORDHIDDEN PASSWORDHIDDEN-PASSWORDHIDDENtPASSWORDHIDDEN PASSWORDHIDDENcPASSWORDH.........

The error output from the last command was:

stdin: is not a tty
mount error(95): Operation not supported
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

vagrant vbguest --status
GuestAdditions 5.0.18 running --- OK.

on guest VM:
ls -la /usr/lib/ | grep VBoxGuestAdditions
VBoxGuestAdditions -> /opt/VBoxGuestAdditions-5.0.18/lib/VBoxGuestAdditions
`

@czerasz
Copy link

czerasz commented May 25, 2016

I had issues mounting the /vagrant directory while using the vagrant-cachier plugin.
See more details here.

Host system: Ubuntu 16.04
Guest system: Ubuntu 14.04.3

@bickerstoff
Copy link

bickerstoff commented Jun 6, 2016

My setup is roughly LAMP stack with centos 6.4 from puphpet.com; I can give more details if it is desired. My error was similar to the initial post @wsouto made although it revolved around the user not existing.

Here is my error message:

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 www-data`,gid=`getent group www-data | cut -d: -f3`,dmode=775,fmode=774 vflsf_092515h4p5zx /var/www/html
mount -t vboxsf -o uid=`id -u www-data`,gid=`id -g www-data`,dmode=775,fmode=774 vflsf_092515h4p5zx /var/www/html

The error output from the last command was:

id: www-data: No such user
id: www-data: No such user
uid= requires an argument (i.e. uid==<arg>)

I changed the user to vagrant and the group to vagrant as I knew those would exist and was able to pass this issue. (Under synced_folder in config.yaml if you are using puphpet.com's setup)

@srecloud
Copy link

Thanks hjianhao . Your solution worked out for me

@hao203
Copy link

hao203 commented Oct 4, 2016

very good

@christianbueno1
Copy link

I had the same problem in VirtualBox 5.1.16
My Os: Windows 10
vagrant version: 1.9.2
box: ubuntu/trusty32
I am working with a vagrant file provide by Udacity , in the course "Intro to Relational Databases".
I fixed that problem, uninstalling VirtualBox 5.1.16 and then install VirtualBox 5.1.14

vagrant-vbguest did not work for me and neither the command
$ sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions

@szeitlin
Copy link

szeitlin commented Mar 28, 2017

Same problem on VirtualBox 5.1.10
Vagrant 1.9.1
box: Ubuntu 14.04.5 (trusty)
OS: Mac 10.12.3 (Sierra)

Interestingly, I have a pre-existing Vagrant in another folder, for which symlinking seems to work just fine. The only difference I can easily see is that the box is different.

In my case, changing a configuration file or two (unrelated to any of this) and re-linking seems to have fixed it.

@claudiobizzotto
Copy link

claudiobizzotto commented Apr 25, 2017

Happened to me with version 5.1.20. Here's how I fixed it on my Ubuntu VM: gist

@Jalle19
Copy link

Jalle19 commented Apr 28, 2017

The Linux guest additions in VirtualBox 5.1.20 are indeed broken, see https://www.virtualbox.org/ticket/16670. I reverted to 5.1.18 to get work done.

@lokeoke
Copy link

lokeoke commented May 2, 2017

Had the same issue with VirtualBox 5.1.20. Now issue is fixed in VirtualBox 5.1.22 release.

@osmanddas
Copy link

As mentioned above, I got the issue resolved by installing vagrant-vbguest ($ vagrant plugin install vagrant-vbguest). Thanks a lot for sharing the solution.

FYI - I didn't face this issue until I had to use multiple vagrant boxes with a shared directory. Never faced it till I was using one virtual box at a time.

@alexandre1202
Copy link

The uninstall of vagrant does not delete %HOME_DIR%.vagrant.d but before install other version it is important you do it manually.
I also remove unused directories inside of %HOME_DIR%\VirtualBox VMs and %HOME_DIR%.VirtualBox

@jaap-stack
Copy link

Me on Windows running VirtualBox 5.2.6 and Vagrant 2.0.1

When trying to sync a folder, got the vboxsf error message. After performing "vagrant plugin install vagrant-vbguest" on the host the "vagrant up" command caused the VMs to boot nicely. They seem to be able to use the guest additions, building a VirtualBox Guest Additions kernel module.

@tlvu
Copy link

tlvu commented Jul 4, 2019

Still happen on VirtualBox 6.0.8 on Linux Ubuntu 18.04. Downgrade the VBoxGuestAdditions to 5.2.18 in my Ubuntu 18.04 VM works against my VirtualBox 6.0.8 host. Followed this gist for downgrade https://gist.github.com/claudiobizzotto/67dfcf66ebffca58b1075123c2e898f8.

@ghost
Copy link

ghost commented Jan 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests