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 ssh and synced folders, dns stopped working. Initializing new boxes with same problems #9596

Closed
peengo opened this issue Mar 20, 2018 · 16 comments

Comments

@peengo
Copy link

peengo commented Mar 20, 2018

Vagrant version

Vagrant 2.0.3

Host operating system

Win7 64

Guest operating system

ubuntu/xenial64
but i've also tried centos/7 & bento/ubuntu-16.04

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://vagrantcloud.com/search.
  config.vm.box = "ubuntu/xenial64"

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # NOTE: This will enable public access to the opened port
   config.vm.network "forwarded_port", guest: 8080, host: 8080
   config.vm.network "forwarded_port", guest: 27017, host: 27017

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine and only allow access
  # via 127.0.0.1 to disable public access
  # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.1.120"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  # config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "2048"
  # end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   apt-get update
  #   apt-get install -y apache2
  # SHELL
end

I've also tried making another box from scratch.

Debug output

https://gist.github.com/peengo/ede8bfbb5343a91eacebceda15977587

Expected behavior

vagrant ssh, machines dns, synced folders should work.

Actual behavior

After my vagrant box started to acting slow I reloaded it. After that I somehow lost network.
vagrant ssh doesn't work. So I've entered the machine manually via virtualbox and got in.
Found out that pinging google.com doesn't work but pinging 8.8.8.8 does. So I can't do any apt-get stuff.
Synced folders stopped working also.

Basically since I realoaded this box every new box I try to make I am stuck at this timeout and namespaces in the guest are not working. I am stuck at this since last thursday and I've tried anything I could think of.

Different boxes
Default VagrantFile
Different vagrant and virtualbox versions (including removing .virtualbox and .vagrant.d folders)
Setting up public_network and private_network in VagrantFile
Adding bridged and host-only network adapter in virtualbox
Deleting and readding network interfaces in VirtualBox
Yes SSH daemon is on
Checking that firewall (ufw) is disabled
Removing VMWare if somehow could interfer with vagrant or virtualbox

This box was working for couple of weeks if not months without any of this issues. I haven't updated vagrant or virtualbox unless they updated in the background? Right now I have both at the latest version.
Haven't really installed anything new in the meantime but there could be some windows updated in between.

Could be a virtualbox issue. I am not sure. The only thing I changed in virtualbox was memory from 1gb to 2gb (which I now know there is also vagrant cmd for it). Nothing else and it was working when I did that for weeks. Haven't opened virtualbox since then but just recently when I got a timeout error message and started digging what could be wrong.

The machine is up. But networking is messed up. Thats why it timeouts after continously retrying to SSH.

@martinandersson
Copy link

I have the same problem, or something close enough that I greatly suspect it has the same cause. I am running Windows 10 x64 on host. My experiences follows..

VirtualBox

Old Ubuntu 17.10 box with a static IP on a private network

Used to work just fine. But since Vagrant 2.0.3, the second vagrant up fails with the same symptoms you have described. The machine can't connect to the network and Vagrant can't SSH into the machine. Nothing changed except the Vagrant upgrade!

New Ubuntu 17.10 box with no private network

All vagrant up works like a charm.. until I configure a private network with an IP, then only the first vagrant up works and subsequent runs fail. Used to work just fine with Vagrant 2.0.2.

Granted, I have put net-tools and ifupdown into my Ubuntu 17.10 boxes cuz Vagrant used to have problems configuring these Ubuntu releases without said packages installed. But it seems like it does not make a difference for Vagrant 2.0.3 and the aforementioned problems if I have these packages in the box or not.

I get a feeling that the "fix" for the network configuration introduced in 2.0.3 was sort of half-assed and might have "fixed the first" problem in < 2.0.3 only on the surface but introduced the problems we're facing now.

New Ubuntu 18.04 (development branch) box

Same same.

Btw, boxes I use for the 18.04 release: pristine/ubuntu-budgie-18-x64.

VMware Workstation

New Ubuntu 18.04 box with no private network

(have not tried VMware on Ubuntu 17.10)

This works only for the first spin, but the second vagrant up will crash with same symptoms described earlier - with or without a private network defined lol. I.e., the situation for VMware seems to be even worse than for VirtualBox.

I am sorry for the low quality of this post, I haven't spent to much time investigating this issue. But hopefully it helps somewhat.

@briancain
Copy link
Member

@martinanderssondotcom - it sounds like you're describing a different issue from the one you're commenting on. The original post has no mention of private networks. If you're experiencing an issue with private networking on ubuntu 17.10 and older, please open a new issue.

@martinandersson
Copy link

negative! =) Look, same symptoms. Plus, pengo does have network configured. Plus number two: I see these same symptoms with or without a private network configured for Ubuntu 18.04 and VMware Workstation.

And the biggest plus of them all: Peengo describes first and foremost issues with vagrant SSH'necting into the machine and only mentions in the passing that the machine has no network at all. But really, this is the problem. The machine is like booted from cyberspace, he can't connect to no one and no one can connect to him. I.e., it is the exact same problem (what I call "symptom") that I am having. And the whole idea with issue trackers, the way I see it.. is that we collect issues and for each issue, enumerate environment factors to facilitate debugging and problem-solving.

For sure, in theory.. we could speaketh of two different root causes that happened to cause the same symptom - which I doubt. But even if that was the case (and we knew this) then I would personally still insist that the issue tracker remain focused on the symptom even though several fixes might, in the end, get deployed.

Okay, so, having said that.. if you still think I should open a new issue I will =) Let me know!

@briancain
Copy link
Member

@martinanderssondotcom - If you are experiencing the same problem as the original issue with a Vargantfile that has no private networks defined then it makes sense to comment here. However if you are only experiencing issues once you define private networks, then open a new issue. Port forwards are handled by the virtualbox provider, where as configuring private networks are handled by guest capabilities in Vagrant. Thanks!

@peengo
Copy link
Author

peengo commented Mar 23, 2018

@martinanderssondotcom have you tried any other non-ubuntu distro like centos?
@briancain do you by any chance happen to know how to do a clean install of vagrant and virtualbox. I think i did that but maybe I left some folder laying around somewhere.

@briancain
Copy link
Member

@peengo - the uninstall tool provided by the vagrant installer package should be sufficient enough. But if you wanted to be sure after uninstalling, I'd just make sure /opt/vagrant and ~/.vagrant.d was completely gone. That should be it I think? I'm not sure about virtualbox...

@martinandersson
Copy link

peengo, no I didn't. I went back to Vagrant 2.0.2 and stick to not having a private network, for now. That's better than not being able to make a second vagrant up lol.

@peengo
Copy link
Author

peengo commented Mar 23, 2018

I'll try that version but I doubt I'll be able to "vagrant ssh"

@martinandersson
Copy link

..and then what happened?

@peengo
Copy link
Author

peengo commented Apr 15, 2018

Still the same issue. I've given up on this. Here is what I just tried:

Uninstalled VirtualBox & Vagrant
Removed user files from .virtualbox + .vagrant.d + Virtualbox VMs
Installed VirtualBox-5.2.8-121009-Win & vagrant_2.0.2_x86_64

vagrant init ubuntu/xenial64
vagrant up

@martinandersson
Copy link

Still the same issue with Vagrant 2.0.4.

@chrisroberts
Copy link
Member

This may be an issue with the box in use. I will pull one of the ubuntu boxes today and see if i can reproduce the behavior. Do you encounter the same behavior using the bento boxes?

@martinandersson
Copy link

lol the box I use is built completely by the book =)

Distributed here: https://app.vagrantup.com/pristine/boxes/ubuntu-budgie-18-x64

Files used (such as Packer's template) can be found here: https://github.com/martinanderssondotcom/box-ubuntu-budgie-18-x64

Yes, please do try these boxes with both VirtualBox and VMware. I would appreciate that very much. Do one vagrant up and then one vagrant reload! =)

@chrisroberts
Copy link
Member

@martinanderssondotcom Hi, you appear to be experiencing a different issue that what is originally described here. Please feel free to open a new issue, and we can track the problem there. Thanks!

@chrisroberts
Copy link
Member

Hi there,

Thanks for reporting this bug. I'm sure this was a real issue when originally reported (our fault for not looking sooner!) but there have been multiple Vagrant releases since the original report. I'm going to close this issue now and request you reopen the issue if you're still experiencing this problem. I'm sorry this wasn't looked at earlier ☹️

Cheers!

@ghost
Copy link

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

No branches or pull requests

4 participants