Lab: Setting Up the Vagrant Environment

Hi All,

While setting up the vagrant machine and review the below logs. i’m unable to vagrant ssh ang getting the errro. Requesting you to check and provide me solution for this.

C:\103\m103-vagrant-env>vagrant up --provision
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’ (v20190514.0.0) for provider: virtualbox
mongod-m103: Downloading: https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/20190514.0.0/providers/virtualbox.box
==> mongod-m103: Box download is resuming from prior download progress
mongod-m103: Download redirected to host: cloud-images.ubuntu.com
mongod-m103:
==> mongod-m103: Successfully added box ‘ubuntu/trusty64’ (v20190514.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: Warning: Connection reset. Retrying…
mongod-m103: Warning: Connection aborted. Retrying…
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: 6.0
==> mongod-m103: Setting hostname…
==> mongod-m103: Configuring and enabling network interfaces…
==> mongod-m103: Mounting shared folders…
mongod-m103: /shared => C:/103/m103-vagrant-env/shared
mongod-m103: /vagrant => C:/103/m103-vagrant-env
mongod-m103: /dataset => C:/103/m103-vagrant-env/dataset
==> mongod-m103: Running provisioner: shell…
mongod-m103: Running: C:/Users/Vinod Kumar/AppData/Local/Temp/vagrant-shell20200425-3148-1gyzbzx
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: ++ awk ‘{ print $1}’
mongod-m103: ++ grep -v 127.0.0.1
mongod-m103: ++ cut -d: -f2
mongod-m103: + export CLIENT_IP_ADDR=192.168.103.100
mongod-m103: + CLIENT_IP_ADDR=192.168.103.100
mongod-m103: ++ tr ‘[:upper:]’ ‘[:lower:]’
mongod-m103: ++ cut -d. -f 1
mongod-m103: ++ hostname
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’
mongod-m103: + update_repo
mongod-m103: + echo ‘Install MongoDB Enterprise Repository’
mongod-m103: Install MongoDB Enterprise Repository
mongod-m103: + sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
mongod-m103: + echo ‘deb [ arch=amd64 ] http://repo.mongodb.com/apt/ubuntu trusty/mongodb-enterprise/3.6 multiverse’
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.JhRZNScPKA --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/ubuntu-advantage-esm-infra-trusty.gpg --keyserver keyserver.ubuntu.com --recv 0C49F3730359A14518585931BC711F9BA15703C6
mongod-m103: gpg:
mongod-m103: requesting key A15703C6 from hkp server keyserver.ubuntu.com
mongod-m103: ?: keyserver.ubuntu.com: Host not found
mongod-m103: gpgkeys: HTTP fetch error 7: couldn’t connect: Connection timed out
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.

C:\103\m103-vagrant-env>
C:\103\m103-vagrant-env>
C:\103\m103-vagrant-env>vagrant ssh
Welcome to Ubuntu 14.04.6 LTS (GNU/Linux 3.13.0-170-generic x86_64)

System information as of Sat Apr 25 03:08:20 UTC 2020

System load: 0.95 Processes: 88
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%

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

UA Infrastructure Extended Security Maintenance (ESM) is not enabled.

0 updates can be installed immediately.
0 of these updates are security updates.

Enable UA Infrastructure ESM to receive 64 additional security updates.
See https://ubuntu.com/advantage or run: sudo ua status

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

vagrant@m103:~$

Your second attempt seems to be ok
You are on Vagrant box

It actually failed halfway through. Please follow the steps in this post.

And ensure that your firewall, anti-virus, VPN, malware protection is temporarily off before you run vagrant up.

Hi @imkumarV,

As I can see, you have successfully set up the virtual environment on your system. Please let us know if you have any questions.

~ Shubham

Hi Shubam,

No, Still not setup cluster and facing issue.

Looking forward help to sort it out

Like @Shubham_Ranjan rightly said, you have setup the virtual environment. This thread is about setting up the vagrant virtual environment.

Hi @imkumarV,

What issues are you facing ? Please create a new thread for it.

~ Shubham

this post has become private sir its not working

@Manyu_N_A, it looks like the guys at MongoDB carried out a data/platform upgrade to this Forum and that has completely ruined some of the hyperlinks and images.

Here’s the new link:
https://www.mongodb.com/community/forums/t/issues-during-building-virtual-box-for-basic-admin-topic/56590/24