Vagrant freezes at 'SSH auth method: private key' and then Timed out

I’ve been trying to get my environment up and running but after running ‘vagrant up --provision’ vagrant downloads all necessary file and then freezes at ‘SSH auth method: private key’ and then timed out. I am on Windows 10 and here is the error.

==> mongod-m103: Clearing any previously set forwarded ports…
==> mongod-m103: Clearing any previously set network interfaces…
==> mongod-m103: Preparing network interfaces based on configuration…
mongod-m103: Adapter 1: nat
mongod-m103: Adapter 2: hostonly
==> mongod-m103: Forwarding ports…
mongod-m103: 22 (guest) => 2222 (host) (adapter 1)
==> mongod-m103: Running ‘pre-boot’ VM customizations…
==> mongod-m103: Booting VM…
==> mongod-m103: Waiting for machine to boot. This may take a few minutes…
mongod-m103: SSH address: 127.0.0.1:2222
mongod-m103: SSH username: vagrant
mongod-m103: 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.

Hi Ismaila_94110,

Make sure you have virtualization enabled in BIOS.

Open VirtualBox GUI and try to start mongod-m103 there.

If that does not work, you might need to take a look at “log” and share that here.

Let me know.

Kanika

Virtualization is active on my pc, i ran the mongod-m103 from there. The virtual environment is running, still cant proceed and here’s the error i got. Thank you.log1
Thank you

Please see my reply below.

Hi @Ismaila_94110,

It can be because of a couple of possible errors:

  • insufficient resources on the machine (likely they don’t have sufficient memory
  • a corrupt VM image / box

So, run vagrant destroy and then delete the directory m103-vagrant-env. Then download again and run vagrant up.

Let me know.

Kanika

I continue to have issues on this as well. I was originally having the issues on my normal laptop. I decided to get a new laptop from our IT folks (clean windows 10 build with all updates). I get similar errors as noted above. My errors start with the vagrant up command…thoughts?

PS C:\Projects\MongoDB\University\m103\m103-vagrant-env> vagrant up
Bringing machine ‘mongod-m103’ up with ‘virtualbox’ provider…
==> mongod-m103: Box ‘ubuntu/trusty64’ could not be found. Attempting to find and install…
mongod-m103: Box Provider: virtualbox
mongod-m103: Box Version: >= 0
==> mongod-m103: Loading metadata for box ‘ubuntu/trusty64’
mongod-m103: URL: https://vagrantcloud.com/ubuntu/trusty64
==> mongod-m103: Adding box ‘ubuntu/trusty64’ (v20190409.0.0) for provider: virtualbox
mongod-m103: Downloading: https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/20190409.0.0/providers/virtualbox.box
mongod-m103: Download redirected to host: cloud-images.ubuntu.com
mongod-m103:
==> mongod-m103: Successfully added box ‘ubuntu/trusty64’ (v20190409.0.0) for ‘virtualbox’!
==> mongod-m103: Importing base box ‘ubuntu/trusty64’…
==> mongod-m103: Matching MAC address for NAT networking…
==> mongod-m103: Setting the name of the VM: mongod-m103
==> mongod-m103: Clearing any previously set forwarded ports…
Vagrant is currently configured to create VirtualBox synced folders with
the SharedFoldersEnableSymlinksCreate option enabled. If the Vagrant
guest is not trusted, you may want to disable this option. For more
information on this option, please refer to the VirtualBox manual:

https://www.virtualbox.org/manual/ch04.html#sharedfolders

This option can be disabled globally with an environment variable:

VAGRANT_DISABLE_VBOXSYMLINKCREATE=1

or on a per folder basis within the Vagrantfile:

config.vm.synced_folder ‘/host/path’, ‘/guest/path’, SharedFoldersEnableSymlinksCreate: false
==> mongod-m103: Clearing any previously set network interfaces…
==> mongod-m103: Preparing network interfaces based on configuration…
mongod-m103: Adapter 1: nat
mongod-m103: Adapter 2: hostonly
==> mongod-m103: Forwarding ports…
mongod-m103: 22 (guest) => 2222 (host) (adapter 1)
==> mongod-m103: Running ‘pre-boot’ VM customizations…
==> mongod-m103: Booting VM…
==> mongod-m103: Waiting for machine to boot. This may take a few minutes…
mongod-m103: SSH address: 127.0.0.1:2222
mongod-m103: SSH username: vagrant
mongod-m103: SSH auth method: private key
mongod-m103:
mongod-m103: Vagrant insecure key detected. Vagrant will automatically replace
mongod-m103: this with a newly generated keypair for better security.
mongod-m103:
mongod-m103: Inserting generated public key within guest…
mongod-m103: Removing insecure key from the guest if it’s present…
mongod-m103: Key inserted! Disconnecting and reconnecting using new SSH key…
==> mongod-m103: Machine booted and ready!
==> mongod-m103: Checking for guest additions in VM…
mongod-m103: The guest additions on this VM do not match the installed version of
mongod-m103: VirtualBox! In most cases this is fine, but in rare cases it can
mongod-m103: prevent things such as shared folders from working properly. If you see
mongod-m103: shared folder errors, please make sure the guest additions within the
mongod-m103: virtual machine match the version of VirtualBox you have installed on
mongod-m103: your host and reload your VM.
mongod-m103:
mongod-m103: Guest Additions Version: 4.3.40
mongod-m103: VirtualBox Version: 5.2
==> mongod-m103: Setting hostname…
==> mongod-m103: Configuring and enabling network interfaces…
==> mongod-m103: Mounting shared folders…
mongod-m103: /shared => C:/Projects/MongoDB/University/m103/m103-vagrant-env/shared
mongod-m103: /vagrant => C:/Projects/MongoDB/University/m103/m103-vagrant-env
mongod-m103: /dataset => C:/Projects/MongoDB/University/m103/m103-vagrant-env/dataset
==> mongod-m103: Running provisioner: shell…
mongod-m103: Running: C:/Users/triley/AppData/Local/Temp/vagrant-shell20190417-9292-cbwf3i
mongod-m103: + config
mongod-m103: + sudo su
mongod-m103: + echo -e never
mongod-m103: + echo -e never
mongod-m103: + echo manual
mongod-m103: + sudo tee /etc/init/mongod.override
mongod-m103: manual
mongod-m103: + ip_config
mongod-m103: ++ ifconfig
mongod-m103: ++ grep ‘inet addr:’
mongod-m103: ++ tail -1
mongod-m103: ++ cut -d: -f2
mongod-m103: ++ awk ‘{ print $1}’
mongod-m103: ++ grep -v 127.0.0.1
mongod-m103: + export CLIENT_IP_ADDR=192.168.103.100
mongod-m103: + CLIENT_IP_ADDR=192.168.103.100
mongod-m103: ++ hostname
mongod-m103: + export CLIENT_FQDN=m103
mongod-m103: + CLIENT_FQDN=m103
mongod-m103: ++ tr ‘[:upper:]’ ‘[:lower:]’
mongod-m103: ++ cut -d. -f 1
mongod-m103: ++ hostname
mongod-m103: Configuring /etc/hosts …
mongod-m103: + export CLIENT_NAME=m103
mongod-m103: + CLIENT_NAME=m103
mongod-m103: + echo ‘Configuring /etc/hosts …’
mongod-m103: + echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ’
mongod-m103: + echo ‘::1 localhost localhost.localdomain localhost6 localhost6.localdomain6’
mongod-m103: + echo ‘fe00::0 ip6-localnet’
mongod-m103: + echo ‘ff00::0 ip6-mcastprefix’
mongod-m103: + echo ‘ff02::1 ip6-allnodes’
mongod-m103: + echo ‘ff02::2 ip6-allrouters’
mongod-m103: + echo ‘ff02::3 ip6-allhosts’
mongod-m103: + echo ‘192.168.103.100 m103 m103’
mongod-m103: Install MongoDB Enterprise Repository
mongod-m103: + update_repo
mongod-m103: + echo ‘Install MongoDB Enterprise Repository’
mongod-m103: + echo ‘deb [ arch=amd64 ] http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.6 multiverse’
mongod-m103: + sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
mongod-m103: deb [ arch=amd64 ] http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.6 multiverse
mongod-m103: + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 0C49F3730359A14518585931BC711F9BA15703C6
mongod-m103: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.SckfVHrPba --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 0C49F3730359A14518585931BC711F9BA15703C6
mongod-m103: gpg:
mongod-m103: requesting key A15703C6 from hkp server keyserver.ubuntu.com
mongod-m103: ?:
mongod-m103: [fd 4]: read error: Connection reset by peer
mongod-m103: gpgkeys: HTTP fetch error 7: couldn’t connect: eof
mongod-m103: gpg:
mongod-m103: no valid OpenPGP data found.
mongod-m103: gpg:
mongod-m103: Total number processed: 0
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
PS C:\Projects\MongoDB\University\m103\m103-vagrant-env> vagrant provision
==> mongod-m103: Running provisioner: shell…
mongod-m103: Running: C:/Users/triley/AppData/Local/Temp/vagrant-shell20190417-4088-1bqxaj9
mongod-m103: + config
mongod-m103: + sudo su
mongod-m103: + echo -e never
mongod-m103: + echo -e never
mongod-m103: + echo manual
mongod-m103: + sudo tee /etc/init/mongod.override
mongod-m103: manual
mongod-m103: + ip_config
mongod-m103: ++ ifconfig
mongod-m103: ++ grep ‘inet addr:’
mongod-m103: ++ cut -d: -f2
mongod-m103: ++ grep -v 127.0.0.1
mongod-m103: ++ tail -1
mongod-m103: ++ awk ‘{ print $1}’
mongod-m103: + export CLIENT_IP_ADDR=192.168.103.100
mongod-m103: + CLIENT_IP_ADDR=192.168.103.100
mongod-m103: ++ hostname
mongod-m103: + export CLIENT_FQDN=m103
mongod-m103: + CLIENT_FQDN=m103
mongod-m103: ++ hostname
mongod-m103: ++ cut -d. -f 1
mongod-m103: ++ tr ‘[:upper:]’ ‘[:lower:]’
mongod-m103: + export CLIENT_NAME=m103
mongod-m103: + CLIENT_NAME=m103
mongod-m103: + echo ‘Configuring /etc/hosts …’
mongod-m103: Configuring /etc/hosts …
mongod-m103: + echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ’
mongod-m103: + echo ‘::1 localhost localhost.localdomain localhost6 localhost6.localdomain6’
mongod-m103: + echo ‘fe00::0 ip6-localnet’
mongod-m103: + echo ‘ff00::0 ip6-mcastprefix’
mongod-m103: + echo ‘ff02::1 ip6-allnodes’
mongod-m103: + echo ‘ff02::2 ip6-allrouters’
mongod-m103: + echo ‘ff02::3 ip6-allhosts’
mongod-m103: + echo ‘192.168.103.100 m103 m103’
mongod-m103: + update_repo
mongod-m103: + echo ‘Install MongoDB Enterprise Repository’
mongod-m103: Install MongoDB Enterprise Repository
mongod-m103: + echo ‘deb [ arch=amd64 ] http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.6 multiverse’
mongod-m103: + sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
mongod-m103: deb [ arch=amd64 ] http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.6 multiverse
mongod-m103: + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 0C49F3730359A14518585931BC711F9BA15703C6
mongod-m103: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.s1iWGGRL7E --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 0C49F3730359A14518585931BC711F9BA15703C6
mongod-m103: gpg:
mongod-m103: requesting key A15703C6 from hkp server keyserver.ubuntu.com
mongod-m103: ?: [fd 4]: read error: Connection reset by peer
mongod-m103: gpgkeys: HTTP fetch error 7: couldn’t connect: eof
mongod-m103: gpg: no valid OpenPGP data found.
mongod-m103: gpg: Total number processed: 0
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
PS C:\Projects\MongoDB\University\m103\m103-vagrant-env> vagrant ssh
Welcome to Ubuntu 14.04.6 LTS (GNU/Linux 3.13.0-168-generic x86_64)

System information as of Wed Apr 17 22:41:03 UTC 2019

System load: 0.36 Processes: 87
Usage of /: 3.6% of 39.34GB Users logged in: 0
Memory usage: 6% IP address for eth0: 10.0.2.15
Swap usage: 0% IP address for eth1: 192.168.103.100

Graph this data and manage this system at:
https://landscape.canonical.com/

0 packages can be updated.
0 updates are security updates.

New release ‘16.04.6 LTS’ available.
Run ‘do-release-upgrade’ to upgrade to it.

vagrant@m103:~ ls vagrant@m103:~ ls /all
ls: cannot access /all: No such file or directory
vagrant@m103:~ ls -all total 28 drwxr-xr-x 4 vagrant vagrant 4096 Apr 17 22:40 . drwxr-xr-x 4 root root 4096 Apr 17 22:39 .. -rw-r--r-- 1 vagrant vagrant 220 Apr 9 2014 .bash_logout -rw-r--r-- 1 vagrant vagrant 3637 Apr 9 2014 .bashrc drwx------ 2 vagrant vagrant 4096 Apr 17 22:40 .cache -rw-r--r-- 1 vagrant vagrant 675 Apr 9 2014 .profile drwx------ 2 vagrant vagrant 4096 Apr 17 22:40 .ssh vagrant@m103:~ download_validators
download_validators: command not found
vagrant@m103:~ download_validators download_validators: command not found vagrant@m103:~

Apologies if I provided too much information.

Please check this link

Download Validation files

What is /all in your ls output?
Please check /shared dir or try to search for the validator files by find command starting from root(/)

@Timothy_29876

Have you tried turning OFF Hyper-V and give it another go?

See if the following works for you?

FYI, had given up running Vagrant+VirtualBox with Hyper-V enabled. Unfortunately I need Hyper-V for Docker.

Managed to get it to work on Vagrant 2.N+VirtualBox on Windows 10 HOME with virtualization turned on in the BIOS and NO Hyper-V.

Also work with AWS Free Tier or Ubuntu Trusty Desktop on VirtualBox.

Hi Edwin, yes, Hyper-V is turned off (I had ran into an issue with that many months ago). The “strange” thing is that a brand new computer does not work (as
previously mentioned, Windows 10).

That was the same issue I ran into months ago, with Docker that is, but I am not using Docker in a prod environment, so I disabled Hyper-V.

Here is my /all output (this is right after running the vagrant ssh command). When I am at the vagrant command line, none of the commands are recognized when I am actually running the vagrant shell. For example, if i run download_validators, i receive a command not found error message.

vagrant@m103:~$ ls
vagrant@m103:~$ ls -all
total 32
drwxr-xr-x 4 vagrant vagrant 4096 Apr 23 00:17 .
drwxr-xr-x 4 root    root    4096 Apr 23 00:07 ..
-rw------- 1 vagrant vagrant  317 Apr 23 00:17 .bash_history
-rw-r--r-- 1 vagrant vagrant  220 Apr  9  2014 .bash_logout
-rw-r--r-- 1 vagrant vagrant 3637 Apr  9  2014 .bashrc
drwx------ 2 vagrant vagrant 4096 Apr 23 00:07 .cache
-rw-r--r-- 1 vagrant vagrant  675 Apr  9  2014 .profile
drwx------ 2 vagrant vagrant 4096 Apr 23 00:07 .ssh
vagrant@m103:~$

I understand your commands are not working
Did you try to download that tarfile
Please check our forums others too faced it

mongod-m103: Downloading Validation Scripts
mongod-m103: + curl -s https://s3.amazonaws.com/edu-static.mongodb.com/lessons/M103/m103_validation.tgz -o m103_validation.tgz
mongod-m103: + tar -xzvf m103_validation.tgz -C /var/m103/validation

I had the same issue where things are working and suddenly it all died. The vagrant ssh is still up and running and any commands are unrecognizable/unknown. Had to do a vagrant halt and up again.

I can only guess that the vagrant provision wasn’t able to run into completion when you have the private key error before or the box that it created is incomplete. I’ll remove the other files and redo the vagrant up and provision thing. You are using vagrant 2 right? I have a similar problem like this when I mistakenly used vagrant 1.9 which is supposedly for Windows 7.

So, as a note, my Ubuntu was never actually fully setup. I wound up searching online and came across the following article: https://github.com/StackStorm/ansible-st2/issues/64. Now it could just be coincidence and I am in no way any sort of Linux/MongoDB expert (and maybe I missed something else in the forums), but this line: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 0C49F3730359A14518585931BC711F9BA15703C6 seemed to be the issue for me.

When I changed the above to the following: sudo apt-key adv --keyserver “hkp://keyserver.ubuntu.com:80” --recv 0C49F3730359A14518585931BC711F9BA15703C6 there was A LOT more activity in the console and it finished without error. I looked at the file from the course I had downloaded and it was the first line (no quotes, “hkp://”, or :80).

Again, if I missed an update that addresses this, sorry. However, if the mongod file can be updated for other folks, could save some headaches (I had to drop my class for the second time, but now know I can successfully work on it next month).