maier / vagrant-alpine

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

resolv.conf empty #28

Open Raboo opened 7 years ago

Raboo commented 7 years ago

Hi

I'm running OS X Sierra, VirtualBox 5.1.26, Vagrant 1.9.7. Installed this plugin and trying to get a Alpine instance working. The error is get when running vagrant up is

==> alpine: 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.

Using box maier/alpine-3.6-x86_64 I've tried following

  config.vm.provider "virtualbox" do |vb|
    vb.gui = false
    vb.memory = 256
    vb.cpus = 1
    vb.customize [
      'modifyvm', :id,
      '--natdnshostresolver1', 'on',
      '--nic1', 'nat',
      '--cableconnected1', 'on'
    ]
  end

and

  config.vm.provider "virtualbox" do |vb|
    vb.gui = false
    vb.memory = 256
    vb.cpus = 1
  end

And networking is set as following

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

Networking works, but /etc/resolv.conf is empty.

Trying the same stuff with box ubuntu/xenial64 everything works.

Any idea on what I could be doing wrong?

maier commented 7 years ago

If you're trying to use NFS for shared folders a static IP must be provided for the private network. See the comment in the example Vagrantfile (https://github.com/maier/vagrant-alpine/blob/master/Vagrantfile.example#L28). If your guest is a recent enough 3.6 version is supposed to be a VirtualBox Guest Additions package pre-compiled which can be installed. (https://github.com/maier/packer-templates/blob/master/alpine3.6/scripts/90virtualbox.sh)

Raboo commented 7 years ago

I tried with static IP, it fails when trying to install NFS cause it can't resolve hostnames. But I can try without NFS and with DHCP to see if it gets a nameserver.

I would imagine that trying to install VBGA would fail since I have a empty resolv.conf. I will test and report back.