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

For chapter 3 can't connect to vms through #39

Closed
nikathone opened this issue Aug 7, 2016 · 10 comments
Closed

For chapter 3 can't connect to vms through #39

nikathone opened this issue Aug 7, 2016 · 10 comments

Comments

@nikathone
Copy link

After following the setup guide on page 68 to 72, I can't seem to be able to connect or ping the created vms through their private network ips. My problem is similar to https://leanpub.com/ansible-for-devops/feedback#comment-2101413414 or this one but neither of the solution provided their is working for me.

I am using:

  • OS X El Capitan
  • Virtualbox: Version 5.0.26 r108824
  • Vagrant 1.8.5
  • ansible 2.1.0.0

I do suspect that there is something wrong with the vagrant box cause I've tried other boxes(e.g.scotch/box) with the same vagrant file configuration and the private ips works fine.

Please, any help or guidance will be really appreciated. Also, let me know if you need more information about my setup.

Thanks,

@geerlingguy
Copy link
Owner

Can you post a log of the output when you try running vagrant ssh [machine] where the machine is one of the VM names?

Also, have you tried using a different IP range? If your local network is using 192.168.* then the IPs given in the example might not work correctly. Finally, do you have a proxy or VPN running?

@nikathone
Copy link
Author

nikathone commented Aug 8, 2016

$ vagrant ssh app1
[vagrant@orc-app1 ~]$ exit
logout
Connection to 127.0.0.1 closed.
$ vagrant ssh-config
Host app1
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /Users/username/.vagrant.d/insecure_private_key
  IdentitiesOnly yes
  LogLevel FATAL

Host app2
  HostName 127.0.0.1
  User vagrant
  Port 2200
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /Users/username/.vagrant.d/insecure_private_key
  IdentitiesOnly yes
  LogLevel FATAL

Host db
  HostName 127.0.0.1
  User vagrant
  Port 2201
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /Users/username/.vagrant.d/insecure_private_key
  IdentitiesOnly yes
  LogLevel FATAL

I did try other IP ranges but it didn't work either what surprised me though is that if I try the example at http://www.thisprogrammingthing.com/2015/multiple-vagrant-vms-in-one-vagrantfile I don't encounter any problem with private network ip address. At one point, I did use the ips provided on this example to see if they will work with no luck.

I do have a CISCO AnyConnect Secure Mobility Client installed on my laptop but I turned it off.

Thanks for your help

@shoodle
Copy link

shoodle commented Aug 21, 2016

I have the same problem on a Debian machine with

  • VirtualBox Version: 4.3.36-dfsg-1+deb8u1
  • Vagrant 1.8.5
  • ansible 2.1.0.0

All the 3 servers get only the 127.0.0.1 IP address and not the one from the 192.168.60 range.

From the host I can ping 192.168.60.1 but no higher addresses from that range.

I suspect Vagrant actually having a problem with setting up Cent0S networking.

The IP configuration in each of the 3 servers is exactly the same:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:f7:90:b3 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
       valid_lft 84256sec preferred_lft 84256sec
    inet6 fe80::a00:27ff:fef7:90b3/64 scope link 
       valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:b0:5b:af brd ff:ff:ff:ff:ff:ff 

@shoodle
Copy link

shoodle commented Aug 24, 2016

Adding a different vagrant box (bento/centos-7.2) I was able to connect to the private network.

@faustoroger
Copy link

faustoroger commented Aug 24, 2016

The problem and the solution on Vagrant 1.8.5:

hashicorp/vagrant#7610

This solved for me.

@shoodle
Copy link

shoodle commented Aug 24, 2016

This is a different error I also encountered when using Vagrant 1.8.5. Applying the patch resolved the problem with the keys.
But it has nothing to do with the private network which is not deployed with the vagrant box.

@geerlingguy
Copy link
Owner

It looks like this, as well as hashicorp/vagrant#7705, might fix the issues you're noticing with 1.8.5.

I thought 1.8.5 would be quite stable after the interesting behavior of 1.8.2, 1.8.3, and 1.8.4, but now I'm pining for a 1.8.6 release so these bugs stop rearing their ugly heads!

@charleshepner
Copy link

I tried the patch in hashicorp/vagrant#7705 but it did not appear to fix the issue for me (using Vagrant 1.8.5 with the box geerlingguy/centos7). However, running vagrant reload after vagrant up gets the private IP's assigned and I can continue to follow the examples in Chapter 3. Great book by the way!

@geerlingguy
Copy link
Owner

@charleshepner - Thanks for the update, and glad you like the book!

@geerlingguy
Copy link
Owner

Going to mark this as closed—but please note that there are definitely issues with Vagrant 1.8.7 and VirtualBox 5.1.8 currently. Please make sure you use the latest versions, or search the relevant issue queues for problems that you might be getting :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants