Skip to content
This repository has been archived by the owner on Feb 13, 2023. It is now read-only.

Guest additions sometimes fail to be detected #175

Closed
benjy opened this issue Jul 15, 2015 · 6 comments
Closed

Guest additions sometimes fail to be detected #175

benjy opened this issue Jul 15, 2015 · 6 comments
Labels

Comments

@benjy
Copy link

benjy commented Jul 15, 2015

In using this VM between half a dozen projects I've found that after some time a project that I halted with "vagrant halt" can no longer start, the error is while mounting the shared folders.

I did some Googling and that's related to the VM guest additions. I can confirm right above, that when it fails it also no longer detects the guest additions.

Any thoughts?

Relevant output:

==> drupalvm-devblog: Checking for guest additions in VM...
    drupalvm-devblog: No guest additions were detected on the base box for this VM! Guest
    drupalvm-devblog: additions are required for forwarded ports, shared folders, host only
    drupalvm-devblog: networking, and more. If SSH fails on this machine, please install
    drupalvm-devblog: the guest additions and repackage the box to continue.
    drupalvm-devblog:
    drupalvm-devblog: This is not an error message; everything may continue to work properly,
    drupalvm-devblog: in which case you may ignore this message.
==> drupalvm-devblog: Setting hostname...
==> drupalvm-devblog: Configuring and enabling network interfaces...
==> drupalvm-devblog: Exporting NFS shared folders...
==> drupalvm-devblog: Preparing to edit /etc/exports. Administrator privileges will be required...
Password:
==> drupalvm-devblog: Mounting NFS shared folders...
==> drupalvm-devblog: Mounting shared folders...
    drupalvm-devblog: /vagrant => /Users/benjy/Sites/devblog
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

The error output from the last command was:

stdin: is not a tty
/sbin/mount.vboxsf: mounting failed with the error: No such device
@benjy
Copy link
Author

benjy commented Jul 15, 2015

I resolved this with the following command:

vagrant plugin install vagrant-vbguest

I can't explain why it was working for so long, and why it randomly occurred or why it temporarily went away if i vagrant destroyed and re-provisioned.

I'll leave this open in case it comes back otherwise we can prob close in a few days.

@geerlingguy
Copy link
Owner

That plugin is the shotgun approach to fixing the issue, but it works, so we may want to note it in documentation somewhere.

Since I'm on VMWare Fusion, I don't see that issue anymore, but I do remember hitting it every now and then on VirtualBox. I would have to restart my computer entirely for virtualbox to start functioning properly again.

The only other possibility is that the version of VirtualBox you're running is much different than 4.3.28 (or .26... whatever was latest before 5.0.0). What version do you have installed? It has to be close for Vagrant and VirtualBox to get along properly.

@geerlingguy
Copy link
Owner

Also, one other thing to check: make sure you have the latest version of the base box (e.g. geerlingguy/ubuntu1404) installed.

Run vagrant box update and see if it pulls down a newer box version (than destroy and up again to rebuild the VM on this newer box version. Older box versions had some issues with HGFS on VMWare Fusion, and guest additions on VirtualBox.

@benjy
Copy link
Author

benjy commented Jul 18, 2015

I'm on version 4.3.28r100309 for VirtualBox and ubuntu1404 box as you suggest.

Can you explain what's "shotgun" about that approach? Mainly just so I know if it's going to get me into trouble down the line?

@geerlingguy
Copy link
Owner

It's not shotgun in a negative way—just in a way that covers up any errors in the actual Vagrant box itself. If you have an older version of one of my boxes, then it probably didn't have the guest additions installed correctly. And if you're using some other box, it might not include the guest additions at all.

The plugin makes sure they're present and working, which is good, but it masks the problem of an outdated base box a little, and it also makes the process of building a new VM take a little longer (usually only a few seconds, but still, every second counts!).

@ezmiller
Copy link

ezmiller commented Mar 6, 2016

I've struggled with this issue a lot as well. And the plugins solution is troublesome as it causes some of my vagrants to hang when I'm provisioning them. Does anyone know of a canonical solution to this problem?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants