Cannot share files with vagrant

I was able to use the “shared” folder in vagrant last week for homework;
but after I started working M310 homework;
M312 vagrant “shared” is not detected
(but the M310 shared folder are accessible in vagrant. )

Delete folders and reinstall rsync, remove Virtual box instance for re-installations
all with no effect

Any suggestion?

Choa

@ChaoYen

Exactly which course are you doing here?? If you’re trying to do both at once, you should have two entirely separate VMs, one for each course. And I would very, very strongly suggest that those be in different directories.

I am doing M310 and I am using two windows directories and two virtual box
I found the shared folder though in vagrant
but it is under vagrant@m312:/vagrant
vagrant@m312:/vagrant:$ ls
Vagrantfile provision-m312 shared

not under vagrant@m312:~$ as I thought.

@ChaoYen

Sorry, but I still don’t understand what you’re doing here.

Let’s try this. Log into your M312 VM with vagrant ssh. Then run

ls -la

followed by

sudo ls -l /

and post the results back here. Then maybe I can see where your problem is. Good luck

I think I just confused where the “shared” folder is when I work on both M312 and M310 ; in the M310 class; it is directly under vagrant@m312:~ while in M312, it is in the top;

This is what the result is
vagrant@m312:~ ls -la total 40 drwxr-xr-x 6 vagrant vagrant 4096 Mar 22 14:48 . drwxr-xr-x 4 root root 4096 Mar 22 00:50 .. -rw-r--r-- 1 vagrant vagrant 220 Apr 9 2014 .bash_logout -rw-r--r-- 1 vagrant vagrant 3637 Apr 9 2014 .bashrc drwx------ 2 vagrant vagrant 4096 Mar 22 00:50 .cache -rw------- 1 vagrant vagrant 303 Mar 22 14:48 .dbshell -rw------- 1 vagrant vagrant 0 Mar 22 01:05 .mongorc.js -rw-r--r-- 1 vagrant vagrant 691 Mar 22 00:52 .profile drwx------ 2 vagrant vagrant 4096 Mar 22 00:50 .ssh drwxrwxrwx 4 root root 4096 Mar 22 00:59 data drwxrwxr-x 2 vagrant vagrant 4096 Mar 22 01:01 dataset vagrant@m312:~ sudo ls -l /
total 88
drwxr-xr-x 2 root root 4096 Mar 12 21:51 bin
drwxr-xr-x 3 root root 4096 Mar 12 20:47 boot
drwxrwxrwx 3 vagrant vagrant 4096 Mar 22 00:52 data
drwxrwxrwx 1 vagrant vagrant 0 Mar 22 01:02 dataset
drwxr-xr-x 13 root root 3880 Mar 22 14:44 dev
drwxr-xr-x 98 root root 4096 Mar 22 00:51 etc
drwxr-xr-x 4 root root 4096 Mar 22 00:50 home
lrwxrwxrwx 1 root root 34 Mar 12 20:46 initrd.img -> boot/initrd.img-3.13.0-166-generic
lrwxrwxrwx 1 root root 34 Mar 12 20:46 initrd.img.old -> boot/initrd.img-3.13.0-166-generic
drwxr-xr-x 21 root root 4096 Mar 22 00:50 lib
drwxr-xr-x 2 root root 4096 Mar 12 20:45 lib64
drwx------ 2 root root 16384 Mar 12 20:48 lost+found
drwxr-xr-x 2 root root 4096 Mar 12 20:44 media
drwxr-xr-x 2 root root 4096 Apr 10 2014 mnt
drwxr-xr-x 3 root root 4096 Mar 22 00:50 opt
dr-xr-xr-x 97 root root 0 Mar 22 00:50 proc
drwx------ 3 root root 4096 Mar 22 00:50 root
drwxr-xr-x 22 root root 840 Mar 22 00:53 run
drwxr-xr-x 2 root root 4096 Mar 22 00:51 sbin
drwxrwxrwx 1 vagrant vagrant 4096 Mar 22 00:39 shared
drwxr-xr-x 2 root root 4096 Mar 12 20:44 srv
dr-xr-xr-x 13 root root 0 Mar 22 00:50 sys
drwxrwxrwt 4 root root 4096 Mar 22 01:17 tmp
drwxr-xr-x 10 root root 4096 Mar 12 20:44 usr
drwxrwxrwx 1 vagrant vagrant 4096 Mar 22 00:49 vagrant
drwxr-xr-x 13 root root 4096 Mar 22 00:50 var
lrwxrwxrwx 1 root root 31 Mar 12 20:46 vmlinuz -> boot/vmlinuz-3.13.0-166-generic
lrwxrwxrwx 1 root root 31 Mar 12 20:46 vmlinuz.old -> boot/vmlinuz-3.13.0-166-generic
vagrant@m312:~$

Thanks.

@ChaoYen

Yes, the ‘shared’ folder is in a different location in M310 (under the vagrant user) than it is here, where it’s under the root directory, so you access it as /shared, not ./shared – small but vital difference. :wink:

You can always do grep shared /etc/fstab to find the appropriate the directory.

@steevej-1495

Well, yes, but I think if the student knew enough to do that, he wouldn’t have the problem in the first place. :wink:

Still, good general advice. Thanks. :grin: