Trouble with Vagrant

I am having some trouble finding my way with the proper use of Vagrant, while working on “Homework 1.2 : Enabling Authentication on a Running Replica Set”.

Here is what I am trying to do at this point.

…:m310-vagrant-env me$ cd shared/
…:shared me$ ls
setup-hw-1.2.sh validate-hw-1.2.sh
…:shared me$ ./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
MongoDB shell version v4.2.0
connecting to: mongodb://127.0.0.1:31120/?compressors=disabled&gssapiServiceName=mongodb
2020-11-17T18:24:01.639+0900 E QUERY [js] Error: couldn’t connect to server 127.0.0.1:31120, connection attempt failed: SocketException: Error connecting to 127.0.0.1:31120 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
2020-11-17T18:24:01.644+0900 F - [main] exception: connect failed
2020-11-17T18:24:01.644+0900 E - [main] exiting with code 1
…:shared me$

As one can see, I can’t run the setup-hw-1.2.sh script.

I presume I am not doing this in the right environment or the right place. But what is it exactly that I am doing wrong?
How can I check that I am in the right place?

You should be doing that on the VM machine. From your prompt it looks like you are running this from your host machine. Use vagrant ssh database to login to the VM.

Thanks. Indeed I realized my mistake in the mean time.