ProsaWorkshop icon indicating copy to clipboard operation
ProsaWorkshop copied to clipboard

Vagrant up fails, SSH times out

Open kidmose opened this issue 7 years ago • 2 comments

First time trying to work through this material, and my first time with vagrant, I run into a problem, when trying to boot the image: It seems the SSH connection fails.

Clean start:

egk@egk-aau-laptop ~/git-reps/ProsaWorkshop $ git log -n1 
commit 7cbe418529c6432c59d2666a9c71099776657626
Author: Robert Larsen <[email protected]>
Date:   Sun Sep 10 21:51:51 2017 +0200

    Read the right file
egk@egk-aau-laptop ~/git-reps/ProsaWorkshop $ git status 
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
egk@egk-aau-laptop ~/git-reps/ProsaWorkshop $ vagrant destroy -f 
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...

Trying to bring it up:

egk@egk-aau-laptop ~/git-reps/ProsaWorkshop $ vagrant up 
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/ubuntu-16.04'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/ubuntu-16.04' is up to date...
==> default: Setting the name of the VM: ProsaWorkshop_default_1507624948989_11463
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

From the virtualbox GUI I can confirm that the machine is started.

And some details on my machine:

egk@egk-aau-laptop ~ $ uname -a
Linux egk-aau-laptop 3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
egk@egk-aau-laptop ~ $ lsb_release -a
No LSB modules are available.
Distributor ID:	LinuxMint
Description:	Linux Mint 17.3 Rosa
Release:	17.3
Codename:	rosa
egk@egk-aau-laptop ~ $ vagrant --version 
Vagrant 2.0.0
egk@egk-aau-laptop ~ $ vboxmanage --version
5.0.4_LinuxMintr102546

Any hints as to what goes wrong?

kidmose avatar Oct 10 '17 08:10 kidmose

Looking into the VM, I see that the network interface enp0s3 doesn't come up. Running sudo ifdown enp0s3 followed by sudo ifup enp0s3 I see that no DHCP lease is offered.

I'll continue looking into if this is something in my virtualbox setup, that I mangled, such that DHCP isn't available to NAT virtual interfaces.

kidmose avatar Oct 10 '17 11:10 kidmose

Found the problem: The virtual interface is configured as "cable disconnected".
Solution: Update Vagrantfile to configure IF as "cable connected".

I have not been able to identify any indications that this is due to me messing up my own setup. Rather, it seems to be related to interoperation between vagrant and recent versions of virtualbox: https://github.com/hashicorp/vagrant/issues/7648

PR coming up.

kidmose avatar Oct 10 '17 13:10 kidmose