Shared folder not found in VM m312

I could not find the shared folder in VM m312 HOME directory nor any other one. It exists in my Windows folder, initially created by extracting files from m312-vagrant-env.zip with following activating vagrant as described in the course notes.

@ ALEX_SHPITS_36688

Well, that’s a bit strange. Please check your full system directory with ls -l / and post the results back here if /shared and /dataset are not there, including the Vagrantfile you’re using, and I’ll try to help.

It looks like the directories you asked me to find are there:
vagrant@m312:~$ ls -l /
total 80
drwxr-xr-x 2 root root 4096 Jan 10 21:42 bin
drwxr-xr-x 3 root root 4096 Jan 10 20:47 boot
drwxrwxrwx 3 vagrant vagrant 4096 Feb 17 06:54 data
drwxrwxrwx 1 vagrant vagrant 0 Feb 17 06:47 dataset
drwxr-xr-x 13 root root 3880 Feb 19 02:57 dev
drwxr-xr-x 98 root root 4096 Feb 19 02:56 etc
drwxr-xr-x 4 root root 4096 Feb 17 06:48 home
lrwxrwxrwx 1 root root 34 Jan 10 20:46 initrd.img -> boot/initrd.img-3.13.0-164-generic
drwxr-xr-x 21 root root 4096 Feb 17 06:49 lib
drwxr-xr-x 2 root root 4096 Jan 10 20:44 lib64
drwx------ 2 root root 16384 Jan 10 20:47 lost+found
drwxr-xr-x 2 root root 4096 Jan 10 20:43 media
drwxr-xr-x 2 root root 4096 Apr 10 2014 mnt
drwxr-xr-x 3 root root 4096 Feb 17 06:49 opt
dr-xr-xr-x 96 root root 0 Feb 19 02:56 proc
drwx------ 3 root root 4096 Feb 17 06:48 root
drwxr-xr-x 22 root root 820 Feb 19 02:57 run
drwxr-xr-x 2 root root 4096 Feb 17 06:51 sbin
drwxrwxrwx 1 vagrant vagrant 0 Feb 17 06:59 shared
drwxr-xr-x 2 root root 4096 Jan 10 20:43 srv
dr-xr-xr-x 13 root root 0 Feb 19 02:56 sys
drwxrwxrwt 4 root root 4096 Feb 19 02:57 tmp
drwxr-xr-x 10 root root 4096 Jan 10 20:43 usr
drwxrwxrwx 1 vagrant vagrant 0 Feb 17 06:47 vagrant
drwxr-xr-x 13 root root 4096 Feb 17 06:48 var
lrwxrwxrwx 1 root root 31 Jan 10 20:46 vmlinuz -> boot/vmlinuz-3.13.0-164-generic

However, if you look inside of the shared folder, (I created by mkdir command) you will find two files, (I created manually by vi editor) last night:
/home/vagrant
vagrant@m312:~ cd shared vagrant@m312:~/shared ls -l
total 8
-rw-rw-r-- 1 vagrant vagrant 190 Feb 17 15:24 single.cfg
-rw-rw-r-- 1 vagrant vagrant 1406 Feb 17 15:16 singleapp.py

my windows vagrant environment directory, I use for invoking vagrant

C:\Users\Alex\Documents\MongoDB\m312A-vagrant-env>vagrant ssh

contains dataset and shared folders

Directory of C:\Users\Alex\Documents\MongoDB\m312A-vagrant-env

02/17/2019 01:47 AM .
02/17/2019 01:47 AM …
02/17/2019 01:28 AM .vagrant
02/17/2019 01:47 AM dataset
02/17/2019 12:32 AM 2,636 provision-m31A
02/17/2019 01:59 AM shared
02/17/2019 01:39 AM 984 Vagrantfile
2 File(s) 3,620 bytes
5 Dir(s) 61,820,411,904 bytes free
There is a single file test in the shared directory there:

Directory of C:\Users\Alex\Documents\MongoDB\m312A-vagrant-env\shared

02/17/2019 01:59 AM .
02/17/2019 01:59 AM …
02/17/2019 01:59 AM 8 test.txt
1 File(s) 8 bytes
2 Dir(s) 61,823,098,880 bytes free

C:\Users\Alex\Documents\MongoDB\m312A-vagrant-env\shared>type test.txt
hello
There is no test.txt file in the shared directory on m312 VM. Again,that directory didn’t exist until I created it.
At this point, my only challenge is I can’t share the files between windows and VM, using the shared directories. I have to admit, I didn’t have this kind of issue in my m103 and m310 VMs

@ ALEX_SHPITS_36688

Well, the point of the ls command was to see if those two directories had been automatically created – so creating one or both manually within the VM really doesn’t help. Did you also create the dataset directory manually?

Clearly your connection between the Windows system and the VM isn’t working correctly, but I can’t tell why from your post unfortunately.

@ALEX_SHPITS_36688, it looks like you are confused about directories. There is a difference between /shared and ./shared and shared. In this particular VM, the shared directory that is also visible from Windows is /shared. After you ssh into vagrant your current directory is your home directory, in this case it is /home/vagrant. When you did ‘cd shared’, you changed your current directory to /home/vagrant/shared.

This is just like windows. c:\Users\Alex…\shared is not the same as c:\shared.

You really have to understand those concepts as this course is an advanced course.

I am well aware that is an advanced course, I passed M001, M103, M201 classes, before taking this one.
I thought, the purpose of this forum is to get help in a professional way not to be lectured by some “guru” with the statement “You really have to understand those concepts as this course is an advanced course”, I found my test.txt file in /shared directory.

1 Like