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

Can't reach private network on Debian 9 (stretch) host #8686

Closed
anlutro opened this Issue Jun 14, 2017 · 16 comments

Comments

Projects
None yet
7 participants
@anlutro
Copy link

anlutro commented Jun 14, 2017

In Debian 8, I was able to assign private network IPs to VMs and connect to that IP directly. This does not seem to be the case in Debian 9.

I'm using Virtualbox 5.1.22 and have tested on 2 different laptops (both using Debian 9).

Vagrant version

$ vagrant -v
Vagrant 1.9.5

Host operating system

$ lsb_release -d
Description:	Debian GNU/Linux 9.0 (stretch)

Guest operating system

Doesn't seem to matter, I've tested with Debian and CentOS.

Vagrantfile

Vagrant.configure(2) do |config|
	config.vm.box = 'box-cutter/debian8'
	config.vm.network 'private_network', ip: '10.90.10.10'
end

@anlutro anlutro changed the title Can't reach private network on Debian 9 host Can't reach private network on Debian 9 (stretch) host Jun 14, 2017

@chrisroberts

This comment has been minimized.

Copy link
Member

chrisroberts commented Jun 15, 2017

Hi there,

I was unable to reproduce the behavior you are experiencing. Using the Vagrantfile you provided, after bringing the VM up:

$ vagrant ssh -- ip a | grep 10.90
    inet 10.90.10.10/24 brd 10.90.10.255 scope global eth1

$ ssh vagrant@10.90.10.10
vagrant@10.90.10.10's password:
----------------------------------------------------------------
  Debian GNU/Linux 8.6 (jessie)               built 2016-12-04
----------------------------------------------------------------
vagrant@vagrant:~$

The VM seems to be accessible without issue. Can you provide more information to reproduce the specific failure you are experiencing? Thanks!

@anlutro

This comment has been minimized.

Copy link
Author

anlutro commented Jun 15, 2017

Not sure what other information I can provide - I run the exact same commands as you and ssh simply hangs.

I suspect this is because of the virtualbox network not being brought up or routed. What's the output from your ip addr and ip route on the host system?

And just to double check, you are also using Debian 9 on the host system, right?

@dradetsky

This comment has been minimized.

Copy link

dradetsky commented Jun 15, 2017

@anlutro can you try with guest box hashicorp/precise64? This may be a known issue.

@anlutro

This comment has been minimized.

Copy link
Author

anlutro commented Jun 16, 2017

Same issue with hashicorp/precise64. Also centos/7.

@gyqwrryk

This comment has been minimized.

Copy link

gyqwrryk commented Jun 17, 2017

Was having the same issue. On one system all worked as expected on a new new install of stretch it did not work. In my case, one difference was net-tools/ifconfig was installed on the system where all worked. Installing net-tools fixed my issue with private networks w/ virtualbox/vagrant. Looks like virtualbox requires ifconfig(net-tools).

@dradetsky

This comment has been minimized.

Copy link

dradetsky commented Jun 17, 2017

@anlutro then it's probably not the same issue, but: double check that you have virtualization enabled on your bios.

@anlutro

This comment has been minimized.

Copy link
Author

anlutro commented Jun 17, 2017

If it wasn't enabled, I wouldn't be able to create VMs at all. Also, it worked fine in Debian 8 on the same laptop.

@anlutro

This comment has been minimized.

Copy link
Author

anlutro commented Jun 22, 2017

@chrisroberts Since you tagged the issue with waiting-reply, could you be a bit more specific about what more information you'd like me to provide? I'm unsure of where to look.

@dradetsky

This comment has been minimized.

Copy link

dradetsky commented Jun 22, 2017

@anlutro in fact, some people (myself included) have had vagrant report that it could create the vm, but then attempting to ssh into the new vm would hang, when VT-x was disabled. This did not happen with all boxes. In my case, the arch linux box i was trying to use hung, but the hashicorp precise box immediately crashed with 'no VT-x' or something similar. Since the hashicorp box did not crash in this way for you, I'm guessing it's not the same issue, although I'm on a different host (arch again).

@chrisroberts

This comment has been minimized.

Copy link
Member

chrisroberts commented Jun 23, 2017

@anlutro Thanks for the information. I can't reproduce the behavior on my machine so I'm building a fresh debian-9 box to attempt to repro and see if I can force the same behavior.

@gustix1

This comment has been minimized.

Copy link

gustix1 commented Jun 23, 2017

Seeing this behavior as well with Vagrant 1.9.5, debian 9 and
virtualbox-5.1_5.1.22-115126.
Private network doesn't work.

My Vagrantfile:
`
Vagrant.configure(2) do |config|
# Definir máquina virtual
config.vm.define :"debian-jessie-seped"

# Configurar caja
config.vm.box = "debian/jessie64"

# Configurar red
config.vm.network "private_network", ip: "192.168.10.2"

# Configurar carpetas compartidas
config.vm.synced_folder ".",    "/vagrant"  , type: "nfs"

end
`

My ip command output:
#ip addr show
`
....
5: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
....

`
My debian version:
#uname -a
Linux MY-LAPTOP 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u1 (2017-06-18) x86_64 GNU/Linux

Regards.
Sorry bad english

@chrisroberts

This comment has been minimized.

Copy link
Member

chrisroberts commented Jun 27, 2017

@anlutro I built a new debian-9 host, installed Virtualbox, installed Vagrant 1.9.5, and used your provided Vagrantfile. See details below:

vagrant@debian-9:~/test$ vagrant status
Current machine states:

default                   running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.
vagrant@debian-9:~/test$ cat Vagrantfile
Vagrant.configure("2") do |config|
  config.vm.box = "box-cutter/debian8"
  config.vm.network 'private_network', ip: '10.90.10.10'
end
vagrant@debian-9:~/test$ vagrant ssh -- ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:90:d2:ed brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe90:d2ed/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:02:57:7a brd ff:ff:ff:ff:ff:ff
    inet 10.90.10.10/24 brd 10.90.10.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe02:577a/64 scope link
       valid_lft forever preferred_lft forever
vagrant@debian-9:~/test$ ssh vagrant@10.90.10.10
vagrant@10.90.10.10's password:
----------------------------------------------------------------
  Debian GNU/Linux 8.6 (jessie)               built 2016-12-04
----------------------------------------------------------------
vagrant@vagrant:~$ exit
logout
Connection to 10.90.10.10 closed.

And ip addr and ip route information from the host system (which is a fresh debian 9 host):

vagrant@debian-9:~/test$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    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: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:66:85:d9 brd ff:ff:ff:ff:ff:ff
    inet 192.168.84.128/24 brd 192.168.84.255 scope global ens32
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe66:85d9/64 scope link
       valid_lft forever preferred_lft forever
3: vboxnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 10.90.10.1/24 brd 10.90.10.255 scope global vboxnet0
       valid_lft forever preferred_lft forever
    inet6 fe80::800:27ff:fe00:0/64 scope link
       valid_lft forever preferred_lft forever
vagrant@debian-9:~/test$ ip route
default via 192.168.84.2 dev ens32
10.90.10.0/24 dev vboxnet0 proto kernel scope link src 10.90.10.1
192.168.84.0/24 dev ens32 proto kernel scope link src 192.168.84.128
vagrant@debian-9:~/test$

Is it possible you have any type of firewall/filtering locally that may be blocking access?

@anlutro

This comment has been minimized.

Copy link
Author

anlutro commented Jun 27, 2017

I definitely don't have any local firewall/filtering. I do want to point out this difference in ip addr and ip route output though:

$ ip addr
...
4: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
$ ip route
default via 192.168.2.254 dev wlp4s0 proto static metric 600 
192.168.2.0/24 dev wlp4s0 proto kernel scope link src 192.168.2.1 metric 600

What could cause my system to not bring the interface up and register the routes?

@anlutro

This comment has been minimized.

Copy link
Author

anlutro commented Jul 3, 2017

I found the problem. The net-tools was not installed on my system. This package includes ifconfig, which I assume either vagrant or virtualbox uses to configure its networks.

@benofbrown

This comment has been minimized.

Copy link

benofbrown commented Sep 5, 2017

I've been hit by this too and will install net-tools - however ifconfig is deprecated and vagrant really should work without it. I assume this is why this issue is still open.

@briancain briancain removed the waiting-reply label Dec 5, 2017

@chrisroberts

This comment has been minimized.

Copy link
Member

chrisroberts commented Mar 27, 2018

Debian guest support has been updated in Vagrant and this is resolved in recent releases.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.