/dataset folder empty and shared folder not working

Directory /dataset on my m103 VM is empty. I can’t move files between my PC and the shared folder either. How do I get the products.json file to my VM?

I also tried the curl command from this piece of code, but that didn’t pull any data either. Return code is 23.

function download_dataset() {
echo “Downloading Dataset”
curl -s https://s3.amazonaws.com/edu-static.mongodb.com/lessons/M103/products.json.tgz -o products.json.tgz
tar -xzvf products.json.tgz -C /dataset
rm -rf products.json.tgz
}

Any ideas?

Thanks, Jan

Curl worked with sudo.

Weird though that my /shared directory doesn’t work!

Hi jan_47492,

It might be the case that your vagrant machine is locked!

Try provision your vagrant again if you still can’t share the files.

It happened with me too. But I didn’t have that much work done in my vagrant. So I removed the machine and re-downloaded and added it back. It worked then.

Hope it helps!
Kanika

you can mount the VirtualBox shared folders with e command below

sudo mount -t vboxsf dataset /dataset
then
cd /dataset

To locate these on your host machine (mine is Windows), look at the VirtualBox VM window there are a series of icons along the bottom of it, including one for shared folders. Right-click to bring up the properties and this should list the location of the folders on the host server,

3 Likes

Thanks Garrett! I got another folder mounted and able to share files.
I was under the impression it should have worked “out of the box” with this setup, not sure why it didn’t for me.

1 Like

Thanks! I have been looking for a while as to why I couldn’t get my products.json file to import. Released the files weren’t mounted when I saw your post. That is weird though, the .vagrant directory has a file that maps the shared folders between the host and the guest.

@Seth_53417, /dataset is a VBox share which should auto-mount each time you bring up the machine. You shouldn’t ever need to manually run the mount command for this share.

A typical resolution for this issue is to:

  1. Reload the machine:
    vagrant reload

    Or

  2. Shutdown and bring the machine up
    vagrant halt
    vagrant up

    Or

  3. Destroy and rebuild the machine
    vagrant destroy -f
    vagrant up

1 Like

I will check that out. I actually made a mistake by allowing my box to update and it broke the configuration. I completely deleted my vagrant box and followed through the instructions to get a new one set up.

I will try your suggested resolutions. I don’t want to have to manually mount the drives each time I start my machine.

Thanks!

Let us know how it goes, and when you do, please share the output of this command:
ls -l /{shared,dataset,vagrant}

So, I tried the vagrant reload and the directories came up automatically. I don’t know why they weren’t before, but they are now.

Last login: Fri Mar  6 17:07:28 2020 from 10.0.2.2
vagrant@m103:~$ ls -l /{shared,dataset,vagrant}
/dataset:
total 135592
-rwxrwxrwx 1 vagrant vagrant 92216793 Mar  5  2018 products.json
-rwxrwxrwx 1 vagrant vagrant 46628133 Jul 17  2019 products.part2.json

/shared:
total 0

/vagrant:
total 12
-rwxrwxrwx 1 vagrant vagrant  792 Mar  5 19:44 Vagrantfile
drwxrwxrwx 1 vagrant vagrant    0 Mar  5 19:48 dataset
-rwxrwxrwx 1 vagrant vagrant 4828 Mar  5 19:44 provision-mongod
drwxrwxrwx 1 vagrant vagrant    0 Mar  6 15:52 shared
vagrant@m103:~$

Thanks again for your help!

Very good! :slight_smile: :+1: