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

Vagrant guest and host cannot communicate (Ubuntu 17.04) #8626

Closed
chadfurman opened this issue May 30, 2017 · 10 comments
Closed

Vagrant guest and host cannot communicate (Ubuntu 17.04) #8626

chadfurman opened this issue May 30, 2017 · 10 comments

Comments

@chadfurman
Copy link

chadfurman commented May 30, 2017

Vagrant version

Vagrant 1.9.5
VirtualBox Graphical User Interface Version 5.1.22_Ubuntu r115126

Host operating system

Ubuntu 17.04

Guest operating system

Ubuntu 14.04

Vagrantfile

## Run from anywhere:  $ vagrant plugin install vagrant-vbguest 
## Run from anywhere:  $ vagrant plugin install vagrant-triggers 

Vagrant::configure("2") do |config|

  config.vm.box = "ubuntu/trusty64"

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

  config.vm.provider :virtualbox do |v|
    v.memory = 8096
    v.cpus = 2
    v.customize ["modifyvm", :id, "--ioapic", "on" ]
  end

  config.vm.synced_folder '.', '/vagrant', type: 'nfs', map_uid: 0, map_gid: 0
  #config.vm.synced_folder './janus', '/home/vagrant/creativ-janus', :mount_options => ["dmode=777", "fmode=666"]
  config.vm.synced_folder './janus', '/home/vagrant/creativ-janus', type: 'nfs', map_uid: 0, map_gid: 0

  config.vm.provision 'ansible' do | ansible |
      ansible.playbook = 'ansible/playbook.yml'
  end
end

Debug output

https://gist.github.com/chadfurman/4ddfdf0e5d5203ef8353db1a4955b16f

Expected behavior

Guest and Host should be able to ping back and forth. Guest should be able to mount NFS

Actual behavior

Guest and Host cannot communicate. Both are on vboxnet0 with 192.168.33.* ip addresses. Neither has a firewall.

Steps to reproduce

  1. Use above Vagrantfile, operating system versions
  2. Attempt vagrant up
  3. Note that NFS does not mount, ctrl-c
  4. vagrant ssh into the box and then try to ping the host w/ ping 192.168.33.1 -- ping will fail
  5. ping the guest from the host w/ ping 192.168.33.99 -- ping will fail

References

#8177
#8140
#5802
wunki/vagrant-freebsd#4
geerlingguy/drupal-vm#245
scotch-io/scotch-box#92

@chadfurman
Copy link
Author

Solved.

I had ran:

ip a add 192.168.33.1/255.255.255.0 dev vboxnet0

but I did not run

$ ip link set vboxnet0 up

@SimonErich
Copy link

I had the same problem with all vagrant boxes and found the solution to be:

removing the second line in the /etc/hosts file
just uncomment or remove the line containing:

     127.0.1.1 [computer-name]

Installing net-tools:
It seems like ubuntu 17.04 is not installing the package net-tools anymore.

So installing them via

     sudo apt-get install net-tools

and it should work again.

@danepowell
Copy link

I'm having this problem on Ubuntu 17.04, and no combination of solutions mentioned in this thread has helped (I'm not able to ping the guest from the host or vice versa). Is there anything else that can be done to troubleshoot it?

@briancain
Copy link
Member

@danepowell - If you can, please share your version of vagrant, Vagrantfile, a log of debug output from vagrant, and maybe version of virtualbox that you're using. Thanks!

@danepowell
Copy link

I figured out the issue and posted it here: geerlingguy/drupal-vm#1480

Essentially, I needed to install the virtualbox-dkms package. I had installed Virtualbox 5.1.24 by downloading the package directly from virtualbox.org, but this package did not have a dependency on virtualbox-dkms like the version in the zesty repos does.

@yeongsheng-tan
Copy link

yeongsheng-tan commented Jul 25, 2017

@danepowell installing virtualbox-dkms package for Debian Jessie VirtualBox 5.1.24 equivalent package did not solve the issue for me.

There is a known bug in VirtualBox 5.1.24 filed here.

Apparently, you need to manually bring up the vboxnet interface used by your guest OS.

Assuming your NIC interface used by your VM brought up by 'vagrant' is vboxnet0, just run the following to make the nfs mount go through w/o issues:
ip link set vboxnet0 up

@nomasprime
Copy link

nomasprime commented Sep 26, 2017

This issue needs opening: net-tools already installed on 17.04.

@darkn3rd
Copy link

@chadfurman you ran ip a add 192.168.33.1/255.255.255.0 dev vboxnet0 on the host?

@edmunds22
Copy link

Try switching off the ubuntu UFW temporarily

@ghost
Copy link

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

No branches or pull requests

8 participants