./validate-hw-1.2.sh $: command not found

I am unable to execute the command provided for the lab exercise. It has been asked to download the handouts in /shared folder. But what should be the exact path ? Did we need to unzip the file or not ?

I have tried all the possibilities still could get any output neither able to see the files copied in /shared path when logged in to vagrant.
Kindly help me those who know how to proceed for this. I am unable to complete the exercises due to this.

Prompt help would be appreciated.

Thank you.

Could you provide the output of the following commands.

ls -l /shared
df -v 

Hi Steeve,


vagrant@database:~/shared$ ls -l /shared
ls: cannot access /shared: No such file or directory

vagrant@database:~/shared$ df -v
Filesystem 1K-blocks Used Available Use% Mounted on
udev 503860 12 503848 1% /dev
tmpfs 101768 368 101400 1% /run
/dev/sda1 41251136 1522960 37992264 4% /
none 4 0 4 0% /sys/fs/cgroup
none 5120 0 5120 0% /run/lock
none 508828 0 508828 0% /run/shm
none 102400 0 102400 0% /run/user
vagrant 382839804 73705856 309133948 20% /vagrant
home_vagrant_shared 382839804 73705856 309133948 20% /home/vagrant/shared


vagrant@database:~/shared$ ./setup-hw-1.2.sh
./setup-hw-1.2.sh: line 28: mongod: command not found
./setup-hw-1.2.sh: line 28: mongod: command not found
./setup-hw-1.2.sh: line 28: mongod: command not found

This is also showing different error.

It looks like for this course the shared directory is /home/vagrant/shared rather than /shared. If you run

ls -l /home/vagrant/shared

we will know more about what is in there. Running ./setup-hw-1.2.sh was the logical thing to do but I still don’t know why it is not there. The above ls might help.

I think the script is there but it is failing at this section

mongod --dbpath “$workingDir/r$i” …

Could be path problem

Are you able to invoke mongo command?
Please review the script contents
Did it complete previous steps like creating working dirs etc

@steevej-1495 is right about the location of the shared folder for this course.
If you (can) edit the Vagrantfile, just change /home/vagrant/shared to /shared, then destroy (vagrant destroy database) and up the database machine (vagrant up database). You can do the same thing for the infrastructure machine.

Once you destroy and re-provision the machine, it should also resolve the mongod: command not found problem too.


Hello Guys,

I am still not able to connect to mongod. I tried destroying both the machines still the problem.

That’s a strange occurrence.
Let’s see screenshots of the:

  • provision-database file
  • destroy command and below… need to see the outputs of destroy and up commands.
1 Like



provision-database file:

Let’s do it again properly. Include the machine name as above:

  1. vagrant destroy infrastructure
  2. vagrant destroy database
  3. On your local machine, delete the .vagrant folder
  4. vagrant up database

Don’t bring up the infrastructure machine just yet.

Show the full screenshot of all the outputs.

1 Like

Can you please tell me the what exactly you mean changing the home to /shared?

I couldn’t get the /home/vagrant/shared anywhere in vagrantfile.

This is the Vagrantfile:

From your other thread, it looks like you’re logged in as a regular user and regular Users have read/execute access only. You will not be able to edit the Vagrantfile unless you’re logged in as an Admin.

Also note, vagrant up is not the same as vagrant up --provision.

1 Like

HI @007_jb,

I followed the exact steps with editing the vagrant file putting /shared path.

  1. Destroyed the database and infrastructure.
  2. Deleted the vagrant file
  3. Started the database machine only,
    vagrant up database.

But getting few errors in the output,

Ok, you’re making progress. This is a different error now and there’s a solution for that. See this post:

Remember to destroy before up.

Yes I destroyed and then started.

I am able to start the database VM, but look at the below error,

Let me see a full screenshot of the installation process. And did you alter the Provision-database file as per my last post?

Which installation ? I made the changes to provision-database after starting the vagrant database machine.
Is that correct ?? Or do I need to again destroy and the start again ?

Edit and save the file, destroy, up.

Do that then show us a screenshot of the output of vagrant up.

Hi JB,


Check the error: