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

No guest IP was given to the Vagrant core NFS helper with virtualbox 5.0.16 and dhcp #7138

Closed
gdelpierre opened this issue Mar 15, 2016 · 8 comments

Comments

@gdelpierre
Copy link

Vagrant version

Vagrant 1.8.1

Host operating system

Darwin Kernel Version 15.3.0

vboxmanage -v
5.0.16r105871

Guest operating system

Ubuntu 14.04.4 4.2.0-27-generic

modinfo vboxguest
filename:       /lib/modules/4.2.0-27-generic/updates/dkms/vboxguest.ko
version:        5.0.16
license:        GPL
description:    Oracle VM VirtualBox Guest Additions for Linux Module
author:         Oracle Corporation
srcversion:     6B7D24280DBF204B19C8E80
alias:          pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*
depends:
vermagic:       4.2.0-27-generic SMP mod_unload modversions

Vagrantfiles

  # Network
  config.vm.network "private_network", type: "dhcp"

  # Shared
  config.vm.synced_folder ".",
                          "/var/www/foo",
                          type: "nfs",
                          :nfs => true,
                          :mount_options => ['rsize=32768', 'wsize=32678', 'intr', 'soft',
                             'fg', 'timeo=5', 'nodev', 'noatime', 'nodiratime'],
                          :bsd__nfs_options => ['rw', 'all_squash', 'async', 'no_subtree_check']

Debug output

DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
 INFO subprocess: Starting process: ["/usr/local/bin/VBoxManage", "guestproperty", "get", "f6021183-e69e-4177-809a-b52719d56131", "/VirtualBox/GuestInfo/Net/1/V4/IP"]
DEBUG subprocess: Command not in installer, not touching env vars.
 INFO subprocess: Command not in installer, restoring original environment...
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: No value set!
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
 INFO retryable: Retryable exception raised: #<Vagrant::Errors::VirtualBoxGuestPropertyNotFound: Could not find a required VirtualBox guest property:
  /VirtualBox/GuestInfo/Net/1/V4/IP
This is an internal error that should be reported as a bug.>

[...]

ERROR warden: Error occurred: No guest IP was given to the Vagrant core NFS helper. This is an
internal error that should be reported as a bug.

but it actually works:

/usr/local/bin/VBoxManage guestproperty get f6021183-e69e-4177-809a-b52719d56131 /VirtualBox/GuestInfo/Net/1/V4/IP
Value: 172.28.128.4

Actual behavior

No guest IP was given to the Vagrant core NFS helper. This is an internal error that should be reported as a bug.

It works by allocating a static IP.

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

Thank you.

Best regards.

@richard-scott
Copy link

If you are trying to make a brand new VM when you run your first "vagrant up" the VirtualBox DHCP server does not know about your VM's MAC address and does not know what IP it will give it.

On your 2nd vagrant up, NFS should work fine with DHCP and no need to set a static IP.
(that's what I've found anyway)

@geerlingguy
Copy link
Contributor

I'm seeing this with a new Debian 9 Stretch base box that I'm using for Drupal VM. Steps to reproduce:

  1. Download Drupal VM (https://www.drupalvm.com)

  2. Create a config.yml file in the root directory, with the contents:

    vagrant_box: geerlingguy/debian9

  3. Run vagrant up (or for all the logs, VAGRANT_LOG=debug vagrant up).

Tested with Vagrant 1.9.3 and 1.9.5 and I can't get NFS shared folders to work. I have them working with my Ubuntu base boxes (tested recently), and also with my CentOS boxes. Could be something in the Packer config that builds the box, too... I'm not ruling that out (https://github.com/geerlingguy/packer-debian-9).

@geerlingguy
Copy link
Contributor

I was about to say I got the same thing, where it didn't work the first time but worked manually after:

$ /usr/local/bin/VBoxManage guestproperty get 66d8639d-686c-456e-b3dc-8c5f4dd8039b /VirtualBox/GuestInfo/Net/1/V4/IP
Value: 192.168.88.88

...but then I read through the logs a little more closely, and found that Vagrant was actually getting a value later:

DEBUG subprocess: stdout: Value: 192.168.88.88

But then NFS keeps timing out still:

 INFO retryable: Retryable exception raised: #<Vagrant::Errors::NFSMountFailed: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=3,udp 192.168.88.1:/Users/jgeerling/Dropbox/Development/GitHub/drupal-vm /var/www/drupalvm

Stdout from the command:



Stderr from the command:

mount.nfs: Connection timed out

If I run the mount command as sudo inside the VM manually, it times out there too. Even pinging the host (at the xx.xx.xx.1 address) from within the VM doesn't seem to be working, which makes it seem like a networking issue.

@geerlingguy
Copy link
Contributor

Ah, so the rabbit hole was a little deeper. A couple days ago, I had been testing some local Docker networking tricks to get some Docker containers accessible on certain IP addresses so I could access by hostname.

As part of that process, I had added a loopback alias on the same IP address I was using for the VM:

sudo ifconfig lo0 alias 192.168.88.88/24

So finally I remembered that, and deleted the alias (sudo ifconfig lo0 -alias 192.168.88.88), and now everything works great! So as I've found in like 900 other cases, NFS mounting problems are almost always due to a networking issue. Glad that still holds true here.

@briancain
Copy link
Member

@geerlingguy @gdelpierre - I've been trying to reproduce this and I can't seem to do so. If you update your Virtualbox and Vagrant tools to the latest versions, do you still get this error? Thank you! Here are the versions of my tools:

brian@localghost:vagrant-sandbox % vboxmanage -v
5.1.22r115126
    virtualbox-nfs: Guest Additions Version: 5.0.40
    virtualbox-nfs: VirtualBox Version: 5.1
Vagrant 1.9.7

@geerlingguy
Copy link
Contributor

@briancain - I am not having any issues anymore (see previous comment about Docker networking interference).

@chrisroberts
Copy link
Member

@geerlingguy Thanks for the confirmation! Going to close this up now 😃

@ghost
Copy link

ghost commented Apr 1, 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 Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants