maier / vagrant-alpine

Vagrant plugin for Alpine Linux Guest
MIT License
137 stars 10 forks source link

nfs mounting problems #19

Closed arkady-emelyanov closed 8 years ago

arkady-emelyanov commented 8 years ago

Hello!

I finally manage to solve VirtualBox Guest additions problem. Here is the commit which allow build up alpine linux box with working guest additions.

Vagrant box is located there: https://atlas.hashicorp.com/Dalee/boxes/alpine But, i'm experiencing some problems to manage plugin to work:

Plugins installed:

> vagrant plugin list
vagrant-alpine (0.2.0)
vagrant-share (1.1.5, system)

Sample Vagrantfile:

Vagrant.require_version ">= 1.8.0"
Vagrant.configure("2") do |config|

    config.vm.box = "Dalee/alpine"
    config.vm.provider :virtualbox do |v|
        v.gui = true
        v.memory = 512
        v.cpus = 1
    end

    config.vm.network "private_network", type: "dhcp"
    config.vm.synced_folder ".", "/home/web/project", type: "nfs"
end

And the vagrant message:

 INFO runner: Running action: environment_unload #<Vagrant::Action::Builder:0x00000103265ad0>
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<Vagrant::Errors::NFSNoGuestIP: No guest IP was given to the Vagrant core NFS helper. This is an
internal error that should be reported as a bug.>
ERROR vagrant: No guest IP was given to the Vagrant core NFS helper. This is an
internal error that should be reported as a bug.
ERROR vagrant: /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/prepare_nfs_settings.rb:131:in `rescue in read_dynamic_machine_ip'

Any suggestions?

maier commented 8 years ago

If the guest additions are actually installed there should be no need to mount the synced_folder using NFS. The VirtualBox guest additions provide this capability. Try bringing the VM up using just:

config.vm.synced_folder ".", "/home/web/project"

Otherwise, try using a static IP for the private_network to see if that addresses the issue. If it does, then I'd suspect there is an issue with the DHCP response. It looks like this error is occurring in the VirtualBox provider plugin:

ERROR vagrant: /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/prepare_nfs_settings.rb:131:inrescue in read_dynamic_machine_ip'`

arkady-emelyanov commented 8 years ago

Yeah, i know about synced_folder feature, they work fine. The problem is they are very slow in order to use in real project.

Ok, i'll try to check source of vagrant/vagrant-alpine.

maier commented 8 years ago

The code having an issue isn't part of vagrant-alpine, it is in:

/opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/prepare_nfs_settings.rb

which is part of the virtualbox provider plugin for vagrant.

maier commented 8 years ago

Also, with regards to NFS shares and Vagrant, take a look at the comment in the Vagrantfile.example it talks about using DHCP with NFS shares.

  #
  # Shared folders
  #
  # Note, for shared folders via NFS a static IP *must* be provided
  # until guest additions can be built and installed out of main.
  # The reason being that although a DHCP interface does successfully
  # get an IP, virtualbox is unaware of it and therefore cannot
  # provide it to Vagrant.
arkady-emelyanov commented 8 years ago

@maier I think you right, it's not and issue with plugin itself. Anyway, thanks for clues. I'll keep searching. I'll close this issue.