chef / bento

Packer templates for building minimal Vagrant baseboxes for multiple platforms
Apache License 2.0
4.23k stars 1.12k forks source link

Ubuntu 14.04: No guest IP was given to the Vagrant core NFS helper #232

Closed nbenn closed 9 years ago

nbenn commented 10 years ago

The box resulting from a ubuntu-14.04-amd64.json run does not properly start up under vagrant, while the box that is referenced in the readme does not suffer from this problem. This is the reason why I'm creating this issue here.

The Vagrant output:

==> default: Box 'opscode/ubuntu-14.04_chef-provisionerless' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Adding box 'opscode/ubuntu-14.04_chef-provisionerless' (v0) for provider: virtualbox
    default: Downloading: file:///.../opscode_ubuntu-14.04_chef-provisionerless.box
==> default: Successfully added box 'opscode/ubuntu-14.04_chef-provisionerless' (v0) for 'virtualbox'!
==> default: Importing base box 'opscode/ubuntu-14.04_chef-provisionerless'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: semester-project
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    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: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
No guest IP was given to the Vagrant core NFS helper. This is an
internal error that should be reported as a bug.

My vagrantfile:

# -*- mode: ruby -*-

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.vm.box = "opscode/ubuntu-14.04_chef-provisionerless"
  config.vm.box_url = "file:///.../opscode_ubuntu-14.04_chef-provisionerless.box"

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

  config.vm.synced_folder "./Code", "/Code", :nfs => true

end

I'm using Vagrant 1.6.3 and Mac OS 10.9.3. Pleas let me know if I can provide any additional information. Also let me know if you think this issue is best added to the Vagrant repo instead of here.

Best, Nicolas

juliandunn commented 10 years ago

What happens if you turn off the NFS shared folder?

Judging by the

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

I'm going to assume there's a problem with Vagrant rather than this box, but let's narrow that down.

nbenn commented 10 years ago

When I remove :nfs => true, I get

==> 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: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /Code => /Users/nbennett/Downloads/bento-master/Code
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` Code /Code
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` Code /Code

If it helps, the box I created is available here. I tried both VirtualBox 4.3.10 r93013 and 4.3.12 r93733 after reading this. Same result.

Any idea why the prebuilt box works? Shouldn't that one be identical to the one I get when I run packer build -only=virtualbox-iso ubuntu-14.04-amd64.json?

Let me know if I can do anything else to help.

tknerr commented 10 years ago

Experiencing the same issue with the chef/ubuntu-14.04-i386 box on vagrantcloud:

D:\Repos\_github\vagrant-managed-servers>vagrant up fake_managed_server
Bringing machine 'fake_managed_server' up with 'virtualbox' provider...
==> fake_managed_server: Importing base box 'chef/ubuntu-14.04-i386'...
==> fake_managed_server: Matching MAC address for NAT networking...
==> fake_managed_server: Checking if box 'chef/ubuntu-14.04-i386' is up to date...
==> fake_managed_server: Setting the name of the VM: vagrant-managed-servers_fake_managed_server_1408742560231_7962
==> fake_managed_server: Clearing any previously set network interfaces...
==> fake_managed_server: Preparing network interfaces based on configuration...
    fake_managed_server: Adapter 1: nat
    fake_managed_server: Adapter 2: hostonly
==> fake_managed_server: Forwarding ports...
    fake_managed_server: 22 => 2222 (adapter 1)
==> fake_managed_server: Booting VM...
==> fake_managed_server: Waiting for machine to boot. This may take a few minutes...
    fake_managed_server: SSH address: 127.0.0.1:2222
    fake_managed_server: SSH username: vagrant
    fake_managed_server: SSH auth method: private key
    fake_managed_server: Warning: Connection timeout. Retrying...
==> fake_managed_server: Machine booted and ready!
==> fake_managed_server: Checking for guest additions in VM...
==> fake_managed_server: Configuring and enabling network interfaces...
==> fake_managed_server: Mounting shared folders...
    fake_managed_server: /vagrant => D:/Repos/_github/vagrant-managed-servers
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

@juliandunn the ubuntu 14.04 box referenced on the readme works, so I guess the vagrantcloud box is out of sync and does not have #235 yet?

juliandunn commented 10 years ago

@tknerr that makes no sense because we only use vagrantcloud to store metadata, not box hosting; the payloads point to the same place as the readme.

tknerr commented 10 years ago

@juliandunn yep, you are so right. I was mistakenly testing with the ubuntu-14.04 (64 bit) box url from the readme...

Summing up:

So it seems that the i386 box has not been rebuilt yet since the fix had been merged in #235?

juliandunn commented 10 years ago

@tknerr Possibly. I'll check the timestamps in S3 and rebuild it if necessary.

juliandunn commented 10 years ago

Nope, the boxes were all built at the same time according to the timestamps in S3.

tknerr commented 10 years ago

@juliandunn weird. Here is a simple repro: https://gist.github.com/tknerr/f2d690527369d54da806

On the "broken" i386 box it seems that the guest additions are correctly installed:

vagrant@vagrant:~$ lsmod | grep -i vbox
vboxsf                 42558  0
vboxvideo              12578  0
drm                   243792  1 vboxvideo
vboxguest             219348  2 vboxsf

Modprobe exits with 0 too:

vagrant@vagrant:~$ modprobe vboxsf
vagrant@vagrant:~$

But mounting the shared folders fails with a protocol error:

vagrant@vagrant:~$ sudo mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount: Protocol error
tknerr commented 10 years ago

It seems that it is this issue: https://github.com/mitchellh/vagrant/issues/3341

Actually it's a VirtualBox issue: https://www.virtualbox.org/ticket/12879

It can be fixed by adding this symlink:

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

The x64 box works because it has the 4.3.8 VBoxGuestAdditions where the symlink is already present:

vagrant@vagrant:~$ ll /usr/lib/VBoxGuestAdditions
lrwxrwxrwx 1 root root 52 Apr 19 05:24 /usr/lib/VBoxGuestAdditions -> /opt/VBoxGuestAdditions-4.3.8/lib/VBoxGuestAdditions/
juliandunn commented 9 years ago

I've uploaded a new version of the Ubuntu 14.04 boxes for Virtualbox and tested them to see that vboxsf volumes are mounted, so I'm closing this.

FractalizeR commented 9 years ago

This problem can be originated from Virtual Box Guest Additions version mismatch between host and box. You can try to reinstall them on the box manually or just use vagrant vbguest plugin.