Why doesn't vagrant clean nfs exports file?

463 views
Skip to first unread message

David Salazar

unread,
Oct 21, 2014, 6:24:19 PM10/21/14
to vagra...@googlegroups.com
So I was shocked to realize that vagrant doesn't cleanup its exports to nfs via /etc/exports when I halt the machine. Is this expected or normal behavior. Is there anyway I can make vagrant clean it up so that when i halt it and launch another vagrant setup that uses nfs there aren't any conflicts with nfs shares. I have to do this manually right now.

Alvaro Miranda Aguilera

unread,
Oct 21, 2014, 10:00:33 PM10/21/14
to vagra...@googlegroups.com
Hello
 
if you do vagrant destroy, the exportfs gets removed?
 
Why you would expect the same on vagrant halt?
 
What do you mean by issues with other vms?
 
you can have multiple entries on exports and they will work without problem.
 
Thanks,
Alvaro.
 

 
On Wed, Oct 22, 2014 at 11:24 AM, David Salazar <davidk...@gmail.com> wrote:
So I was shocked to realize that vagrant doesn't cleanup its exports to nfs via /etc/exports when I halt the machine. Is this expected or normal behavior. Is there anyway I can make vagrant clean it up so that when i halt it and launch another vagrant setup that uses nfs there aren't any conflicts with nfs shares. I have to do this manually right now.

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David S

unread,
Oct 23, 2014, 12:14:17 AM10/23/14
to vagra...@googlegroups.com
I keep getting nfs conflicts if i have nfs shares using the same directories.  

I often have these as nfs shares. 
"/Users/username/Code", "/home/vagrant/code".

If i run one vagrant box...it add this to my exports.
# VAGRANT-BEGIN: 501 5b85e6ec-04ac-4b0d-b7cd-a36b57a39bdd
"/Users/username/Code" 192.168.22.10 -alldirs -mapall=501:20
# VAGRANT-END: 501 5b85e6ec-04ac-4b0d-b7cd-a36b57a39bdd

Then when I suspend or halt that one and run another one.  It gives me a conflict error. In order for me to fix this, i have to remove the conflicting share and do vagrant reload.

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o 'vers=3,udp' 192.168.10.1:'/Users/username/Code/app' /home/vagrant/app
Stdout from the command:
Stderr from the command:
stdin: is not a tty
mount.nfs: access denied by server while mounting 192.168.10.1:/Users/username/Code/app

David S

unread,
Oct 23, 2014, 12:28:26 AM10/23/14
to vagra...@googlegroups.com
Here is a thread that goes nowhere of people talking about the same issue.  People end up just clearing out their exports or commenting it out. 

Alvaro Miranda Aguilera

unread,
Oct 23, 2014, 4:15:40 PM10/23/14
to vagra...@googlegroups.com
can you paste a bad /etc/exprorts?
 
are you in the last vagrant version?
 
What I am understand now is this.
 
vagrant setup /etc/exports for a folder, and secure by guest ip access.
 
a new guest came in, and /etc/exports gets updated, and having multiple entires cause trouble.
 
I will like to see one /etc/exports first since I would assume all the vms are having the same ip, so the same /etc/exports should work
 
if each guest is getting different ip, then /etc/exports should be like
 
/folder machine1(permissions) machine2(permissions)
 
instead of
 
/folder machine1(permissions)
/folder machine2(permissions)
 
Thanks

--

David S

unread,
Oct 24, 2014, 11:36:33 PM10/24/14
to vagra...@googlegroups.com
Here is my exports. They are diff private ips. 

Alvaro Miranda Aguilera

unread,
Oct 25, 2014, 4:48:21 AM10/25/14
to vagra...@googlegroups.com
well, the issue there is a security feature.. not always is possible to share a folder and mount from a different level..

say you share /folder/path1/subdir

in some unixes you can mount /folder/path1/subdir/my_folder_I_want bit is not always possible, i can't remember where it works, my impression is on linux it does.. but I have tried for different reason on osx and did hit the same wall you are seeing

so here the issue is one folder is included in the other, that osx is not allowing you to mount one..

Can you try to share the same folder up to the same level?

in both cases : /Users/username/Code/app

or in both cases /Users/username/Code

?

David Salazar

unread,
Oct 25, 2014, 5:01:39 AM10/25/14
to vagra...@googlegroups.com
Yes, that appears to have fixed it.  Hm. so it’s an OSx / nfs issue i see.  thanks for being patient and helping me out.  


You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/CEAXWzZ3bBM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

Alvaro Miranda Aguilera

unread,
Oct 25, 2014, 6:49:17 PM10/25/14
to vagra...@googlegroups.com
not a problem, glad it helped.

Most of the issues on the mailing list are not vagrant fault, so I help as much as I can

Alvaro
Reply all
Reply to author
Forward
0 new messages